[il-antlr-interest: 28998] [antlr-interest] Inexplicable RewriteEmptyStreamException in parser grammar

2010-05-25 Thread Richard Thrippleton
I'm using the Java target with ANTLR 3.2, and having a problem in a rule in my parser grammar that looks like this: "variableInit [ String name ] : ASSIGNMENT id=initializer -> ^(ASSIGNMENT IDENTIFIER[$ASSIGNMENT, $name] initializer)" In a particular case where the 'initializer' rule fails

[il-antlr-interest: 28997] Re: [antlr-interest] What's wrong with org.antlr.Tool.main(String[] args)?

2010-05-25 Thread John B. Brodie
On Tue, 2010-05-25 at 21:12 +0200, Sameh W. Zaky wrote: > Hi all, > > Using ANTLR v3.2, in the runtime I generate the lexer and parser Java files > using this code: > org.antlr.Tool.main(new String[]{projectPath+"GrammarFile.g"}); > > The problem is that, after this line of code, no other code ge

[il-antlr-interest: 28996] [antlr-interest] What's wrong with org.antlr.Tool.main(String[] args)?

2010-05-25 Thread Sameh W. Zaky
Hi all, Using ANTLR v3.2, in the runtime I generate the lexer and parser Java files using this code: org.antlr.Tool.main(new String[]{projectPath+"GrammarFile.g"}); The problem is that, after this line of code, no other code gets executed, for example, in this piece of code: System.out.println("B

[il-antlr-interest: 28995] [antlr-interest] Countinous parsing of inputstream (i.e. from Serial port)

2010-05-25 Thread Arne Ploese
Hi, I want to parse a stream from a serial port. There are packages like "T12346679FF22\r\n" which com in all 2 minutes. I want to lex/parse them at the moment they arrive. Using ANTLRInputStream input = new ANTLR

[il-antlr-interest: 28994] Re: [antlr-interest] Dynamic scope for lexer rule

2010-05-25 Thread Junkman
Thanks for the reply, Jim. I understand the rationale for your suggestion. Might this info be worth adding to the wiki? It may be obvious to seasoned hands, but difference in constraints between lexer and parser rules would be helpful especially since both rule types share the same basic syntax

[il-antlr-interest: 28993] Re: [antlr-interest] ClassCastException in TreeParser grammar

2010-05-25 Thread John B. Brodie
Hello :- This grammar still has the same compilation problem as the one that you posted yesterday. did you change anything? I fixed the STRING_LITERAL rule as you suggested in a private e-mail to me (please keep all messages on this list). I then did not get any ClassCastException. But got r