[antlr-interest] Illegal escape sequence in C#

Johannes Luber jaluber at gmx.de
Wed Jul 30 13:15:08 PDT 2008


rkevinburton at charter.net schrieb:
> I downloaded 3.1b2 of ANTLR and replaced the references that I had with the references to the runtime->CSharp->net2.0 assemblies. Now I am down to one error:
> 
> 'Antlr.Runtime.ParserRuleReturnScope' does not contain a definition for 'start' and no extension method 'start' accepting a first argument of type 'Antlr.Runtime.ParserRuleReturnScope' could be found (are you missing a using directive or an assembly reference?)
> 
> This seems to be generated as part of the actions in the grammar. Do you know what replaced .start?
> 
> 			else if (lt.Type == EOL || (lt.Type == MultiLineComment && Regex.IsMatch(lt.Text, "/.*\r\n|\r|\n")))
> 			{
> 				// We found our EOL: promote the token to on channel, position the input on it and reset the rule start.
> 				lt.Channel = Token.DEFAULT_CHANNEL;
> 				input.Seek(lt.TokenIndex);
> 				if (rule != null)
> 				{
> 					rule.start = lt;
> 				}
> 				break;
> 			}
> 
> I am relatively new to ANTLR and this from a grammar that is for ECMAScript that is on the ANTLR grammar site. I think is what is being done here is an attempt at "auto semicolon inserstion". I think is what is supposed to happen here is that if there is no semicolon but there is an EOL then reset the parser. How that is done as apparently changed between 3.0 and 3.1. Thanks again.
> 
> Kevin

Try .Start. I've changed some declarations to match more the .NET 
conventions.

Johannes


More information about the antlr-interest mailing list