
I have created a class that inherit from CSharpParser and overwritten the Parse method so I can add compiler errors. See code below:
public class myParser : CSharpParser {
public myParser (CSharpGrammar grm, string key ) : base(grm) {
}
public override IParseData Parse(IParseRequest request) {
IParseData res = base.Parse(request);
IDotNetParseData tmp = res as IDotNetParseData;
System.Collections.Generic.List<IParseError> lst = tmp.Errors as System.Collections.Generic.List<IParseError>;
// How to add errors
return res;
}
}
I can add items to the List<IParseError> lst, but how do I create errors?