Пример #1
0
 /*Consume tokens until one matches the given token set */
 public virtual void  consumeUntil(BitSet bset)
 {
     while (LA(1) != Token.EOF_TYPE && !bset.member(LA(1)))
     {
         consume();
     }
 }
Пример #2
0
 /*Make sure current lookahead symbol matches the given set
  * Throw an exception upon mismatch, which is catch by either the
  * error handler or by the syntactic predicate.
  */
 public virtual void  match(AST t, BitSet b)
 {
     if (t == null || t == ASTNULL || !b.member(t.Type))
     {
         throw new MismatchedTokenException(getTokenNames(), t, b, false);
     }
 }
Пример #3
0
 /*Consume chars until one matches the given set */
 public virtual void  consumeUntil(BitSet bset)
 {
     while (LA(1) != EOF_CHAR && !bset.member(LA(1)))
     {
         consume();
     }
 }
Пример #4
0
		/*Make sure current lookahead symbol matches the given set
		* Throw an exception upon mismatch, which is catch by either the
		* error handler or by the syntactic predicate.
		*/
		public virtual void  match(BitSet b)
		{
			if (!b.member(LA(1)))
				throw new MismatchedTokenException(tokenNames, LT(1), b, false, getFilename());
			else
				consume();
		}
Пример #5
0
 /*Consume chars until one matches the given set */
 public virtual void consumeUntil(BitSet bset)
 {
     while (cached_LA1 != EOF_CHAR && !bset.member(cached_LA1))
     {
         consume();
     }
 }
 // Expected BitSet / not BitSet
 public MismatchedCharException(char c, BitSet set_, bool matchNot, CharScanner scanner_) :
     base("Mismatched char", scanner_.getFilename(), scanner_.getLine(), scanner_.getColumn())
 {
     mismatchType = matchNot ? CharTypeEnum.NotSetType : CharTypeEnum.SetType;
     foundChar    = c;
     bset         = set_;
     scanner      = scanner_;
 }
 // Expected BitSet / not BitSet
 public MismatchedCharException(char c, BitSet set_, bool matchNot, CharScanner scanner_)
     : base("Mismatched char", scanner_.getFilename(), scanner_.getLine(), scanner_.getColumn())
 {
     mismatchType = matchNot ? CharTypeEnum.NotSetType : CharTypeEnum.SetType;
     foundChar = c;
     bset = set_;
     scanner = scanner_;
 }
Пример #8
0
 public virtual void match(BitSet b)
 {
     if (!b.member(cached_LA1))
     {
         throw new MismatchedCharException(cached_LA1, b, false, this);
     }
     consume();
 }
Пример #9
0
 // Expected BitSet / not BitSet
 public MismatchedTokenException(string[] tokenNames_, Token token_, BitSet set_, bool matchNot, string fileName_) :
     base("Mismatched Token", fileName_, token_.getLine(), token_.getColumn())
 {
     tokenNames   = tokenNames_;
     token        = token_;
     tokenText    = token_.getText();
     mismatchType = matchNot ? TokenTypeEnum.NotSetType : TokenTypeEnum.SetType;
     bset         = set_;
 }
Пример #10
0
 public virtual void  match(BitSet b)
 {
     if (!b.member(LA(1)))
     {
         throw new MismatchedCharException(LA(1), b, false, this);
     }
     else
     {
         consume();
     }
 }
Пример #11
0
 // 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_;
 }
Пример #12
0
        public override void  match(BitSet b)
        {
            string text = this.text.ToString();
            char   la_1 = LA(1);

            try
            {
                base.match(b);
                eventSupport.fireMatch(la_1, b, text, inputState.guessing);
            }
            catch (MismatchedCharException e)
            {
                if (inputState.guessing == 0)
                {
                    eventSupport.fireMismatch(la_1, b, text, inputState.guessing);
                }
                throw e;
            }
        }
 // Expected BitSet / not BitSet
 public MismatchedTokenException(string[] tokenNames_, IToken token_, BitSet set_, bool matchNot, string fileName_) :
     base("Mismatched Token", fileName_, token_.getLine(), token_.getColumn())
 {
     tokenNames = tokenNames_;
     token = token_;
     tokenText = token_.getText();
     mismatchType = matchNot ? TokenTypeEnum.NotSetType : TokenTypeEnum.SetType;
     bset = set_;
 }
 // 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  hide(BitSet mask)
 {
     hideMask = mask;
 }
