antlr / grammars-v4

Grammars written for ANTLR v4; expectation that the grammars are free of actions.
MIT License
10.15k stars 3.7k forks source link

Cannot find tokens file #1351

Closed jannavarro closed 4 years ago

jannavarro commented 5 years ago

I am following this ANTLR4 tutorial for C# and in step 4 I run the ANTLR java file in the C# grammar file I downloaded in your Github (grammars-v4/csharp/). java -jar antlr4-4.7.2.jar -Dlanguage=CSharp CSharpParser.g4

The result is an error looking for tokens file: error(114): CSharpParser.g4:7:21: cannot find tokens file .\CSharpLexer.tokens

I am quite new to Antlr. Is this token file something I can get somewhere else?

KvanTTT commented 4 years ago

Firstly you should generate tokens file by command java -jar antlr4-4.7.2.jar -Dlanguage=CSharp CSharpLexer.g4

shyandsy commented 7 months ago

i still get the error with "java.nio.file.NoSuchFileException: tokens" anyone knows why? image