Tips for using ANTLR v3 generated files in Flash Builder 4.5.1

Following these instructions , I am trying to use the ANTLR * .as files created in the current Flash Builder 4.5.1 project.

So I added this ANTLR Actionscript to my project - no problem.

I compiled the lexer / parser specifications using ANTLRWorks without any problems.

I added a language parameter to the * .g source file so that ANTLR generates ActionScript sources:

options { backtrack = true; memoize = true; k=2; output = AST; language=ActionScript; // Added this ASTLabelType = CommonTree; } 

Unfortunately, the ANTLR / ANTLRworks generated ActionScript code does not work:

To pop up statements read as follows catch (RecognitionException re) , but should look like this: catch ( re:RecognitionException ) .

In addition, Flash Builder complains about using an array here:

 public override function get tokenNames():Array { return PhpParser.tokenNames; } 

Can someone confirm these problems and possibly give hints how to solve them?

UPDATE-1

A quick look at ANTLR v3.3 sources showed this template code [line 142 @ ActionScript.stg]:

 catch ( re:RecognitionException ) 

So the current 3.3 branch seems to know the correct syntax.

Unfortunately, the current ANTLRworks 1.4.2, which includes branch 3.3, fails.

+2
flex antlr antlrworks flash-builder
Jun 22 '11 at 10:45
source share
1 answer

Terence Parr, ANTLR project manager has just confirmed that ANTLRworks needs a new compilation. Thanks for the great support!

+1
Jun 22 2018-11-23T00:
source share



All Articles