Package dtool.ast.definitions

Examples of dtool.ast.definitions.DefinitionVariable$DefinitionAutoVariable


   
    ASTCodePrinter cp = new ASTCodePrinter();
   
    switch (defUnit.getNodeType()) {
    case DEFINITION_VARIABLE: {
      DefinitionVariable var = (DefinitionVariable) defUnit;
     
      return typeRefToUIString(var.type) + " " + var.getName();
    }
    case DEFINITION_VAR_FRAGMENT: {
      DefVarFragment fragment = (DefVarFragment) defUnit;
     
      return typeRefToUIString(fragment.getDeclaredType()) + " " + fragment.getName();
View Full Code Here


    if(isAutoRef) {
      return parse.resultConclude(
        new DefinitionAutoVariable(comments, defId, init, arrayView(fragments)));
    }
    return parse.resultConclude(
      new DefinitionVariable(comments, defId, ref, cstyleSuffix, init, arrayView(fragments)));
  }
View Full Code Here

    ParsedModule parseModule = DToolClient.getDefaultModuleCache().getParsedModuleOrNull(filePath);
    Module module = parseModule.module;
   
    DefUnit defUnit = MiscNodeUtils.getDefUniFromScope(module.getChildren(), "xxxTestUnboundRef");
    IModuleResolver mr = DToolClient.getDefault().getResolvedModule(filePath).getModuleResolver();
    DefinitionVariable defVar = assertInstance(defUnit, DefinitionVariable.class);
    assertTrue(defVar.type.findTargetDefElement(mr) == null);
  }
View Full Code Here

   
    ASTCodePrinter cp = new ASTCodePrinter();
   
    switch (defUnit.getNodeType()) {
    case DEFINITION_VARIABLE: {
      DefinitionVariable elem = (DefinitionVariable) defUnit;
      return elem.getName() + getTypeSegment(elem.type) + getDefUnitContainerSuffix(defUnit);
    }
    case DEFINITION_VAR_FRAGMENT: {
      DefVarFragment elem = (DefVarFragment) defUnit;
      Reference type = elem.getDeclaredType();
      return elem.getName() + getTypeSegment(type) + getDefUnitContainerSuffix(defUnit);
    }
   
    case FUNCTION_PARAMETER: {
      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.DefinitionVariable$DefinitionAutoVariable

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.