[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple Lexers

From: Philip Herron
Subject: Re: Multiple Lexers
Date: Thu, 09 Apr 2009 18:02:22 +0100
User-agent: Thunderbird (X11/20090318)

Hash: SHA1

Philip Herron wrote:
> Hey guys
> This is my first post so sorry if this is a little basic. I was bugging
> some guys on the autoconf lists about this but its not an autoconf
> problem. Whats the best strategy for multiple lexers in one program. So
> i made a simple lexer
> So my is like:
> bin_PROGRAMS= myprogram
> AM_YFLAGS = -d
> myprogram_CFLAGS= -I$(top_srcdir)/include
> myprogram_SOURCES= ..... basic_parser.l #rules_grammar.y rules_parser.l
> So yeah these are the problems i can compile in this basic_parser.l fine
> but adding in this next 2 files causes the problems. This probably due
> to my limited knowledge of yacc and lex. But i see some people talk
> about the -p flag to change all prefix names of variables and methods.
> Then there is also some people show the gdb hack of redefine everything
> inside the yacc files.... but how does that work for different lexers.
> Or have i got this completely wrong is it that you can create a lexer
> that can work for different things, then its just different yacc files
> for grammar. But i dont know how to do that.
> Anyways thanks loads any help would be awesome to poke me in the right
> direction.
> -Phil


Sorry about this, i was just playing around and i have it working now :)!

I am using one lexer with 2 grammar files and it seems to compile it ok
fine now. Now just to recode a little but i was doing it badly anyways!

Its nice to see automake figures it out for me! The GDB hack of just
#define bla newbla

seemed to work fine just chucking it all inside the grammar file. Though
would it be better to have it as an include?

- -Phil
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


reply via email to

[Prev in Thread] Current Thread [Next in Thread]