Пример #16
0
 public override void match(BitSet bitSet)               // throws MismatchedTokenException, TokenStreamException
 {
     addCurrentTokenToParseTree();
     base.match(bitSet);
 }
 public virtual void hide(BitSet mask)
 {
     hideMask = mask;
 }
Пример #18
0
 public TokenStreamBasicFilter(TokenStream input)
 {
     this.input  = input;
     discardMask = new BitSet();
 }
Пример #19
0
		public TokenStreamBasicFilter(TokenStream input)
		{
			this.input = input;
			discardMask = new BitSet();
		}
Пример #20
0
		/*Consume chars until one matches the given set */
		public virtual void  consumeUntil(BitSet bset)
		{
			while (cached_LA1 != EOF_CHAR && !bset.member(cached_LA1))
			{
				consume();
			}
		}
Пример #21
0
		public override void match(BitSet bitSet) 	// throws MismatchedTokenException, TokenStreamException 
		{
			addCurrentTokenToParseTree();
			base.match(bitSet);
		}
Пример #22
0
 public virtual void recover(RecognitionException ex, BitSet tokenSet)
 {
     consume();
     consumeUntil(tokenSet);
 }
Пример #23
0
		public virtual void  match(BitSet b)
		{
			if (!b.member(cached_LA1))
			{
				throw new MismatchedCharException(cached_LA1, b, false, this);
			}
			consume();
		}
Пример #24
0
 /*Consume chars until one matches the given set */
 public virtual void consumeUntil(BitSet bset)
 {
     while (LA(1) != EOF_CHAR && !bset.member(LA(1)))
     {
         consume();
     }
 }
Пример #25
0
 public virtual void match(BitSet b)
 {
     if (!b.member(LA(1)))
     {
         throw new MismatchedCharException(LA(1), b, false, this);
     }
     else
     {
         consume();
     }
 }
 public TokenStreamHiddenTokenFilter(TokenStream input) : base(input)
 {
     hideMask = new BitSet();
 }
Пример #27
0
 public virtual void  discard(BitSet mask)
 {
     discardMask = mask;
 }
Пример #28
0
		/*Make sure current lookahead symbol matches the given set
		* Throw an exception upon mismatch, which is catch by either the
		* error handler or by the syntactic predicate.
		*/
		public virtual void  match(AST t, BitSet b)
		{
			if (t == null || t == ASTNULL || !b.member(t.Type))
			{
				throw new MismatchedTokenException(getTokenNames(), t, b, false);
			}
		}
Пример #29
0
 /*Consume tokens until one matches the given token set */
 public virtual void consumeUntil(BitSet bset)
 {
     while (LA(1) != Token.EOF_TYPE && !bset.member(LA(1)))
     {
         consume();
     }
 }
 public TokenStreamHiddenTokenFilter(TokenStream input)
     : base(input)
 {
     hideMask = new BitSet();
 }
Пример #31
0
 public virtual void recover(RecognitionException ex, BitSet tokenSet)
 {
     consume();
     consumeUntil(tokenSet);
 }
Пример #32
0
 /*Make sure current lookahead symbol matches the given set
 * Throw an exception upon mismatch, which is catch by either the
 * error handler or by the syntactic predicate.
 */
 public virtual void match(BitSet b)
 {
     if (!b.member(LA(1)))
         throw new MismatchedTokenException(tokenNames, LT(1), b, false, getFilename());
     else
         consume();
 }
Пример #33
0
		public virtual void  discard(BitSet mask)
		{
			discardMask = mask;
		}
Пример #34
0
		public override void  match(BitSet b)
		{
			string text = this.text.ToString();
			char la_1 = LA(1);
			try
			{
				base.match(b);
				eventSupport.fireMatch(la_1, b, text, inputState.guessing);
			}
			catch (MismatchedCharException e)
			{
				if (inputState.guessing == 0)
					eventSupport.fireMismatch(la_1, b, text, inputState.guessing);
				throw e;
			}
		}