当前位置: 首页>>代码示例>>Java>>正文


Java EarlyExitException类代码示例

本文整理汇总了Java中org.antlr.runtime.EarlyExitException的典型用法代码示例。如果您正苦于以下问题:Java EarlyExitException类的具体用法?Java EarlyExitException怎么用?Java EarlyExitException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EarlyExitException类属于org.antlr.runtime包,在下文中一共展示了EarlyExitException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testFloat

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
@Test
public void testFloat()
{
    runLexer(".23");
    assertNoError();
    assertToken(0, TraciLexer.FLOAT, ".23", Token.DEFAULT_CHANNEL, 1, 0);

    runLexer("2.23.23");
    assertNoError();
    assertToken(0, TraciLexer.FLOAT, "2.23", Token.DEFAULT_CHANNEL, 1, 0);

    runLexer("2.23e-10-5");
    assertNoError();
    assertToken(0, TraciLexer.FLOAT, "2.23e-10", Token.DEFAULT_CHANNEL, 1, 0);

    runLexer(".23E+13.2");
    assertNoError();
    assertToken(0, TraciLexer.FLOAT, ".23E+13", Token.DEFAULT_CHANNEL, 1, 0);

    runLexer("23E13");
    assertNoError();
    assertToken(0, TraciLexer.FLOAT, "23E13", Token.DEFAULT_CHANNEL, 1, 0);

    runLexer("1.2e+");
    assertError(EarlyExitException.class);
}
 
开发者ID:erikpe,项目名称:traci,代码行数:27,代码来源:TraciLexerTest.java

示例2: getErrorMessage

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
/**
 * Format an error message as expected by ANTLR. It is basically the
 * same error message that ANTL BaseRecognizer generates with some
 * additional data.
 * Also used to log debugging information.
 * @param log the logger to use at debug time
 * @param recognizer the lexer or parser who generated the error
 * @param e the exception that occured
 * @param superMessage the error message that the super class generated
 * @param tokenNames list of token names
 * @return a formatted error message
 */
public static String getErrorMessage(
        final Log log,
        final BaseRecognizer recognizer,
        final RecognitionException e,
        final String superMessage,
        final String[] tokenNames) {
    if (log.isDebugEnabled()) {
        List < ? > stack = BaseRecognizer.getRuleInvocationStack(
                e, recognizer.getClass().getSuperclass().getName());
        String debugMsg = recognizer.getErrorHeader(e)
            + " " + e.getClass().getSimpleName()
            + ": " + superMessage
            + ":";
        if (e instanceof NoViableAltException) {
            NoViableAltException nvae = (NoViableAltException) e;
            debugMsg += " (decision=" + nvae.decisionNumber
            + " state=" + nvae.stateNumber + ")"
            + " decision=<<" + nvae.grammarDecisionDescription + ">>";
        } else if (e instanceof UnwantedTokenException) {
            UnwantedTokenException ute = (UnwantedTokenException) e;
            debugMsg += " (unexpected token=" + toString(ute.getUnexpectedToken(), tokenNames) + ")";

        } else if (e instanceof EarlyExitException) {
            EarlyExitException eea = (EarlyExitException) e;
            debugMsg += " (decision=" + eea.decisionNumber + ")";
        }
        debugMsg += " ruleStack=" + stack.toString();
        log.debug(debugMsg);
    }

    return makeUserMsg(e, superMessage);
}
 
开发者ID:legsem,项目名称:legstar-cob2xsd,代码行数:45,代码来源:RecognizerErrorHandler.java

示例3: makeUserMsg

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
/**
 * Simplify error message text for end users.
 * @param e exception that occurred
 * @param msg as formatted by ANTLR
 * @return a more readable error message
 */
