/** <summary> * Create tree node that holds the start and stop tokens associated * with an error. * </summary> * * <remarks> * If you specify your own kind of tree nodes, you will likely have to * override this method. CommonTree returns Token.INVALID_TOKEN_TYPE * if no token payload but you might have to set token type for diff * node type. * * You don't have to subclass CommonErrorNode; you will likely need to * subclass your own tree node class to avoid class cast exception. * </remarks> */ public virtual object ErrorNode( ITokenStream input, IToken start, IToken stop, RecognitionException e ) { CommonErrorNode t = new CommonErrorNode( input, start, stop, e ); //System.out.println("returning error node '"+t+"' @index="+input.index()); return t; }
/** <summary> * Create tree node that holds the start and stop tokens associated * with an error. * </summary> * * <remarks> * If you specify your own kind of tree nodes, you will likely have to * override this method. CommonTree returns Token.INVALID_TOKEN_TYPE * if no token payload but you might have to set token type for diff * node type. * * You don't have to subclass CommonErrorNode; you will likely need to * subclass your own tree node class to avoid class cast exception. * </remarks> */ public virtual object ErrorNode(ITokenStream input, IToken start, IToken stop, RecognitionException e) { CommonErrorNode t = new CommonErrorNode(input, start, stop, e); //System.out.println("returning error node '"+t+"' @index="+input.index()); return(t); }
public void createXMLErrorNode(CommonErrorNode error, XmlWriter writer) { writer.WriteStartElement("ERROR"); writer.WriteAttributeString("value", error.ToStringTree()); writer.WriteEndElement(); }