protected void argument( INodeWithArguments node ) //throws RecognitionException, TokenStreamException { Expression value = null; ExpressionPair pair = null; try { // for error handling bool synPredMatched660 = false; if (((tokenSet_5_.member(LA(1))) && (tokenSet_127_.member(LA(2))))) { int _m660 = mark(); synPredMatched660 = true; inputState.guessing++; try { { expression_pair(); } } catch (RecognitionException) { synPredMatched660 = false; } rewind(_m660); inputState.guessing--; } if ( synPredMatched660 ) { { pair=expression_pair(); if (0==inputState.guessing) { if (pair != null) node.NamedArguments.Add(pair); } } } else if ((tokenSet_5_.member(LA(1))) && (tokenSet_128_.member(LA(2)))) { { value=expression(); if (0==inputState.guessing) { if (value != null) node.Arguments.Add(value); } } } else { throw new NoViableAltException(LT(1), getFilename()); } } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex, "argument"); recover(ex,tokenSet_87_); } else { throw ex; } } }
protected void argument_list( INodeWithArguments node ) //throws RecognitionException, TokenStreamException { try { // for error handling { switch ( LA(1) ) { case ESEPARATOR: case CAST: case CHAR: case FALSE: case NOT: case NULL: case SELF: case SUPER: case THEN: case TRUE: case TYPEOF: case TRIPLE_QUOTED_STRING: case LPAREN: case DOUBLE_QUOTED_STRING: case SINGLE_QUOTED_STRING: case ID: case MULTIPLY: case LBRACK: case SPLICE_BEGIN: case DOT: case LBRACE: case QQ_BEGIN: case SUBTRACT: case LONG: case INCREMENT: case DECREMENT: case ONES_COMPLEMENT: case INT: case BACKTICK_QUOTED_STRING: case RE_LITERAL: case DOUBLE: case FLOAT: case TIMESPAN: { argument(node); { // ( ... )* for (;;) { if ((LA(1)==COMMA)) { match(COMMA); argument(node); } else { goto _loop657_breakloop; } } _loop657_breakloop: ; } // ( ... )* break; } case RPAREN: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex, "argument_list"); recover(ex,tokenSet_53_); } else { throw ex; } } }
//throws RecognitionException, TokenStreamException protected void argument( INodeWithArguments node ) { IToken id = null; IToken colon = null; Expression value = null; try { // for error handling bool synPredMatched588 = false; if (((LA(1)==ID) && (LA(2)==COLON))) { int _m588 = mark(); synPredMatched588 = true; inputState.guessing++; try { { match(ID); match(COLON); } } catch (RecognitionException) { synPredMatched588 = false; } rewind(_m588); inputState.guessing--; } if ( synPredMatched588 ) { { id = LT(1); match(ID); colon = LT(1); match(COLON); value=expression(); if (0==inputState.guessing) { node.NamedArguments.Add( new ExpressionPair( SourceLocationFactory.ToLexicalInfo(colon), new ReferenceExpression(SourceLocationFactory.ToLexicalInfo(id), id.getText()), value)); } } } else if ((tokenSet_4_.member(LA(1))) && (tokenSet_122_.member(LA(2)))) { { value=expression(); if (0==inputState.guessing) { if (null != value) { node.Arguments.Add(value); } } } } else { throw new NoViableAltException(LT(1), getFilename()); } } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex,tokenSet_82_); } else { throw ex; } } }