public static String makeUserMsg(final RecognitionException e, final String msg) {
    if (e instanceof NoViableAltException) {
        return msg.replace("no viable alternative at", "unrecognized");
    } else if (e instanceof UnwantedTokenException) {
        return msg.replace("extraneous input", "unexpected token");
    } else if (e instanceof MismatchedTokenException) {
        if (msg.contains("mismatched input '<EOF>'")) {
            return msg.replace("mismatched input '<EOF>' expecting", "reached end of file looking for");
        } else {
            return msg.replace("mismatched input", "unexpected token");
        }
    } else if (e instanceof EarlyExitException) {
        return msg.replace("required (...)+ loop did not match anything", "required tokens not found");
    } else if (e instanceof FailedPredicateException) {
        if (msg.contains("picture_string failed predicate: {Unbalanced parentheses}")) {
            return "Unbalanced parentheses in picture string";
        }
        if (msg.contains("PICTURE_PART failed predicate: {Contains invalid picture symbols}")) {
            return "Picture string contains invalid symbols";
        }
        if (msg.contains("PICTURE_PART failed predicate: {Syntax error in last picture clause}")) {
            return "Syntax error in last picture clause";
        }
        if (msg.contains("DATA_NAME failed predicate: {Syntax error in last clause}")) {
            return "Syntax error in last COBOL clause";
        }
    }
    return msg;
}
 
开发者ID:legsem,项目名称:legstar-cob2xsd,代码行数:36,代码来源:RecognizerErrorHandler.java

示例4: getErrorMessage

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
/**
 * Format an error message as expected by ANTLR. It is basically the
 * same error message that ANTL BaseRecognizer generates with some
 * additional data.
 * Also used to log debugging information.
 * @param log the logger to use at debug time
 * @param recognizer the lexer or parser who generated the error
 * @param e the exception that occured
 * @param superMessage the error message that the super class generated
 * @param tokenNames list of token names
 * @return a formatted error message
 */
public static String getErrorMessage(
        final Logger log,
        final BaseRecognizer recognizer,
        final RecognitionException e,
        final String superMessage,
        final String[] tokenNames) {
    if (log.isDebugEnabled()) {
        List < ? > stack = BaseRecognizer.getRuleInvocationStack(
                e, recognizer.getClass().getSuperclass().getName());
        String debugMsg = recognizer.getErrorHeader(e)
            + " " + e.getClass().getSimpleName()
            + ": " + superMessage
            + ":";
        if (e instanceof NoViableAltException) {
            NoViableAltException nvae = (NoViableAltException) e;
            debugMsg += " (decision=" + nvae.decisionNumber
            + " state=" + nvae.stateNumber + ")"
            + " decision=<<" + nvae.grammarDecisionDescription + ">>";
        } else if (e instanceof UnwantedTokenException) {
            UnwantedTokenException ute = (UnwantedTokenException) e;
            debugMsg += " (unexpected token=" + toString(ute.getUnexpectedToken(), tokenNames) + ")";

        } else if (e instanceof EarlyExitException) {
            EarlyExitException eea = (EarlyExitException) e;
            debugMsg += " (decision=" + eea.decisionNumber + ")";
        }
        debugMsg += " ruleStack=" + stack.toString();
        log.debug(debugMsg);
    }

    return makeUserMsg(e, superMessage);
}
 
开发者ID:legsem,项目名称:legstar-core2,代码行数:45,代码来源:RecognizerErrorHandler.java

