Gavin Lambert wrote: > Tracing it through with either the debugger or a unit test should show > where the problem lies. A good thing to try is to write a unit test > that simply pulls all the generated tokens off the lexer and verifies > them; if your lexer isn't producing the tokens you're expecting then > there's little chance the parser will work, and unfortunately the > ANTLR/ANTLRworks environment isn't really set up to test the lexer > properly.
QuizLexer lexer = new QuizLexer(new ANTLRFileStream(input)); CommonTokenStream tokens = new CommonTokenStream(lexer); // prints 0 System.out.println(tokens.size()); So according to this there are no tokens, which would explain the blank debugger Input window. If the ANTLRWorks Interpreter runs the code correctly, why not the Debugger or unit tests? Any ideas on how to fix the Grammar? List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
