예제 #1
0
 public virtual void match(BitSet b)
 {
     if (!b.member(cached_LA1))
     {
         throw new MismatchedCharException(cached_LA1, b, false, this);
     }
     consume();
 }
예제 #2
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();
     }
 }
예제 #3
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();
     }
 }
예제 #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
 /*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);
     }
 }