question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error "grammar ANTLRv4LexBasic has no non-fragment rules"

See original GitHub issue

With antlr-4.9.2-complete.jar I now get a an error when generating parser + lexer files for the ANTLRv4 grammar. The base lexer grammar only contains fragment lexer rules, which never had been a problem so far. Now it is and I wish the previous behavior back. What is the rational behind this error, which makes organizing grammar into separate parts difficult?

Also it would make sense to use the ANTLRv4 grammar in tests to see if that gives problems (instead of only using very simple grammars).

The error definition itself exists for a long time in ErrorType.java, so I assume something with the condition <if(arg2.implicitLexerOwner)> must have changed recently, so that we suddenly see this error.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
KvanTTTcommented, Jun 28, 2021

I created the pull request which should help. @parrt please merge ASAP.

1reaction
KvanTTTcommented, Apr 8, 2021

Ok, actually the previous behavior can be rolled back because this commit fixes code generation even if no one real token is presented.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error "grammar ANTLRv4LexBasic has no non-fragment rules" -
With antlr-4.9.2-complete.jar I now get a an error when generating parser + lexer files for the ANTLRv4 grammar. The base lexer grammar only ......
Read more >
ANTLR error(99) grammar has no rules - Stack Overflow
I think Antlr expects the first rule name to be in small case. I was getting the same error with my grammar grammar...
Read more >
Antlr Error99 Grammar Has No Rules - ADocLib
antlr4 Error grammar ANTLRv4LexBasic has no nonfragment rules Java.With antlr4.9.2complete.jar I now get a an error when generating parser + lexer.
Read more >
Grammar Rules and Errors - Learning Guides - LibGuides
Error #1: Run-on Sentence or Comma Splice · Separate the clauses into two sentences. · Replace the comma with a semi-colon. · Replace...
Read more >
Sentence Errors: Comma Splices, Run-ons, and Frag
Example: Tevon won the award because he had the highest score. Rules for Run-ons. A run-on or fused sentence is two independent clauses...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found