Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!umnd-cs!jwabik From: jwabik@cs.D.UMN.EDU (Jeff Wabik) Newsgroups: comp.unix.questions Subject: Followup YACC & LEX Question Message-ID: <719@umnd-cs.D.UMN.EDU> Date: Mon, 10-Aug-87 17:05:25 EDT Article-I.D.: umnd-cs.719 Posted: Mon Aug 10 17:05:25 1987 Date-Received: Tue, 11-Aug-87 05:40:06 EDT Organization: U. of Minnesota-Duluth, Computer Science Lines: 41 Keywords: Selective Parsing Thanks to all who responded to my recent LEX question.. I managed to take two of the 4 responses I got and merge them for a solution.. Another question comes up, now: I'm still having fun with preprocessors. What I now need to do is to implement a (YACC) grammar to preprocess hunks of code, disregarding code that is the actual program body wherever necesary.. For example, Here is a possibility: ? (VAR debug_mode:boolean := TRUE, unhappy_mode:boolean := TRUE; );? . . ?IF (debug_mode) PROCEDURE [XREF] Moo (x:integer); . . . PROCEND Moo; ?ELSE PROCEDURE [XREF] Moo2 (x:real); . . ?IFEND For clarification of my ambiguous comment above, what I need to do is to take a YACC grammar that will accept preprocessor directives but that has no clue about the programming language itself. Thus, I will need to disregard code that is in "". I can deal with program bodies #2 and #3 and their appropriate manipulation, but can't comprehend how to disregard all that middle code. Anyone have an idea? Thanks in advance! -Jeff