use of antlr.RecognitionException in project cxf by apache.
the class IDLParser method attr_dcl.
public final void attr_dcl() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
AST attr_dcl_AST = null;
try {
// for error handling
switch(LA(1)) {
case LITERAL_readonly:
{
readonly_attr_spec();
astFactory.addASTChild(currentAST, returnAST);
attr_dcl_AST = (AST) currentAST.root;
break;
}
case LITERAL_attribute:
{
attr_spec();
astFactory.addASTChild(currentAST, returnAST);
attr_dcl_AST = (AST) currentAST.root;
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
} catch (RecognitionException ex) {
if (inputState.guessing == 0) {
reportError(ex);
consume();
consumeUntil(_tokenSet_10);
} else {
throw ex;
}
}
returnAST = attr_dcl_AST;
}
use of antlr.RecognitionException in project cxf by apache.
the class IDLParser method parameter_dcls.
public final void parameter_dcls() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
AST parameter_dcls_AST = null;
try {
// for error handling
match(LPAREN);
{
switch(LA(1)) {
case LITERAL_in:
case LITERAL_out:
case LITERAL_inout:
{
param_dcl_list();
astFactory.addASTChild(currentAST, returnAST);
break;
}
case RPAREN:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
match(RPAREN);
parameter_dcls_AST = (AST) currentAST.root;
} catch (RecognitionException ex) {
if (inputState.guessing == 0) {
reportError(ex);
consume();
consumeUntil(_tokenSet_57);
} else {
throw ex;
}
}
returnAST = parameter_dcls_AST;
}
use of antlr.RecognitionException in project cxf by apache.
the class IDLParser method case_stmt_list.
public final void case_stmt_list() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
AST case_stmt_list_AST = null;
try {
// for error handling
{
int _cnt157 = 0;
_loop157: do {
if ((LA(1) == LITERAL_case || LA(1) == LITERAL_default)) {
case_stmt();
astFactory.addASTChild(currentAST, returnAST);
} else {
if (_cnt157 >= 1) {
break _loop157;
} else {
throw new NoViableAltException(LT(1), getFilename());
}
}
_cnt157++;
} while (true);
}
case_stmt_list_AST = (AST) currentAST.root;
} catch (RecognitionException ex) {
if (inputState.guessing == 0) {
reportError(ex);
consume();
consumeUntil(_tokenSet_15);
} else {
throw ex;
}
}
returnAST = case_stmt_list_AST;
}
use of antlr.RecognitionException in project cxf by apache.
the class IDLParser method unsigned_short_int.
public final void unsigned_short_int() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
AST unsigned_short_int_AST = null;
try {
// for error handling
AST tmp146_AST = null;
tmp146_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp146_AST);
match(LITERAL_unsigned);
AST tmp147_AST = null;
tmp147_AST = astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp147_AST);
match(LITERAL_short);
unsigned_short_int_AST = (AST) currentAST.root;
} catch (RecognitionException ex) {
if (inputState.guessing == 0) {
reportError(ex);
consume();
consumeUntil(_tokenSet_35);
} else {
throw ex;
}
}
returnAST = unsigned_short_int_AST;
}
use of antlr.RecognitionException in project cxf by apache.
the class IDLLexer method nextToken.
public Token nextToken() throws TokenStreamException {
Token theRetToken = null;
tryAgain: for (; ; ) {
Token _token = null;
int _ttype = Token.INVALID_TYPE;
resetText();
try {
// for char stream error handling
try {
// for lexical error handling
switch(LA(1)) {
case ';':
{
mSEMI(true);
theRetToken = _returnToken;
break;
}
case '?':
{
mQUESTION(true);
theRetToken = _returnToken;
break;
}
case '(':
{
mLPAREN(true);
theRetToken = _returnToken;
break;
}
case ')':
{
mRPAREN(true);
theRetToken = _returnToken;
break;
}
case '[':
{
mLBRACK(true);
theRetToken = _returnToken;
break;
}
case ']':
{
mRBRACK(true);
theRetToken = _returnToken;
break;
}
case '{':
{
mLCURLY(true);
theRetToken = _returnToken;
break;
}
case '}':
{
mRCURLY(true);
theRetToken = _returnToken;
break;
}
case '|':
{
mOR(true);
theRetToken = _returnToken;
break;
}
case '^':
{
mXOR(true);
theRetToken = _returnToken;
break;
}
case '&':
{
mAND(true);
theRetToken = _returnToken;
break;
}
case ',':
{
mCOMMA(true);
theRetToken = _returnToken;
break;
}
case '=':
{
mASSIGN(true);
theRetToken = _returnToken;
break;
}
case '!':
{
mNOT(true);
theRetToken = _returnToken;
break;
}
case '+':
{
mPLUS(true);
theRetToken = _returnToken;
break;
}
case '-':
{
mMINUS(true);
theRetToken = _returnToken;
break;
}
case '~':
{
mTILDE(true);
theRetToken = _returnToken;
break;
}
case '*':
{
mSTAR(true);
theRetToken = _returnToken;
break;
}
case '%':
{
mMOD(true);
theRetToken = _returnToken;
break;
}
case '\t':
case '\n':
case '\r':
case ' ':
{
mWS(true);
theRetToken = _returnToken;
break;
}
case '#':
{
mPREPROC_DIRECTIVE(true);
theRetToken = _returnToken;
break;
}
case '\'':
{
mCHAR_LITERAL(true);
theRetToken = _returnToken;
break;
}
case '"':
{
mSTRING_LITERAL(true);
theRetToken = _returnToken;
break;
}
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
mINT(true);
theRetToken = _returnToken;
break;
}
case '_':
{
mESCAPED_IDENT(true);
theRetToken = _returnToken;
break;
}
default:
if ((LA(1) == '<') && (LA(2) == '<')) {
mLSHIFT(true);
theRetToken = _returnToken;
} else if ((LA(1) == '>') && (LA(2) == '>')) {
mRSHIFT(true);
theRetToken = _returnToken;
} else if ((LA(1) == ':') && (LA(2) == ':')) {
mSCOPEOP(true);
theRetToken = _returnToken;
} else if ((LA(1) == '/') && (LA(2) == '/')) {
mSL_COMMENT(true);
theRetToken = _returnToken;
} else if ((LA(1) == '/') && (LA(2) == '*')) {
mML_COMMENT(true);
theRetToken = _returnToken;
} else if ((LA(1) == 'L') && (LA(2) == '\'')) {
mWIDE_CHAR_LITERAL(true);
theRetToken = _returnToken;
} else if ((LA(1) == 'L') && (LA(2) == '"')) {
mWIDE_STRING_LITERAL(true);
theRetToken = _returnToken;
} else if ((LA(1) == '0') && (LA(2) == 'X' || LA(2) == 'x')) {
mHEX(true);
theRetToken = _returnToken;
} else if ((LA(1) == '.') && ((LA(2) >= '0' && LA(2) <= '9'))) {
mFLOAT(true);
theRetToken = _returnToken;
} else if ((LA(1) == ':') && (true)) {
mCOLON(true);
theRetToken = _returnToken;
} else if ((LA(1) == '.') && (true)) {
mDOT(true);
theRetToken = _returnToken;
} else if ((LA(1) == '<') && (true)) {
mLT(true);
theRetToken = _returnToken;
} else if ((LA(1) == '>') && (true)) {
mGT(true);
theRetToken = _returnToken;
} else if ((LA(1) == '/') && (true)) {
mDIV(true);
theRetToken = _returnToken;
} else if ((LA(1) == '0') && (true)) {
mOCTAL(true);
theRetToken = _returnToken;
} else if ((_tokenSet_0.member(LA(1))) && (true)) {
mIDENT(true);
theRetToken = _returnToken;
} else {
if (LA(1) == EOF_CHAR) {
uponEOF();
_returnToken = makeToken(Token.EOF_TYPE);
} else {
throw new NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
}
}
}
// found SKIP token
if (_returnToken == null)
continue tryAgain;
_ttype = _returnToken.getType();
_returnToken.setType(_ttype);
return _returnToken;
} catch (RecognitionException e) {
throw new TokenStreamRecognitionException(e);
}
} catch (CharStreamException cse) {
if (cse instanceof CharStreamIOException) {
throw new TokenStreamIOException(((CharStreamIOException) cse).io);
}
throw new TokenStreamException(cse.getMessage());
}
}
}
Aggregations