Skip to content

antlr4 java.lang.NullPointerException Antlr 4 4.8 #2788

@yonatanLehman

Description

@yonatanLehman

Getting a crash when generating the code form the attached grammar and lexer files
From inteliJ, antlr4 v 4.8 2019.3
(changes .g4 to -g4 and added .txt to file names so that I could send then)

error(20):
RubyParser2-g4.txt
RubyLexer2-g4.txt

C:/Users/yonatanlehman/Documents/apigen/apiextract/src/main/antlr4/com/applitools/ekb\RubyParser2.g4:17:11: internal error: Rule comcompstmts undefined
2020-03-23 18:29:57: antlr4 java.lang.NullPointerException
at org.antlr.v4.automata.ParserATNFactory.elemList(ParserATNFactory.java:474)
at org.antlr.v4.automata.ParserATNFactory.alt(ParserATNFactory.java:455)
at org.antlr.v4.parse.ATNBuilder.alternative(ATNBuilder.java:559)
at org.antlr.v4.parse.ATNBuilder.block(ATNBuilder.java:404)
at org.antlr.v4.parse.ATNBuilder.subrule(ATNBuilder.java:1189)
at org.antlr.v4.parse.ATNBuilder.element(ATNBuilder.java:879)
at org.antlr.v4.parse.ATNBuilder.alternative(ATNBuilder.java:542)
at org.antlr.v4.parse.ATNBuilder.ruleBlock(ATNBuilder.java:293)
at org.antlr.v4.automata.ParserATNFactory._createATN(ParserATNFactory.java:161)
at org.antlr.v4.automata.ParserATNFactory.createATN(ParserATNFactory.java:108)
at org.antlr.v4.Tool.processNonCombinedGrammar(Tool.java:396)
at org.antlr.v4.Tool.process(Tool.java:369)
at org.antlr.v4.Tool.processGrammarsOnCommandLine(Tool.java:328)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.antlr(RunANTLROnGrammarFile.java:155)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.run(RunANTLROnGrammarFile.java:78)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:888)
at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:441)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:163)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:150)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$4(ApplicationImpl.java:441)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:221)
at com.intellij.util.ConcurrencyUtil.lambda$underThreadNameRunnable$3(ConcurrencyUtil.java:209)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions