public IExpression trailer( IExpression inner ) //throws RecognitionException, TokenStreamException { IExpression exp; IToken t1 = null; IToken t = null; exp = null; BlockExpression temp = null; String qp = String.Empty; switch ( LA(1) ) { case LPAREN: { match(LPAREN); if (0==inputState.guessing) { exp = new MethodInvocationExpression(inner); } { switch ( LA(1) ) { case NUM_INT: case NUM_FLOAT: case NUM_LONG: case IDENT: case STATICIDENT: case INSTIDENT: case LITERAL_self: case LPAREN: case LITERAL_lambda: case LCURLY: case LITERAL_raise: case LITERAL_yield: case LITERAL_not: case LNOT: case PLUS: case MINUS: case BNOT: case LBRACK: case LITERAL_base: case STRING_LITERAL: case CHAR_LITERAL: { arglist((exp as MethodInvocationExpression).Arguments); break; } case RPAREN: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(RPAREN); break; } case DO: case LCURLY: { temp=block(); if (0==inputState.guessing) { exp = inner; exp.Block = temp; } break; } case COLONCOLON: { match(COLONCOLON); t1 = LT(1); match(IDENT); if (0==inputState.guessing) { exp = new MemberAccessExpression(inner, t1.getText()); } break; } default: if ((LA(1)==DOT) && (LA(2)==97)) { match(DOT); match(97); if (0==inputState.guessing) { exp = new NullCheckExpression(inner); } } else if ((LA(1)==DOT) && (LA(2)==IDENT)) { match(DOT); t = LT(1); match(IDENT); if (0==inputState.guessing) { exp = new MemberAccessExpression(inner, t.getText()); } } else { throw new NoViableAltException(LT(1), getFilename()); } break; } return exp; }
// // Expressions // public virtual void VisitMethodInvocationExpression(MethodInvocationExpression invocationExpression) { VisitNode(invocationExpression.Designator); VisitNodes(invocationExpression.Arguments); VisitCommonExpNodes(invocationExpression); }
public override void VisitMethodInvocationExpression(MethodInvocationExpression invocationExpression) { nodeStack.Push( CurrentNode.Nodes.Add("MethodInvocationExpression " + invocationExpression.Designator)); CurrentNode.Tag = invocationExpression; base.VisitMethodInvocationExpression(invocationExpression); nodeStack.Pop(); }