[antlr-interest] Grammar mismatch

Steve McFarlin smcfarlin at ocsnet.net
Thu Nov 26 09:24:57 PST 2009


Hello,

1) (For me) This occurs if I generate and debug the parser grammar,  
and then generate the tree grammar. What I usually do is clean the  
entire output directory, generate the parser grammar code, and then  
generate the tree grammar code. Debugging the tree grammar should be  
fine now.

2) You should be able to change the port in the properties for  
ANTLRWoks. The generated __Test__ file should reflect these changes.  
Beyond this I would not know what is occurring.

3) This sounds like an issue between debug and release code.


Generally, I always clean the output directory between release and  
debug sessions. Hope this helps. I am sure someone will soon give you  
a precise answer(s).


steve

On Nov 26, 2009, at 9:10 AM, Konstantinos Kakousis wrote:

> Hello,
>
> First of all let me thank you for providing such a great tool.
> Now to the reason I’m posting here: After reading “The Definite ANTLR
> Reference” I have managed to create my DSL grammar.
> I use anltrworks 1.3.1 and everything works fine as long as no ASTs  
> are
> involved.
> Just to be sure that there is nothing wrong with my grammar, the same
> problem occurs with the simple example of: Expr.g and Eval.g,
> found in the book.( I just copy-pasted the code from the web).
>
> After compiling successfully both, grammar and tree grammar when I
> attempt to run or debug the tree grammar (parser grammar run and  
> debugs ok)
> I get:
> 1) Grammar Mismatch popup: Warning the grammar used by the remote  
> parser
> is not the same (Expr.g)
> 2) In output tabt :
>
> (+ 4 5) java.net.SocketException: Unrecognized Windows Sockets  
> error: 0:
> JVM_Bind java.net.SocketException: Unrecognized Windows Sockets error:
> 0: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method)
> at java.net.PlainSocketImpl.bind(Unknown Source)
> at java.net.ServerSocket.bind(Unknown Source)
> at java.net.ServerSocket.<init>(Unknown Source)
> at java.net.ServerSocket.<init>(Unknown Source)
> at
> org 
> .antlr 
> .runtime 
> .debug.DebugEventSocketProxy.handshake(DebugEventSocketProxy.java:75)
> at Eval.<init>(Eval.java:49)
> at Eval.<init>(Eval.java:41)
> at __Test__.main(__Test__.java:19)
> Exception in thread "main" java.lang.NullPointerException
> at
> org 
> .antlr 
> .runtime 
> .debug.DebugEventSocketProxy.transmit(DebugEventSocketProxy.java:116)
> at
> org 
> .antlr 
> .runtime 
> .debug.DebugEventSocketProxy.exitRule(DebugEventSocketProxy.java:130)
> at Eval.prog(Eval.java:149)
> at __Test__.main(__Test__.java:21)
>
> 3) Consol reports a huge amount of exceptions starting with:
> [18:56:42] java.lang.ClassCastException:
> org.antlr.runtime.debug.RemoteDebugEventSocketListener$ProxyToken  
> cannot
> be cast to org.antlr.works.debugger.tree.DBTreeToken
> at
> org 
> .antlr 
> .works 
> .debugger 
> .input.DBInputProcessorTree.getNode(DBInputProcessorTree.java:199)
> at
> org 
> .antlr 
> .works 
> .debugger 
> .input.DBInputProcessorTree.processToken(DBInputProcessorTree.java:14
> .....
>
> I have managed to avoid this behavior a couple of times by restarting
> antlrworks, rebooting etc. but now it insists not to work even for the
> simplest grammar.
> I also tried unsuccessfully to change debugger port, I googled the
> problem but I didn’t find anything similar, obviously I’m missing
> something out here.
> Any ideas? Is it something really simple or is it the first time that
> this is reported.
>
> Thanks for your time!
> BR,
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list