Package dtool.ast.definitions

Examples of dtool.ast.definitions.DefinitionFunction


     
      return typeRefToUIString(fragment.getDeclaredType()) + " " + fragment.getName();
    }
   
    case DEFINITION_FUNCTION: {
      DefinitionFunction function = (DefinitionFunction) defUnit;
      cp.appendStrings(typeRefToUIString(function.retType), " ");
      cp.append(function.getName());
      cp.appendList("(", function.tplParams, ", ", ") ");
      cp.appendList("(", function.getParams_asNodes(), ", ", ") ");
      return cp.toString();
    }
   
    default: break;
    }
View Full Code Here


    if(isConstrutor) {
      return parse.resultConclude(new DefinitionConstructor(
        comments, defId, tplParams, fnParams, fnAttributes, tplConstraint, fnBody));
    }
   
    return parse.resultConclude(new DefinitionFunction(
      comments, retType, defId, tplParams, fnParams, fnAttributes, tplConstraint, fnBody));
  }
View Full Code Here

    INamedElement calleeElem = callee.findTargetDefElement(moduleResolver);
    if(calleeElem == null)
      return null;
   
    if (calleeElem instanceof DefinitionFunction) {
      DefinitionFunction defOpCallFunc = (DefinitionFunction) calleeElem;
      INamedElement calleeResult = defOpCallFunc.findReturnTypeTargetDefUnit(moduleResolver);
      return Collections.singleton(calleeResult);
    }
   
    Module moduleNode = null;
    if(calleeElem instanceof ASTNode) {
      ASTNode astNode = (ASTNode) calleeElem;
      moduleNode = astNode.getModuleNode();
    }
    if(moduleNode == null) {
      return null;
    }
   
    DefUnitSearch search = new DefUnitSearch("opCall", moduleNode, false, moduleResolver);
    calleeElem.resolveSearchInMembersScope(search);
   
    for (Iterator<INamedElement> iter = search.getMatchedElements().iterator(); iter.hasNext();) {
      INamedElement defOpCall = iter.next();
      if (defOpCall instanceof DefinitionFunction) {
        DefinitionFunction defOpCallFunc = (DefinitionFunction) defOpCall;
        INamedElement targetDefUnit = defOpCallFunc.findReturnTypeTargetDefUnit(moduleResolver);
        return Collections.singleton(targetDefUnit);
      }
    }
    return null;
  }
View Full Code Here

      NodeResult<StatementExpression> expResult = parseStatementExpression();
      assertTrue(expResult.node != null || decl == null); // any IncompleteDeclaration must be parsable as exp
      return expResult;
    } else if(declResult.ruleBroken && decl instanceof DefinitionFunction) {
     
      DefinitionFunction defFunction = (DefinitionFunction) decl;
      if(defFunction.fnBody == null && defFunction.tplConstraint == null && defFunction.fnAttributes == null) {
        ParserState defFunctionState = saveParserState();
       
        restoreOriginalState(originalState);
        NodeResult<StatementExpression> stExpResult = parseStatementExpression();
View Full Code Here

      FunctionParameter elem = (FunctionParameter) defUnit;
      return elem.getName() + getTypeSegment(elem.type) + getDefUnitContainerSuffix(defUnit);
    }
   
    case DEFINITION_FUNCTION: {
      DefinitionFunction elem = (DefinitionFunction) defUnit;
      cp.append(elem.getName());
      cp.appendList("(", elem.tplParams, ",", ") ");
      cp.append(elem.toStringParametersForSignature());
      cp.append(getTypeSegment(elem.retType));
      cp.append(getDefUnitContainerSuffix(defUnit));
      return cp.toString();
    }
   
    case DEFINITION_ALIAS_FRAGMENT: {
      DefinitionAliasFragment elem = (DefinitionAliasFragment) defUnit;
      return elem.getName() + getAliasSegment(elem.target) + getDefUnitContainerSuffix(defUnit);
    }
    case DEFINITION_ALIAS_VAR_DECL: {
      DefinitionAliasVarDecl elem = (DefinitionAliasVarDecl) defUnit;
      return elem.getName() + getAliasSegment(elem.target) + getDefUnitContainerSuffix(defUnit);
    }
    case DEFINITION_ALIAS_FUNCTION_DECL: {
      DefinitionAliasFunctionDecl elem = (DefinitionAliasFunctionDecl) defUnit;
      // TODO: print a proper alias segment
      return elem.getName() + getAliasSegment(elem.target) + getDefUnitContainerSuffix(defUnit);
    }
   
   
    default: break;
    }
View Full Code Here

TOP

Related Classes of dtool.ast.definitions.DefinitionFunction

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.