[antlr-interest] how to let parser control lexer state.

David Holroyd dave at badgers-in-foil.co.uk
Sun Apr 29 03:56:23 PDT 2007


On Sun, Apr 29, 2007 at 02:25:35PM +0800, femto gary wrote:
> (actually , the wiki provides an island-grammar example which
> lexing will be controlled by parser, but I feel it is a bit complex
> so would like to write my own solution. besides, I can't find
> the whole source code of metaas, (in their homepage, they
> just put bin download, and in svn trunk, I can't find whole source code.)

I'm the author of that stuff (sorry; should have pointed you at the
example on the wiki before).  All the code is in svn!  :)  Please ask if
there's something specific you can't find.


The main grammar,

  http://svn.badgers-in-foil.co.uk/metaas/trunk/src/main/antlr/org/asdt/core/internal/antlr/AS3.g3

the supporting ANTLR implementation classes (including a token stream
with lazyness and a few other bits),

  http://svn.badgers-in-foil.co.uk/metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr/

the 'helper' classes used by the main grammar to process some of the
island grammars,

  http://svn.badgers-in-foil.co.uk/metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/parser/

the island grammars themselves,

  http://svn.badgers-in-foil.co.uk/metaas/trunk/src/main/antlr/uk/co/badgersinfoil/metaas/impl/parser/
  ('regex' is broken; don't bother with it)


ta,
dave

-- 
http://david.holroyd.me.uk/


More information about the antlr-interest mailing list