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

  • Home
  • SEARCH
  • 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 8526971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:25:25+00:00 2026-06-11T08:25:25+00:00

Always when i generate Parser and Lexer from my Grammarfile, everything works fine instead

  • 0

Always when i generate Parser and Lexer from my Grammarfile, everything works fine instead of the problem, that ANTLR automaticly adds the whole User directory to any returns and comments. That is not good. E.g.:

return "C:\\Users\\##\\workspace\\project\\src\\Grammar.g"

also this tool does the same with any comments:

// $ANTLR 3.4 C:\\Users\\##\\workspace\\project\\src\\Grammar.g 2012-06-18 18:25:20

i have to publish my project so is there any way to disable this “function” ?

Regards,
redstreak.

  • 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-06-11T08:25:26+00:00Added an answer on June 11, 2026 at 8:25 am

    Paths seem to depend from where and how you invoke ANTLR. I was not able to achieve this with ANTLRWorks, but using command line ANTLR you are able to perform this. You can do the following (example is for Windows but should be reproducible on other OSes, too):

    1. Download Antlr for command line and copy it to e.g.

      C:\Program Files (x86)\ANTLRworks\antlr-3.4-complete.jar.

    2. Open a Windows command line (cmd.exe) and change to the directory where your grammar file is located:

      cd C:\Users[path to the eclipse project]\src\some\package\name

    3. Invoke

      java -jar "C:\Program Files (x86)\ANTLRworks\antlr-3.4-complete.jar" MyGrammar.g
      

      from commandline.

    The generated java files will only contain the name of your grammar file and no path anymore.

    This answer is from my own question Remove (absolute) paths in ANTLR generated java classes: which at the end I answered myself.

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

Sidebar

Related Questions

For example, I always generate an auto-increment field for the users table, but I
I'm able to generate a hierarchy with a recursive CTE but I have always
I am trying to generate struts 2 modular archetype using maven but always getting
I realize that the csv library in Python always generates DOS end-of-line characters. Even
I always read that one reason to chose a RESTful architecture is (among others)
I always thought that you could use OR in a LIKE statment to query
You always read that for-in loops should check o.hasOwnProperty(k) to skip over Object.prototype. Well,
The following code seems to always generate wrong result. I have tested it on
I'm building a custom parser that should read a delimited list of data, and
The only thing that's guaranteed to always be there is the messagesByDate obj. The

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.