[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: JDK 1.2
Chris Watson writes:
> This seems to be a fair solution to the problem, but If my understanding is
> correct then this solution will be applied to all user generated
> parsers/lexers. The concern I can see is that it causes problems with
> adding support for generating parsers in languages other than Java. Whilst
> there are no means to do so now, thought should be taken so as not to
> jepordise a design which is currently well suited to retargetting.
>
> Support for writing out the parse table as a separate file needs to be done
> in a language independent form, which serialisation isn't. Either that or
> there needs to be a mechanism to control the means of parse table output,
> either as an external file or as an array within a source file. The latter
> is preferable since personally I would rather not generate extraneous files
> for small grammars.
I agree in that the parsetab.txt should be an ASCII file with some
simple (human readable) format, eg:
1 { 23, 17, 1, 1, -1 }
2 { 19, 5, 0, 0, -1 }
...
Or whatever. It should be easy enough to read & parse this back in.
Sometimes you need to actually look at the table to figure out what
is going wrong.
-Archie
___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com