Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generated code for PlSqlParser.g4 #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peteromoon
Copy link

When building the PlSql grammar from https://github.com/antlr/grammars-v4/blob/master/sql/plsql/PlSqlParser.g4 and https://github.com/antlr/grammars-v4/blob/master/sql/plsql/PlSqlLexer.g4, the generated Rust code fails to compile with the following error.

error[E0405]: cannot find trait `PlSqlParserParserContext` in this scope
      --> tests/gen/plsqlparser.rs:112704:14
       |
4550   | / pub trait PlSqlParserContext<'input>:
4551   | |     for<'x> Listenable<dyn PlSqlParserListener<'input> + 'x > + 
4552   | |     ParserRuleContext<'input, TF=LocalTokenFactory<'input>, Ctx=PlSqlParserContextType>
4553   | | {}
       | |__- similarly named trait `PlSqlParserContext` defined here
...
112704 |   impl<'input> PlSqlParserParserContext<'input> for Table_ref_aux_internalContextAll<'input>{}
       |                ^^^^^^^^^^^^^^^^^^^^^^^^ help: a trait with a similar name exists: `PlSqlParserContext`

The PlSqlParser.g4 and PlSqlLexer.g4 files need to modified to remove references to self. You can find the modified version at:
https://github.com/peteromoon/antlr4rust/blob/plsqltest/grammars/PlSqlLexer.g4 and https://github.com/peteromoon/antlr4rust/blob/plsqltest/grammars/PlSqlParser.g4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant