Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'´' came as a complete surprise to me

Tags:

c#

antlr4

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
like image 585
ains Avatar asked Aug 26 '13 12:08

ains


1 Answers

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

like image 68
Richard Vasquez Avatar answered Oct 14 '22 07:10

Richard Vasquez