LEX / YACC - extension of yacc and lex files with additional rules and definitions

"Roul Oldenburger" <rogers@firemail.de>
31 Jul 2002 01:02:06 -0400

          From comp.compilers

Related articles
LEX / YACC - extension of yacc and lex files with additional rules a rogers@firemail.de (Roul Oldenburger) (2002-07-31)
| List of all articles for this month |
From: "Roul Oldenburger" <rogers@firemail.de>
Newsgroups: comp.compilers
Date: 31 Jul 2002 01:02:06 -0400
Organization: http://groups.google.com/
Keywords: lex, yacc, question, comment
Posted-Date: 31 Jul 2002 01:01:55 EDT

Hello, I am new to UNIX and its tools lex and yacc. What I like to do
is having a main yacc file which can be extended with additional
definitions and rules in an add-on yacc file via something like a
"yacc-include". I guess yacc has no preprocessor like a C compiler and
probably therefore cannot do somehing like %include "add_rules.y". The
book I have doesn't mention something of use. Does somebody know if
lex and yacc have the possibility to do this or if there is a
workaround?


If somebody knows lex and yacc good enough to say - there is
definitely no intern possibility - please let me know too.


Lex / yacc and flex / bison are said to be compatible, but do the
Linux programms probably have the functionality to do this if lex and
yacc do not?


Thankyou very much
Roul Oldenburger
[I've never seen a version of lex or yacc with file inclusion, but you
can use cpp or m4 as a separate prepass. It's about two lines in your
makefile. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.