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

Moving from Antlr 3.1.1 to 3.5.0.2 #106

Open
jannavarro opened this issue May 29, 2018 · 7 comments
Open

Moving from Antlr 3.1.1 to 3.5.0.2 #106

jannavarro opened this issue May 29, 2018 · 7 comments

Comments

@jannavarro
Copy link

I currently have antlr 3.1.1 in my code. I am planning to move to 3.5.0.2 so I installed it from Nuget. Upon installing I encountered errors in the generated Lexer and Parser.cs. I have looked at release notes, articles, etc but couldn't find the right way of fixing these errors. I would like to seek guidance:

1.) The type or namespace name 'Collections' does not exist in the namespace 'Antlr.Runtime'.
I get this error in "using Antlr.Runtime.Collections.StackList;"

2.) What parameter should I put in ParserRuleReturnScope? What are the changes why a parameter was added here?

3.) Tree property does not exist in ParserRuleReturnScope anymore.

4.) Lexer - DEFAULT_TOKEN_CHANNEL, HIDDEN does not exist.

5.) this.dfa19.specialStateTransitionHandler - CS1061 'ExpressionLexer.DFA19' does not contain a definition for 'specialStateTransitionHandler' and no extension method 'specialStateTransitionHandler' accepting a first argument of type 'ExpressionLexer.DFA19' could be found (are you missing a using directive or an assembly reference?)

There are a lot more errors but I would like to focus first on this.

@sharwell
Copy link
Member

It sounds like you didn't regenerate your code when you upgraded. Can you make sure you are using the Antlr3 NuGet package?

@jannavarro
Copy link
Author

Hi @sharwell thanks for the prompt response. Yes, I am using that Nuget package. Do I need to regenerate my code using Antlrworks?

@sharwell
Copy link
Member

@jannavarro No, the code is generated automatically when you build your solution. Here are the steps to ensure the build is working:

For each grammar T in your solution:

  1. Right click the file T.g3 in Solution Explorer and select Properties.
  2. In the Properties pane, set the Build Action to Antlr3.
  3. In the Properties pane, set the Custom Tool to MSBuild:Compile.

@jannavarro
Copy link
Author

Oh. I see. I think I read earlier that I need to install an extension but VS 2017 is not supported. Or is that different?

Thanks for the steps. Will try it.

@sharwell
Copy link
Member

The extension is optional. I uploaded a new version that supports VS 2017 last week. 😄

@jannavarro
Copy link
Author

@sharwell Trying it now. Will update this issue on the status and possibly close it if it is resolved. Thanks for your answers.

@bojake
Copy link

bojake commented Oct 20, 2021

I have a similar issue. The nuget 3.1.x version works fine with our grammar, but the latest 3.5.x version complains about the same errors listed in the OP's report.

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

No branches or pull requests

3 participants