OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] [OT] Java Lexical Analyzer?

[ Lists Home | Date Index | Thread Index ]

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






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS