Bug 319840 (MONO77032) - [GMCS] gmcs tokenizer problem.
Summary: [GMCS] gmcs tokenizer problem.
Status: RESOLVED FIXED
Alias: MONO77032
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Linux
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-19 04:50 UTC by Danny Dulai / Bloomberg
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:41:43 UTC


---- Reported by ddulai@bloomberg.net 2005-12-18 21:50:23 MST ----

if (stored_offset >= 0 && stored_len+4 < opt_len >> 3)

giving me:

syntax error, got token `OP_GENERICS_LT'
foo.cs(795,55): error CS1002: Expecting `;'
foo.cs(799,4): error CS8025: Parsing error

changing to this fixes:

if (stored_offset >= 0 && (stored_len+4) < (opt_len >> 3)) 

this works on msft's csc from the 2.0 framework

altho i do agree that the first statement is evil and should have parens, 
consistancy is desired.

% gmcs --version
Mono C# compiler version 1.1.11.0



---- Additional Comments From rharinath@novell.com 2005-12-19 07:05:13 MST ----

This is somewhat hard to do with the current codebase.  We eventually
need a backtracking parser to implement the generics grammar.




---- Additional Comments From miguel@ximian.com 2005-12-19 16:02:20 MST ----

Using a better parser would be nice, but we can not afford to redo the
parser at this point.  Errors like this will be fairly common.

The good news is that this should be relatively easy to fix, the
tokenizer has a routine that tries to determine if what follows a "<"
is a generic expression or not.  

This routine basically is basically a micro-parser only for
expressions and it only has to determine if something is a generic
expression or not.

Notice that this micro-parsing would also be needed for a new compiler
as the grammar is ambiguous.  It was explicitly spelled out that this
would require a custom tokenizer in the ecma meetings.

So all we have to do is to improve our micro-parser in "parse_less_than".

Maybe Martin should look into this though



---- Additional Comments From miguel@ximian.com 2005-12-30 15:39:16 MST ----

This is a duplicate.

*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO59289 ***



---- Additional Comments From miguel@ximian.com 2006-01-04 12:30:19 MST ----

This bug has been fixed on SVN.