Bugs item #1885856, was opened at 2008-02-03 11:33
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=616200&aid=1885856&group_id=96864
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Closed
Resolution: Later
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: code generation error
Initial Comment:
consider the following example
/*!re2c
[0-9a-zA-Z+.\-]* ":" { schema given; }
[0-9a-zA-Z+.\-]* [^:\000?;#] [^\000?;#]* { netloc; }
[0-9a-zA-Z+.\-]* { path given; }
*/
The algorithm takes an URL.
http://www.sf.net/
The generated code chooses the case 2)
although it should select the case 1)
The generated code doesnt have such an error in case the regexp admitting
schema symbols is omitted.
/*!re2c
":" { schema given; }
[^:\000?;#] [^\000?;#]* { netloc; }
[\000?;#]* { ; }
*/
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2008-02-04 10:58
Message:
Logged In: NO
Nope, this behaves correctly given the regex set above...
You've got an ambiguity in your expressions. The issue is that rule 2
will match the entire url string ([htt] [p] [://www.sf.net/]), and re2c is
designed to be greedy with respect to the length of the string it's
matching.
Re-form your regular expressions to be more explicit and remember that
longer string lengths are preferred.
----------------------------------------------------------------------
Comment By: Marcus Börger (helly)
Date: 2008-02-03 13:37
Message:
Logged In: YES
user_id=271023
Originator: NO
Actually you have no else case here. As the documentation explains, re2c
will not generate and else or default state for you. Instead you have to do
so yourself. However re2c does not really allow this kind of constructs.
That is a beginning snippet that basically gets skipped and is a common
prefix to a bunch of states. Maybe re2c could get a detection for this kind
of stuff.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=616200&aid=1885856&group_id=96864
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Re2c-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/re2c-general