Package com.bacoder.parser.java.api

Examples of com.bacoder.parser.java.api.Invocation


      return null;
    }

    Expression expression = getAdapter(ExpressionAdapter.class).adapt(expressionContext);

    Invocation invocation = null;
    if (expression instanceof ThisExpression) {
      invocation = createNode(context, ThisInvocation.class);
    } else if (expression instanceof SuperExpression) {
      invocation = createNode(context, SuperInvocation.class);
    } else if (expression instanceof Identifier) {
      MethodInvocation methodInvocation = createNode(context, MethodInvocation.class);
      methodInvocation.setName((Identifier) expression);
    } else if (expression instanceof ScopedExpression) {
      ScopedExpression scopedExpression = (ScopedExpression) expression;
      if (scopedExpression.getExpression() instanceof ThisExpression) {
        invocation = createNode(context, ThisInvocation.class);
        invocation.setScope(scopedExpression.getScope());
      } else if (scopedExpression.getExpression() instanceof SuperExpression) {
        invocation = createNode(context, SuperInvocation.class);
        invocation.setScope(scopedExpression.getScope());
      } else if (scopedExpression.getExpression() instanceof Identifier) {
        MethodInvocation methodInvocation = createNode(context, MethodInvocation.class);
        methodInvocation.setScope(scopedExpression.getScope());
        methodInvocation.setName((Identifier) scopedExpression.getExpression());
        invocation = methodInvocation;
      }
    }

    if (invocation == null) {
      GeneralInvocation generalInvocation = createNode(context, GeneralInvocation.class);
      if (expression instanceof ScopedExpression) {
        ScopedExpression scopedExpression = (ScopedExpression) expression;
        generalInvocation.setScope(scopedExpression.getScope());
        generalInvocation.setExpression(scopedExpression.getExpression());
        invocation = generalInvocation;
      } else {
        generalInvocation.setExpression(expression);
      }
      invocation = generalInvocation;
    }

    ExpressionListContext expressionListContext = getChild(context, ExpressionListContext.class);
    if (expressionListContext != null) {
      invocation.setArguments(getAdapter(ExpressionListAdapter.class).adapt(expressionListContext));
    }

    return invocation;
  }
View Full Code Here

TOP

Related Classes of com.bacoder.parser.java.api.Invocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.