// 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_;
 }
		// Expected range / not range
		public MismatchedTokenException(string[] tokenNames_, AST node_, int lower, int upper_, 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.NotRangeType : TokenTypeEnum.RangeType;
			expecting = lower;
			upper = upper_;
		}
		public virtual void  traceOut(string rname, AST t)
		{
			traceIndent();
			Console.Out.WriteLine("< " + rname + "(" + ((t != null) ? t.ToString() : "null") + ")" + ((inputState.guessing > 0) ? " [guessing]" : ""));
			traceDepth--;
		}
		// 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_;
		}
Exemple #6
0
 public virtual void  traceOut(string rname, AST t)
 {
     traceIndent();
     Console.Out.WriteLine("< " + rname + "(" + ((t != null) ? t.ToString() : "null") + ")" + ((inputState.guessing > 0) ? " [guessing]" : ""));
     traceDepth--;
 }