Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7623299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:40:18+00:00 2026-05-31T04:40:18+00:00

I am using ANTLR 3.1.3 to generate the parser. After importing the generated testParser,

  • 0

I am using ANTLR 3.1.3 to generate the parser. After importing the generated testParser, I found there is several errors like

try { dbg.enterDecision(2, decisionCanBacktrack[2]);

Description Resource Path Location Type
The method enterDecision(int) in the type DebugEventListener is not applicable for the arguments (int, boolean) testParser.java /ANTLRTest/src line 280 Java Problem

If I changed to dbg.enterDecision(2), then everything is fine.

The grammar is as follows,

grammar Test;  

options {output=AST;}

expr : mexpr (PLUS^ mexpr)* SEMI! ; 

mexpr : atom (STAR^ atom)* ;  
atom: INT ;  
//class csharpTestLexer extends Lexer;  
WS : (' ' | '\t' | '\n' | '\r') { $channel = HIDDEN; } ;  
LPAREN: '(' ;  
RPAREN: ')' ;  
STAR: '*' ;  
PLUS: '+' ;  
SEMI: ';' ; 

DIGIT : '0'..'9' ;  
INT : (DIGIT)+ ;  

I am using ANTLRWorks 1.4.3 to generate lexer and parser.

JDK 1.6

Any reason to this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:40:19+00:00Added an answer on May 31, 2026 at 4:40 am

    It looks like you’ve generated a lexer and parser with an ANTLR version that is different than the one you added to Eclipse’s classpath.

    If you generate a lexer and/or parser with ANTLRWorks 1.4.3 (which contains ANTLR 3.4), you should also add ANTLR 3.4 to your project’s build path in Eclipse and remove ANTLR 3.1.3 from it.

    BTW, I get error for 2 + 2 * 3, do you know why? anything wrong with the above grammar.

    That is because single digit numbers are being tokenized as DIGIT tokens. Either make DIGIT a fragment:

    fragment DIGIT : '0'..'9' ;  
    INT : (DIGIT)+ ;  
    

    or remove it:

    INT : '0'..'9'+ ;  
    

    See: What does "fragment" mean in ANTLR?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

By default, a parser generated using ANTLR-3 extends from org.antlr.runtime.Parser. How do I have
I want to parser a simple matlab-like for-loop, using ANTLR. The loop is like
I'm using ANTLR generated c parser in my C++ program and I wish to
I am using antlr to generate my parser, but I want to override some
I am using ANTLR to generate Java source files. I can make Eclipse understand
I am using ANTLR to create an and/or parser+evaluator. Expressions will have the format
I have lexer/parser (Generated from an ANTLR grammar file) which (for performance reasons) I
I was trying hard to make ANTLR 3.2 generate parser/lexer in C++. It was
Using ANTLR v3 and the CSharp2 language specifier, is there any way to indicate
I'm trying to use ANTLR to create a parser for simple language using C#

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.