Help to find function description

0 views
Skip to first unread message

kost...@gmail.com

unread,
Feb 13, 2008, 6:20:46 AM2/13/08
to PlacidSystems.AntlrStudio
First sorry for my English. It is not my native language.
Second I do not know grammars and have not any experience in antlr.

I have some grammar which was written using Antlr Studio plug-in for
Eclipse. I need to generate Java source code from this grammar and
compile using only pure antlr (using ant build file). But there are
many places where some Antlr Studio specific function
getLengthConsumed() is called. For examle:

//Add the error management corresponding to null ID when we work with
several models....
parse_model returns [IModel model]
{
model = new ModelImpl();
String modelID=null;
}
: "model"^ modelID =model_identifier LC model_body[model] RC SEMI
{
model.setModelID(modelID);
}
;
exception catch[RecognitionException ex]
{
int startingPos = this.getLengthConsumed();
this.consume();
int finalPos = this.getLengthConsumed();
this.rewind( startingPos);


So I need to replace (implement) this function. But I have no clue
what it do. Could any one help me with docs/explanation what i do?

Prashant Deva

unread,
Feb 14, 2008, 7:38:58 PM2/14/08
to antlr...@googlegroups.com
Hi,
 To disable ANTLR Studio from inputting any of its own code into the grammar files, disable debugging of grammars.

To disable debugging –
  • Right-click on your java project, go to Properties and click on the ANTLR Studio node.
  • Uncheck 'Enable debugging in grammar files'.
  • When you press Ok, a dialog box will pop up asking you whether to rebuild the project Answer 'Yes' to it. This will rebuild the grammar files too, thus generating release quality code for your grammar files.
Prashant
Reply all
Reply to author
Forward
0 new messages