I want to construct some tests depending on the tokens used in a specific rule of my grammar.
void myrule() : {} {
<K_MYKEYWORD1>
| <K_MYKEYWORD2>
}
So I have a jjt file and need to transform this in a jj file and then parse this and get the AST - node tree, to traverse it.
My first attempt was this:
var parser = new JJTreeParser(
Files.newInputStream(Paths.get("src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt"))
) {
public ASTGrammar getRoot() {
return (ASTGrammar)jjtree.rootNode());
}
};
parser.javacc_input();
new JavaCodeGenerator().visit(parser.getRoot(), io);
But I have to fight method and class visibility issues:
IO is only package private, ASTGrammer.generate is package private as well.
I want to construct some tests depending on the tokens used in a specific rule of my grammar.
So I have a jjt file and need to transform this in a jj file and then parse this and get the AST - node tree, to traverse it.
My first attempt was this:
But I have to fight method and class visibility issues:
IO is only package private, ASTGrammer.generate is package private as well.