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 6642633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:57:14+00:00 2026-05-25T23:57:14+00:00

I am getting error of Test class not found error, even when I have

  • 0

I am getting error of Test class not found error, even when I have made it via command

java org.antlr.Tool something.g

when debugging via ANTLRworks. I have been searching this on the web, but no success with it. Do you know, how to solve my problem?

Thanks

Edit – grammar:

grammar Expr;

prog    :   stat+ ;

stat    :   expr NEWLINE
    |   ID '=' expr NEWLINE
    |   NEWLINE
    ;

    expr    : multExpr (('+' |'-' ) multExpr)*;

    multExpr: atom ('*' atom)*
        ;

    atom    : INT
        | ID
        | '(' expr ')'
        ;

    ID : ('a'..'z' |'A'..'Z' )+ ;
    INT : '0'..'9' + ;
    NEWLINE:'\r' ? '\n' ;
    WS : (' ' |'\t' |'\n' |'\r' )+ {skip();} ;

Error message:

When debugging with imput text 3*4 makes output – “Error: Could not find or load main class Test” While, Test is generated in subfolder /output…

  • 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-25T23:57:15+00:00Added an answer on May 25, 2026 at 11:57 pm

    Since you commented in the comments that running a test class from the console also failed, here’s one that works:

    import org.antlr.runtime.*;
    
    public class Main {
      public static void main(String[] args) throws Exception {
        ExprLexer lex = new ExprLexer(new ANTLRStringStream("1 + 2 - 3 * 4 - E\n"));
        CommonTokenStream tokens = new CommonTokenStream(lex);
        ExprParser parser = new ExprParser(tokens);
        parser.prog();
      }
    }
    

    Now put your ANTLR JAR (v3.3 in my example) in the same directory as Main.java and Expr.g and run the main class from your console like this:

    java -cp antlr-3.3.jar org.antlr.Tool Expr.g
    javac -cp antlr-3.3.jar *.java
    java -cp .;antlr-3.3.jar Main
    

    The fact that nothing is printed to your console means that the parsing went without any problems.

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

Sidebar

Related Questions

Hi I'm getting a symbol not found error, when running mvn -e integration-test .
My unit test keeps getting the following error: System.InvalidOperationException: The Connection is not open.
I am running the following code in eclipse but getting a class not found
We have just found we are getting framing errors (as reported by the WCF
hiii i am getting this error while running test for my fluent nhibernate application.
I'm getting an error on my partial method and I'm not sure why. I
getting error while try to start service
I am getting error trying to run my asp code for executing stored proc.
I'm getting error: Unrecognised selector sent to instance, upon inspection, I see there is
I wrote following code...but i am getting Error like: Error 1 'LoginDLL.Class1.Login(string, string, string)':

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.