antlr / intellij-plugin-v4

An IntelliJ plugin for ANTLR v4
https://plugins.jetbrains.com/plugin/7358-antlr-v4
BSD 3-Clause "New" or "Revised" License
461 stars 103 forks source link

Issues with parser and/or lexer grammar(s) prevent preview #687

Closed mburbidg closed 5 months ago

mburbidg commented 7 months ago

My grammar is split into separate parser and lexer files(grammars). I can paste these into the ANTLR Lab and parse strings in the grammar. I can also generate Go code from these grammar files and parse strings using the resulting code.

But when I use the IntelliJ plug-in, I get the following message in the Parse-tree pane:

Issues with parser and/or lexer grammar(s) prevent preview; see ANTLR Tool Output pane.

There is nothing in the ANTLR Tool Output pane.

The grammar files are in the following repository: https://github.com/mburbidg/gqlgrammar

bjansen commented 5 months ago

OK I guess a more explicit error should appear somewhere, in this particular case it's because you used grammar GQLParser; instead of parser grammar GQLParser;.

mburbidg commented 5 months ago

Oh wow. How simple. Thank you for looking at this!