question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CSharp] CI build of Antlr CSharp runtime gives warnings

See original GitHub issue

I don’t recall seeing this before, but under the “Files changed” tab for a PR, we now see warnings for legitimate build issues of the C# code.

Check warning on line 25 in runtime/CSharp/src/Tree/Xpath/XPathLexer.cs

GitHub Actions
/ build (csharp)
runtime/CSharp/src/Tree/Xpath/XPathLexer.cs#L25
The using directive for 'System' appeared previously in this namespace

See https://github.com/antlr/antlr4/pull/3547/files

It’s caused because the grammar file XPathLexer.g4 includes an @header { using System;}. The @header is not needed. But, Char.IsUpper() should be fully qualified in order to eliminate the assumption that System is included. Honestly, the grammar shouldn’t have target-specific actions in the code, and should be in “target-agnostic format”. But, that’s another story.

But, it gets better…

The XPathLexer.cs is generated by the Antlr4 tool. It says that it was generated using 4.9.3, but it was not! I don’t know what tool was used, but it’s not the official 4.9.3 Antlr tool! The tables produced are different.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
KvanTTTcommented, Feb 22, 2022

Also, it is not covered by tests except for Java.

1reaction
KvanTTTcommented, Feb 22, 2022

I support the idea of dropping XPath from ANTLR core at all since it’s outdated and is not supported by some runtimes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Antlr4: Using a Testrig with C# generated code - Stack Overflow
The way I do it is to: 1. use the NuGet to avoid calling the ANTLR tool yourself, the package integrates seamlessy with...
Read more >
C# Compiler Options - errors and warnings - Microsoft Learn
C# Compiler Options for errors and warnings. These options suppress or enable warnings, and control warnings as errors.
Read more >
ANTLR 3 - Confluence
Use ANTLR from Visual Studio. Create a new Visual Studio project; Add these project references from the folder C:\ANTLR\antlr-3.1.3\runtime\CSharp ...
Read more >
Old Release Notes | PMD Source Code Analyzer
This release of PMD brings support for Java 19. ... You'll also get a deprecation warning. ... It ignores C# attributes when detecting...
Read more >
MongoDB Engineering Blog
Persistent Memory Development Kit (PMDK) provides APIs for that. ... Javascript, and Python) and output (Java, C#, Python, MongoDB Shell, and Javascript) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found