Custom Language Development - GeneratedParserUtilBase?
I'm following the tutorial here: http://confluence.jetbrains.com/display/IntelliJIDEA/Grammar+and+Parser
However, when I copy the GeneratedParserUtilBase class, it won't compile. There are several methods that are not found:
builder_.rawTokenIndex();
last.getStartIndex()
latestDoneMarker.getEndIndex()
I'm using IDEA Ultimate 12.
Is this class necessary anymore? I'm able to generate the parser without it.
CORRECTION: I can generate the parser, but it contains a referece to this class. So, I guess I need to know how to get GeneratedParserUtilBase to compile.
Please sign in to leave a comment.
I think I've solved the problem.....
The SimpleParser generated had the following import statement:
import static com.simpleplugin.parser.GeneratedParserUtilBase.*;
I found the following on page https://github.com/JetBrains/Grammar-Kit:
So I changed the generated import statment in SimpleParser to:
import static com.intellij.lang.parser.GeneratedParserUtilBase.*;
And everything compiles.
Is there anyway to force Grammar-Kit to generate the correct import statement?
Doh! I figured it out again......
The example bnf file contained:
Change it to:
And the parser generates successfully and compiles cleanly.