// Expected token / not token public MismatchedTokenException(string[] tokenNames_, AST node_, int expecting_, bool matchNot) : base("Mismatched Token", "<AST>", -1, -1) { tokenNames = tokenNames_; node = node_; if (node_ == null) { tokenText = "<empty tree>"; } else { tokenText = node_.ToString(); } mismatchType = matchNot ? TokenTypeEnum.NotTokenType : TokenTypeEnum.TokenType; expecting = expecting_; }
// Expected BitSet / not BitSet public MismatchedTokenException(string[] tokenNames_, AST node_, BitSet set_, bool matchNot) : base("Mismatched Token", "<AST>", -1, -1) { tokenNames = tokenNames_; node = node_; if (node_ == null) { tokenText = "<empty tree>"; } else { tokenText = node_.ToString(); } mismatchType = matchNot ? TokenTypeEnum.NotSetType : TokenTypeEnum.SetType; bset = set_; }
public virtual void traceOut(string rname, AST t) { traceIndent(); Console.Out.WriteLine("< " + rname + "(" + ((t != null) ? t.ToString() : "null") + ")" + ((inputState.guessing > 0) ? " [guessing]" : "")); traceDepth--; }