Open searocsun opened 5 years ago
Step 0: download intellij + antlr4 plugin and take look at what is slow in your grammar.
You should be able to see something like this:
You can sort by time and click on row to highlight the corresponding rule.
(Note that there are also other tools which does the same.)
@Nic30 Thank you for your advice
Actually, no, I did not gave you a good advice. You do have an embedded C++ in your code. (Which I did not see at the first time.)
@Nic30 thank you so much.
I tried the PL/SQL grammer with a CSharp target - it is slow here, too. And it reported some ambiguities...
Could you improve the grammar?
Can you tell me how to solve this problem? Thanks
Background: I want to parser pl/sql with c ++target .
Grammar: https://github.com/antlr/grammars-v4/tree/master/plsql
results: ParseTree is too slow, about 3 ~4 seconds
int main(int , const char *) { std::string str; std::string str_rep = "TO_NUMBER()"; std::string str_where = "WHERE";
} }
Can someone tell me how to fix this problem?
Thanks