grammars-v4 icon indicating copy to clipboard operation
grammars-v4 copied to clipboard

Problem with CSharpLexerBase

Open ferasfares opened this issue 3 years ago • 2 comments

Describe the bug
Generate CSharpLexer.py using antlr4 version 4.10.1 try to import the file File "CSharpLexer.py", line 12, in from .CSharpLexerBase import CSharpLexerBase ModuleNotFoundError: No module named 'grammar.CSharp.CSharpLexerBase'

in the repository I can't find class CSharpLexerBase.py or CSharpLexerBase.g4 to generate class

thanks

ferasfares avatar May 06 '22 13:05 ferasfares

Another problem in generated code I have some thing like that in CSharpLexer.py

def INTERPOLATED_VERBATIUM_STRING_START_action(self, localctx:RuleContext , actionIndex:int):
        if actionIndex == 1:
             this.OnInterpolatedVerbatiumStringStart(); 

ferasfares avatar May 06 '22 13:05 ferasfares

Right. There's no grammars-v4/csharp/Python3/ directory. In other words, there's no Python3 implementation for the grammar. There's a bit of controversy over "target agnostic format", which is why I hadn't implemented the Python3 base target classes.

kaby76 avatar May 07 '22 10:05 kaby76

So is there a solution?

I once (3-4 years ago) got an earlier version of the CSharp grammar working in Python 3 but now I need the latest grammar which hopefully supports generics syntax etc.

abulka avatar May 11 '23 12:05 abulka