Package org.eclipse.dltk.ast.expressions

Examples of org.eclipse.dltk.ast.expressions.CallArgumentsList


   * @param callExpression
   * @return path resolved from expression
   */
  private String resolvePHPCallExpression(PHPCallExpression callExpression) {
    if (callExpression.getCallName().getName().equals(DIRNAME_METHOD)) {
      CallArgumentsList argsList = callExpression.getArgs();
      for (ASTNode astNode : argsList.getChilds()) {
        if (astNode instanceof Scalar) {
          return resolveDirname(resolveScalarValue((Scalar) astNode));
        } else if (astNode instanceof PHPCallExpression) {
          return resolveDirname(resolvePHPCallExpression((PHPCallExpression) astNode));
        }
View Full Code Here


    if (node == null) {// define constant
      PHPCallExpression callExpression = DefineMethodUtils
          .getDefineNodeByField(module, field);
      if (callExpression != null) {
        CallArgumentsList args = callExpression.getArgs();
        if (args != null && args.getChilds() != null
            && args.getChilds().size() >= 2) {
          ASTNode argument = (ASTNode) args.getChilds().get(1);
          if (argument instanceof Scalar) {
            String value = ASTUtils.stripQuotes(((Scalar) argument)
                .getValue());
            return value;
          }
View Full Code Here

      visit((FieldDeclaration) constantDecl);

    } else {
      int argsCount = 0;
      CallArgumentsList args = call.getArgs();
      if (args != null && args.getChilds() != null) {
        argsCount = args.getChilds().size();
      }
      fRequestor.acceptMethodReference(call.getName(), argsCount, call
          .getCallName().sourceStart(), call.getCallName()
          .sourceEnd());
    }
View Full Code Here

      return result;
    }

    protected void checkElementDeclaration(PHPCallExpression s) {
      if (s.getName().equals(DEFINE)) {
        CallArgumentsList args = s.getArgs();
        if (args != null && args.getChilds() != null) {
          ASTNode argument = (ASTNode) args.getChilds().get(0);
          if (argument instanceof Scalar) {
            String constant = ASTUtils
                .stripQuotes(((Scalar) argument).getValue());
            if (constant.equals(elementName)) {
              int astStart = s.sourceStart();
View Full Code Here

      visit((FieldDeclaration) constantDecl);

    } else {
      int argsCount = 0;
      CallArgumentsList args = call.getArgs();
      if (args != null && args.getChilds() != null) {
        argsCount = args.getChilds().size();
      }

      modifyReference(
          call,
          new ReferenceInfo(IModelElement.METHOD, call.sourceStart(),
View Full Code Here

      Include include = (Include) node;
      if (include.getExpr() instanceof Scalar) {
        Scalar filePath = (Scalar) include.getExpr();
        CallExpression callExpression = new CallExpressionLocation(
            filePath.sourceStart(), filePath.sourceEnd(), null,
            "include", new CallArgumentsList()); //$NON-NLS-1$
        locator.match(callExpression, getNodeSet());
      }
    } else if (node instanceof Argument) {
      SimpleReference ref = ((Argument) node).getRef();
      FieldDeclaration decl = new FieldDeclarationLocation(ref.getName(),
View Full Code Here

   */
  public static FieldDeclaration getConstantDeclaration(
      CallExpression callExpression) {
    String name = callExpression.getName();
    if ("define".equalsIgnoreCase(name)) { //$NON-NLS-1$
      CallArgumentsList args = callExpression.getArgs();
      if (args != null && args.getChilds() != null) {
        ASTNode argument = (ASTNode) args.getChilds().get(0);
        if (argument instanceof Scalar) {
          String constant = ASTUtils.stripQuotes(((Scalar) argument)
              .getValue());
          FieldDeclaration fieldDeclaration = new FieldDeclaration(
              constant, argument.sourceStart(),
View Full Code Here

        if (!PHPTypeInferenceUtils.isSimple(result)) {
          return null;
        }
      }
      state = STATE_WAITING_METHOD;
      CallArgumentsList args = expression.getArgs();
      String[] argNames = null;
      if (args != null && args.getChilds() != null) {
        List<ASTNode> childs = args.getChilds();
        int i = 0;
        argNames = new String[childs.size()];
        for (ASTNode o : childs) {
          if (o instanceof Scalar) {
            Scalar arg = (Scalar) o;
View Full Code Here

    super(start, end);

    assert name != null;

    if (args == null) {
      args = new CallArgumentsList();
    }

    this.receiver = receiver;
    this.name = name;
    this.args = args;
View Full Code Here

    public boolean endvisit(PHPCallExpression s) throws Exception {

        if (!s.getName().startsWith("render"))
            return false;

        CallArgumentsList list = s.getArgs();

        if (list.getChilds().size() > 1) {

            if (list.getChilds().get(0) instanceof Scalar && list.getChilds().get(1) instanceof ArrayCreation) {

                Scalar scalar = (Scalar) list.getChilds().get(0);
                String viewPath = StringUtils.stripQuotes(scalar.getValue());
                ArrayCreation params = (ArrayCreation) list.getChilds().get(1);
                parseVariablesFromArray(params, viewPath);

            }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.ast.expressions.CallArgumentsList

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.