[
Lists Home |
Date Index |
Thread Index
]
Hello,
I don't know if its been mentioned, but Andrew Appel uses JLex in his "Modern Compiler Implemented in Java"...here's the URL:
http://www.cs.princeton.edu/~appel/modern/java/JLex/
The source is one Java file, so you can tailor to your needs. Hope this helps.
Cheers!
*********** REPLY SEPARATOR ***********
On 8/23/2002 at 10:48 PM Thomas B. Passin wrote:
>Roger,
>
>I just found jbison using Google:
>
>http://ftp.unicamp.br/pub/languages/java/jbison/
>
>It is still a C program but emits java -
>
>" The jb system allows Java (tm) parsers to be generated using the Gnu
>Bison
>parser generator system. The parser is written using the standard Bison
>language, but the action parts are written in Java. Jb takes the mixed
>C-Java file output by Bison and scans it to extract the parse tables,
>constants, and actions (in Java). Jb then scans various template files
>specified by the user and inserts the extracted information at specified
>points in the templates.
>
>In addition to generating parsers, jb provides three methods of generating
>corresponding lexers.
>
> 1. Flex -- the jb system (starting with version 3.0) can also take lexers
> generated using the Gnu flex generator and translate them to execute
>in
> Java; this is accomplished with a program called jf that operates in a
> manner analogous to jb.
>
> 2. yylex.generic -- A generic ad-hoc lexer that can be modified to
>produce
> lexers for typical programming languages.
>
> 3. yytokenizer.generic -- A wrapper for the Java StreamTokenizer Class."
>
>
>> Thanks Dare. I looked (very) briefly at JavaCC. It may in fact be very
>> powerful, but I really like the simplicity of the lex notion of listing
>> regex/action rule pairs, which are then automatically turned into a
>> lexical analyzer. JavaCC doesn't follow this approach (that I can
>> tell). It seems to be more procedural-oriented. I will check out
>> ANTLR. Thanks! /Roger
>>
>>
>
>Perhaps this will do your job.
>
>Regards,
>
>Tom P
>
>
>
>-----------------------------------------------------------------
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To subscribe or unsubscribe from this list use the subscription
>manager: <http://lists.xml.org/ob/adm.pl>
|