示例5: mFIELD_NAME

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mFIELD_NAME() throws RecognitionException {
	try {
		int _type = FIELD_NAME;
		int _channel = DEFAULT_TOKEN_CHANNEL;
		// src/Query.g:142:3: ( ( 'a' .. 'z' | '_' )+ )
		// src/Query.g:142:5: ( 'a' .. 'z' | '_' )+
		{
			// src/Query.g:142:5: ( 'a' .. 'z' | '_' )+
			int cnt1=0;
			loop1:
			while (true) {
				int alt1=2;
				int LA1_0 = input.LA(1);
				if ( (LA1_0=='_'||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) {
					alt1=1;
				}

				switch (alt1) {
					case 1 :
						// src/Query.g:
					{
						if ( input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
							input.consume();
						}
						else {
							MismatchedSetException mse = new MismatchedSetException(null,input);
							recover(mse);
							throw mse;
						}
					}
					break;

					default :
						if ( cnt1 >= 1 ) break loop1;
						EarlyExitException eee = new EarlyExitException(1, input);
						throw eee;
				}
				cnt1++;
			}

		}

		state.type = _type;
		state.channel = _channel;
	}
	finally {
		// do for sure before leaving
	}
}
 
开发者ID:jruesga,项目名称:rview,代码行数:50,代码来源:QueryLexer.java

示例6: mWHITESPACE

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mWHITESPACE() throws RecognitionException {
    try {
        int _type = WHITESPACE;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // com/opengamma/financial/expression/deprecated/Expr.g:40:12: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
        // com/opengamma/financial/expression/deprecated/Expr.g:40:14: ( ' ' | '\\t' | '\\r' | '\\n' )+
        {
        // com/opengamma/financial/expression/deprecated/Expr.g:40:14: ( ' ' | '\\t' | '\\r' | '\\n' )+
        int cnt6=0;
        loop6:
        do {
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( ((LA6_0>='\t' && LA6_0<='\n')||LA6_0=='\r'||LA6_0==' ') ) {
                alt6=1;
            }


            switch (alt6) {
        	case 1 :
        	    // com/opengamma/financial/expression/deprecated/Expr.g:
        	    {
        	    if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
        	        input.consume();

        	    }
        	    else {
        	        MismatchedSetException mse = new MismatchedSetException(null,input);
        	        recover(mse);
        	        throw mse;}


        	    }
        	    break;

        	default :
        	    if ( cnt6 >= 1 ) break loop6;
                    EarlyExitException eee =
                        new EarlyExitException(6, input);
                    throw eee;
            }
            cnt6++;
        } while (true);

         skip (); 

        }

        state.type = _type;
        state.channel = _channel;
    }
    finally {
    }
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:56,代码来源:ExprLexer.java

示例7: mINTEGER

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mINTEGER() throws RecognitionException {
    try {
        int _type = INTEGER;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // com/opengamma/financial/expression/deprecated/Expr.g:41:9: ( ( '+' | '-' )? ( '0' .. '9' )+ )
        // com/opengamma/financial/expression/deprecated/Expr.g:41:11: ( '+' | '-' )? ( '0' .. '9' )+
        {
        // com/opengamma/financial/expression/deprecated/Expr.g:41:11: ( '+' | '-' )?
        int alt7=2;
        int LA7_0 = input.LA(1);

        if ( (LA7_0=='+'||LA7_0=='-') ) {
            alt7=1;
        }
        switch (alt7) {
            case 1 :
                // com/opengamma/financial/expression/deprecated/Expr.g:
                {
                if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
                    input.consume();

                }
                else {
                    MismatchedSetException mse = new MismatchedSetException(null,input);
                    recover(mse);
                    throw mse;}


                }
                break;

        }

        // com/opengamma/financial/expression/deprecated/Expr.g:41:22: ( '0' .. '9' )+
        int cnt8=0;
        loop8:
        do {
            int alt8=2;
            int LA8_0 = input.LA(1);

            if ( ((LA8_0>='0' && LA8_0<='9')) ) {
                alt8=1;
            }


            switch (alt8) {
        	case 1 :
        	    // com/opengamma/financial/expression/deprecated/Expr.g:41:22: '0' .. '9'
        	    {
        	    matchRange('0','9'); 

        	    }
        	    break;

        	default :
        	    if ( cnt8 >= 1 ) break loop8;
                    EarlyExitException eee =
                        new EarlyExitException(8, input);
                    throw eee;
            }
            cnt8++;
        } while (true);


        }

        state.type = _type;
        state.channel = _channel;
    }
    finally {
    }
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:73,代码来源:ExprLexer.java

示例8: mHEX_NUMBER

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mHEX_NUMBER() throws RecognitionException {
  try {
    final int _type = HEX_NUMBER;
    final int _channel = DEFAULT_TOKEN_CHANNEL;
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:26:12:
    // ( '0x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ )
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:26:14:
    // '0x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+
    {
      match("0x");

      // C:\\Dokumente und
      // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:26:19:
      // ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+
      int cnt2 = 0;
      loop2: do {
        int alt2 = 2;
        final int LA2_0 = input.LA(1);

        if (((LA2_0 >= '0' && LA2_0 <= '9') || (LA2_0 >= 'A' && LA2_0 <= 'F') || (LA2_0 >= 'a' && LA2_0 <= 'f'))) {
          alt2 = 1;
        }


        switch (alt2) {
          case 1:
          // C:\\Dokumente und
          // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:
          {
            if ((input.LA(1) >= '0' && input.LA(1) <= '9')
                || (input.LA(1) >= 'A' && input.LA(1) <= 'F')
                || (input.LA(1) >= 'a' && input.LA(1) <= 'f')) {
              input.consume();

            } else {
              final MismatchedSetException mse = new MismatchedSetException(null, input);
              recover(mse);
              throw mse;
            }


          }
            break;

          default:
            if (cnt2 >= 1) {
              break loop2;
            }
            final EarlyExitException eee = new EarlyExitException(2, input);
            throw eee;
        }
        cnt2++;
      } while (true);


    }

    state.type = _type;
    state.channel = _channel;
  } finally {
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:65,代码来源:MemoryExpressionLexer.java

示例9: mNUMBER

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mNUMBER() throws RecognitionException {
  try {
    final int _type = NUMBER;
    final int _channel = DEFAULT_TOKEN_CHANNEL;
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:25:9:
    // ( ( DIGIT )+ )
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:25:11:
    // ( DIGIT )+
    {
      // C:\\Dokumente und
      // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:25:11:
      // ( DIGIT )+
      int cnt1 = 0;
      loop1: do {
        int alt1 = 2;
        final int LA1_0 = input.LA(1);

        if (((LA1_0 >= '0' && LA1_0 <= '9'))) {
          alt1 = 1;
        }


        switch (alt1) {
          case 1:
          // C:\\Dokumente und
          // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:25:11:
          // DIGIT
          {
            mDIGIT();

          }
            break;

          default:
            if (cnt1 >= 1) {
              break loop1;
            }
            final EarlyExitException eee = new EarlyExitException(1, input);
            throw eee;
        }
        cnt1++;
      } while (true);


    }

    state.type = _type;
    state.channel = _channel;
  } finally {
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:54,代码来源:MemoryExpressionLexer.java

示例10: mREGISTER

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mREGISTER() throws RecognitionException {
  try {
    final int _type = REGISTER;
    final int _channel = DEFAULT_TOKEN_CHANNEL;
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:27:10:
    // ( CHARACTER ( CHARACTER | DIGIT )+ )
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:27:12:
    // CHARACTER ( CHARACTER | DIGIT )+
    {
      mCHARACTER();
      // C:\\Dokumente und
      // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:27:22:
      // ( CHARACTER | DIGIT )+
      int cnt3 = 0;
      loop3: do {
        int alt3 = 2;
        final int LA3_0 = input.LA(1);

        if (((LA3_0 >= '0' && LA3_0 <= '9') || (LA3_0 >= 'A' && LA3_0 <= 'Z') || (LA3_0 >= 'a' && LA3_0 <= 'z'))) {
          alt3 = 1;
        }


        switch (alt3) {
          case 1:
          // C:\\Dokumente und
          // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\gotomem\\MemoryExpression.g:
          {
            if ((input.LA(1) >= '0' && input.LA(1) <= '9')
                || (input.LA(1) >= 'A' && input.LA(1) <= 'Z')
                || (input.LA(1) >= 'a' && input.LA(1) <= 'z')) {
              input.consume();

            } else {
              final MismatchedSetException mse = new MismatchedSetException(null, input);
              recover(mse);
              throw mse;
            }


          }
            break;

          default:
            if (cnt3 >= 1) {
              break loop3;
            }
            final EarlyExitException eee = new EarlyExitException(3, input);
            throw eee;
        }
        cnt3++;
      } while (true);


    }

    state.type = _type;
    state.channel = _channel;
  } finally {
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:64,代码来源:MemoryExpressionLexer.java

示例11: mHEX_NUMBER

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mHEX_NUMBER() throws RecognitionException {
  try {
    final int _type = HEX_NUMBER;
    final int _channel = DEFAULT_TOKEN_CHANNEL;
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:33:12:
    // ( '0x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ )
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:33:14:
    // '0x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+
    {
      match("0x");

      // C:\\Dokumente und
      // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:33:19:
      // ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+
      int cnt2 = 0;
      loop2: do {
        int alt2 = 2;
        final int LA2_0 = input.LA(1);

        if (((LA2_0 >= '0' && LA2_0 <= '9') || (LA2_0 >= 'A' && LA2_0 <= 'F') || (LA2_0 >= 'a' && LA2_0 <= 'f'))) {
          alt2 = 1;
        }


        switch (alt2) {
          case 1:
          // C:\\Dokumente und
          // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:
          {
            if ((input.LA(1) >= '0' && input.LA(1) <= '9')
                || (input.LA(1) >= 'A' && input.LA(1) <= 'F')
                || (input.LA(1) >= 'a' && input.LA(1) <= 'f')) {
              input.consume();

            } else {
              final MismatchedSetException mse = new MismatchedSetException(null, input);
              recover(mse);
              throw mse;
            }


          }
            break;

          default:
            if (cnt2 >= 1) {
              break loop2;
            }
            final EarlyExitException eee = new EarlyExitException(2, input);
            throw eee;
        }
        cnt2++;
      } while (true);


    }

    state.type = _type;
    state.channel = _channel;
  } finally {
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:65,代码来源:ConditionLexer.java

示例12: mIDENTIFIER

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mIDENTIFIER() throws RecognitionException {
  try {
    final int _type = IDENTIFIER;
    final int _channel = DEFAULT_TOKEN_CHANNEL;
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:34:12:
    // ( CHARACTER ( CHARACTER | DIGIT )+ )
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:34:14:
    // CHARACTER ( CHARACTER | DIGIT )+
    {
      mCHARACTER();
      // C:\\Dokumente und
      // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:34:24:
      // ( CHARACTER | DIGIT )+
      int cnt3 = 0;
      loop3: do {
        int alt3 = 2;
        final int LA3_0 = input.LA(1);

        if (((LA3_0 >= '0' && LA3_0 <= '9') || (LA3_0 >= 'A' && LA3_0 <= 'Z') || (LA3_0 >= 'a' && LA3_0 <= 'z'))) {
          alt3 = 1;
        }


        switch (alt3) {
          case 1:
          // C:\\Dokumente und
          // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:
          {
            if ((input.LA(1) >= '0' && input.LA(1) <= '9')
                || (input.LA(1) >= 'A' && input.LA(1) <= 'Z')
                || (input.LA(1) >= 'a' && input.LA(1) <= 'z')) {
              input.consume();

            } else {
              final MismatchedSetException mse = new MismatchedSetException(null, input);
              recover(mse);
              throw mse;
            }


          }
            break;

          default:
            if (cnt3 >= 1) {
              break loop3;
            }
            final EarlyExitException eee = new EarlyExitException(3, input);
            throw eee;
        }
        cnt3++;
      } while (true);


    }

    state.type = _type;
    state.channel = _channel;
  } finally {
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:64,代码来源:ConditionLexer.java

示例13: mNUMBER

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mNUMBER() throws RecognitionException {
  try {
    final int _type = NUMBER;
    final int _channel = DEFAULT_TOKEN_CHANNEL;
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:32:9:
    // ( ( DIGIT )+ )
    // C:\\Dokumente und
    // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:32:11:
    // ( DIGIT )+
    {
      // C:\\Dokumente und
      // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:32:11:
      // ( DIGIT )+
      int cnt1 = 0;
      loop1: do {
        int alt1 = 2;
        final int LA1_0 = input.LA(1);

        if (((LA1_0 >= '0' && LA1_0 <= '9'))) {
          alt1 = 1;
        }


        switch (alt1) {
          case 1:
          // C:\\Dokumente und
          // Einstellungen\\sp\\workspace\\com.google.security.zynamics.binnavi-Trunk\\src\\com.google.security.zynamics.binnavi\\parsers\\BreakpointCondition\\Condition.g:32:11:
          // DIGIT
          {
            mDIGIT();

          }
            break;

          default:
            if (cnt1 >= 1) {
              break loop1;
            }
            final EarlyExitException eee = new EarlyExitException(1, input);
            throw eee;
        }
        cnt1++;
      } while (true);


    }

    state.type = _type;
    state.channel = _channel;
  } finally {
  }
}
 
开发者ID:google,项目名称:binnavi,代码行数:54,代码来源:ConditionLexer.java

示例14: mNUMANDSUFFIX

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mNUMANDSUFFIX() throws RecognitionException {
    try {
        int _type = NUMANDSUFFIX;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:414:2: ( ( '0' .. '9' )+ ( 'A' .. 'Z' ) )
        // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:414:4: ( '0' .. '9' )+ ( 'A' .. 'Z' )
        {
        // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:414:4: ( '0' .. '9' )+
        int cnt4=0;
        loop4:
        do {
            int alt4=2;
            int LA4_0 = input.LA(1);

            if ( ((LA4_0>='0' && LA4_0<='9')) ) {
                alt4=1;
            }


            switch (alt4) {
        	case 1 :
        	    // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:414:5: '0' .. '9'
        	    {
        	    matchRange('0','9'); 

        	    }
        	    break;

        	default :
        	    if ( cnt4 >= 1 ) break loop4;
                    EarlyExitException eee =
                        new EarlyExitException(4, input);
                    throw eee;
            }
            cnt4++;
        } while (true);

        // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:414:16: ( 'A' .. 'Z' )
        // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:414:17: 'A' .. 'Z'
        {
        matchRange('A','Z'); 

        }


        }

        state.type = _type;
        state.channel = _channel;
    }
    finally {
    }
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:54,代码来源:AddressLexer.java

示例15: mNUMBER

import org.antlr.runtime.EarlyExitException; //导入依赖的package包/类
public final void mNUMBER() throws RecognitionException {
    try {
        int _type = NUMBER;
        int _channel = DEFAULT_TOKEN_CHANNEL;
        // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:417:2: ( ( '#' )? ( '0' .. '9' )+ )
        // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:417:4: ( '#' )? ( '0' .. '9' )+
        {
        // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:417:4: ( '#' )?
        int alt5=2;
        int LA5_0 = input.LA(1);

        if ( (LA5_0=='#') ) {
            alt5=1;
        }
        switch (alt5) {
            case 1 :
                // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:417:4: '#'
                {
                match('#'); 

                }
                break;

        }

        // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:417:8: ( '0' .. '9' )+
        int cnt6=0;
        loop6:
        do {
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( ((LA6_0>='0' && LA6_0<='9')) ) {
                alt6=1;
            }


            switch (alt6) {
        	case 1 :
        	    // /Users/jeffrey/Documents/workspace/matchmaker/src/ca/sqlpower/matchmaker/address/parse/Address.g:417:9: '0' .. '9'
        	    {
        	    matchRange('0','9'); 

        	    }
        	    break;

        	default :
        	    if ( cnt6 >= 1 ) break loop6;
                    EarlyExitException eee =
                        new EarlyExitException(6, input);
                    throw eee;
            }
            cnt6++;
        } while (true);


        }

        state.type = _type;
        state.channel = _channel;
    }
    finally {
    }
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:65,代码来源:AddressLexer.java


注:本文中的org.antlr.runtime.EarlyExitException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。