[antlr-interest] antlr with actionscript 3

George Scott george.scott at gmail.com
Wed Oct 1 20:43:03 PDT 2008


Matteo,
TLexer and TParser are not included in the runtime library.  Those are just
example class names that would be generated by antlr if you were to run a
grammar named "T" through the antlr compiler.  You shouldn't be using the
Lexer and Parser classes directly as they won't provide you any useful
behavior.  Instead you need to define your grammar in a separate ANTLR file,
and compile it using the antlr compiler tool that is included in the
distribution (note this is a Java program).  The antlr tool will then
generate classes (ActionScript source code) specific to your grammar that
extend the Lexer and Parser classes.

In your example, it appears you are trying to parse ActionScript/ECMAScript
4 source code.  The grammar for that language is quite complex and would be
a significant undertaking if you are completely new to ANTLR.  I would
recommend picking a simpler example to get familiar with how to use ANTLR in
ActionScript using the existing examples first.  Once you understand the
basics you should be able to pick the JavaScript sample grammar available on
the ANTLR website at (http://antlr.org/grammar/1206736738015/JavaScript.g)
as a starting point or ask around to see if anyone has an ActionScript
grammar.  I've seen various posts in the past of people working on a
complete grammar.

George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081001/a08e29ae/attachment.html 


More information about the antlr-interest mailing list