[antlr-interest] C# target: .NET Framework bug causing NullReferenceException, must use this workaround

Johannes Luber jaluber at gmx.de
Sat Aug 9 06:05:17 PDT 2008


Sam Harwell schrieb:
> Here is the bug report I filed with MS:
> https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Fe
> edbackID=361125
> 
> The error occurs in
> Antlr.Runtime.BaseRecognizer.GetErrorMessage(RecognitionException e,
> string[] tokenNames):
> 
> msg = "mismatched tree node: " + mtne.Node + " expecting " + tokenName;
> 
> This line must be changed to:
> 
> string mismatchedNode = null;
> if ( mtne.Node != null )
> {
> 	mismatchedNode = mtne.Node.ToString();
> }
> msg = "mismatched tree node: " + mismatchedNode + " expecting " +
> tokenName;
> 
> According to ECMA-334, it is fine if mismatchedNode is null at the time
> of concatenation.
> 
> Sam
> 
Can you tell me in which section ECMA 334 defines this behaviour, too? I 
just like to read it myself. And did you sign the ANTLR Contribution 
License? Otherwise I can't use your bugfix.

Johannes


More information about the antlr-interest mailing list