[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 2.0.0.21 (X11/20090318) |
-----BEGIN PGP SIGNED MESSAGE-----
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 Makefile.am 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
> http://redbrain.co.uk
Hey
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkneKhoACgkQAhcOgIaQQ2Hc/wCfXeNJ1YL25JvbxfDG/fTII6yT
zIQAn2SX4DMnKNeOOej+2KueOgtF5eQ8
=FyqK
-----END PGP SIGNATURE-----
- Multiple Lexers, Philip Herron, 2009/04/09
- Re: Multiple Lexers,
Philip Herron <=