|CUP/LEX has limitations email@example.com (Sharma, Girish \(Girish\)) (2005-06-23)|
|Re: CUP/LEX has limitations firstname.lastname@example.org (Scott Nicol) (2005-06-24)|
|Re: CUP/LEX has limitations email@example.com (Joel Jones) (2005-06-26)|
|Re: CUP/LEX has limitations firstname.lastname@example.org (Scott Nicol) (2005-06-26)|
|Re: CUP/LEX has limitations email@example.com (2005-06-30)|
|Re: CUP/LEX has limitations firstname.lastname@example.org (glen herrmannsfeldt) (2005-06-30)|
|Re: CUP/LEX has limitations email@example.com (Scott Nicol) (2005-07-02)|
|Re: CUP/LEX has limitations Martin.Ward@durham.ac.uk (Martin Ward) (2005-07-03)|
|Re: CUP/LEX has limitations firstname.lastname@example.org (A Pietu Pohjalainen) (2005-07-22)|
|Date:||30 Jun 2005 09:59:19 -0400|
|References:||05-06-11505-06-118 05-06-129 05-06-135|
|Posted-Date:||30 Jun 2005 09:59:19 EDT|
As suggested, another solution could be to change the CUP and Lex
source codes, so that it emits a code in which tables are read from a
file rather than being initialized in the program (this is what I have
done because I had to use the parser generator repeatedly not just
once). You need to do two small modifications in CUP/Lex code.
(1) Dump the action and reduce table in a file.
(2) Change emit.java on those places where it emits code which
initialize these tables. Now the emitter should emit the code in which
the tables are read from a file and then are initiaize.
If you have large number of states then you will get code too large
error because the number of case statements will be too high in
generated switch statement. I got this problem when I was generating
the lexical anayzer for COBOL. I broke the switch statement. One way of
breaking the switch statement is suggesetd by the Scott. Another way
could be :
case 1 :
default : fun_call1(val);
default : fun_call2(val);
Again for handeling this, change emitter's code.
Return to the
Search the comp.compilers archives again.