Mono and Generics
Installed the mono beta without a hitch. Had no idea where it ended up in (thank god for OSX HD indexing and searching). Eventually found it in /opt/local/bin (didn't even know that directory existed). Tried to compile some of my code and got:
cyrusn@Foo ~> /opt/local/bin/mcs foo.cs
syntax error, got token `OP_LT', expecting OPEN_BRACE COLON
foo.cs(1) error CS1041: Identifier expected
Mono.CSharp.yyParser.yyException: irrecoverable syntax error
in <0x00b00> Mono.CSharp.CSharpParser:yyparse (Mono.CSharp.yyParser.yyInput)
in <0x000b4> Mono.CSharp.CSharpParser:parse ()
foo.cs(1) error CS8025: Parsing error
Compilation failed: 2 error(s), 0 warnings
This amused me greatly. Mostly because I wrote a LALR parser generator in C# and used it to parse C# and this kind of error message was nearly identical to the unfriendly error messages I would present. Luckily mcs is intended to be used by programmers who can most likely infer that OP_LT corresponds to < corresponds to some error in your code. However, i do think it would be good for the parser to output the line/column where the error occured to make tracking down the offending code easier.
It would also be great if the mono teamed looked into some of the excellent work done in automatic LALR parser recovery to make the parser better able to recover after these issues. Of course, these are "nice to haves" and not in any way requirements.
Comments
- Anonymous
May 15, 2004
The comment has been removed - Anonymous
May 16, 2004
To compile generics code, don't you use gmcs instead of mcs? - Anonymous
May 16, 2004
Yes. And I realized that later. You can see the error i got using gmcs in http://blogs.msdn.com/cyrusn/archive/2004/05/15/132704.aspx - Anonymous
September 01, 2005
Your blog is very interesint - Anonymous
February 21, 2006
Columbia hotels - Anonymous
March 17, 2008
PingBack from http://blogrssblog.info/cyrus-blather-mono-and-generics/