I'm having trouble setting up ANTLR v4 for C#, anyone keen to help me? I'm using the build target referred from the official site here https://github.com/sharwell/antlr4cs
I added a simple grammar Foo.g
grammar Foo;
r : 'hello' ID ; // match keyword hello followed by an identifier
ID : [a-z]+ ; // match lower-case identifiers
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
...and set the build action for it to Antlr4
Now I'm stuck with the following errors.
'´' came as a complete surprise to me
mismatched input 'grammar' expecting SEMI
I don't have enough points to make a comment yet, so this is just a link, but apparently one possible cause of this error message is saving the document in UTF-8 encoding with a BOM. Apparently this is an issue with the JAVA file input stream.
Notepad++ will let you save without the BOM.
Source: https://github.com/sharwell/antlr4cs/issues/12
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With