0
votes

I have ANTLRWorks 1.5.2. I need to resolve Decision can match input using multiple alternative warnings in my one grammar file which imports another file.

parser grammar PL;

import SQL;

I need to bring both of the files in antlr works. But Antlr Works throws undefined import error. How can I have both the files in ANTLR Works at the same time? The error has been generated by adding a rule in PL and it conflicts with the rule in SQL. These are very large grammar files and visualization can help to solve the problem.

1
warning(200): SQL.g:2452:45: Decision can match input such as "ESCAPE" using multiple alternatives: 1, 2 As a result, alternative(s) 2 were disabled for that input warning(200): SQL.g:2897:81: Decision can match input such as "OVER LPAREN RPAREN" using multiple alternatives: 1, 2 As a result, alternative(s) 2 were disabled for that input Semantic predicates were present but were hidden by actions. These are the erros I am getting. - user82504

1 Answers

0
votes

ANTLRWorks actually imports the import grammar at runtime if import grammar is placed in the same folder. If grammar is placed at C:\test and import grammar is also placed at C:\test then ANTLRWorks reads the file from. When I generated the code it throws warnings in the imported grammar.