Examples of VariableDefinition


Examples of org.apache.flex.compiler.internal.definitions.VariableDefinition

        final DefinitionBase def;       
        kind &= ABCConstants.TRAIT_KIND_MASK;
        switch (kind)
        {
            case ABCConstants.KIND_SLOT:
                def = new VariableDefinition(definitionName, slot_value);
                break;
            case ABCConstants.KIND_CONST:
                if (slot_value instanceof Namespace)
                    def = NamespaceDefinition.createNamespaceDefinition(definitionName, (Namespace)slot_value);
                else
View Full Code Here

Examples of org.apache.flex.compiler.internal.definitions.VariableDefinition

    @Override
    void declareVariable(VariableNode var)
    {
        verifyVariableModifiers(var);

        VariableDefinition varDef = (VariableDefinition)var.getDefinition();

        boolean is_static = var.hasModifier(ASModifier.STATIC);
        boolean is_const =  SemanticUtils.isConst(var, classScope.getProject());
       
        final ICompilerProject project = this.classScope.getProject();
       
        ICodeGenerator codeGenerator = classScope.getGenerator();
        IExpressionNode assignedValueNode = var.getAssignedValueNode();
        IConstantValue constantValue = codeGenerator.generateConstantValue(assignedValueNode, project);

        //  initializer is null if no constant value
        //  can be generated, and null is the correct value for "no value."
        Object initializer = constantValue != null ? constantValue.getValue() : null;
       
        // Reducing the constant value may have produced problems in the
        // LexicalScope used for constant reduction. Transfer them over
        // to the LexicalScope for this class.
        Collection<ICompilerProblem> problems = constantValue != null ? constantValue.getProblems() : null;
        if (problems != null)
            classScope.addProblems(problems);
       
        final MethodBodySemanticChecker checker = new MethodBodySemanticChecker(this.classScope);
       
        DefinitionBase varType = (DefinitionBase)varDef.resolveType(project);
       
        Object transformed_initializer = null;
       
        if ((initializer != null) && (varType != null))
        {
View Full Code Here

Examples of org.apache.flex.compiler.internal.definitions.VariableDefinition

        // If we see a tag like <s:Button id="b">, add a VariableDefinition
        // to the class scope, corresponding to the ActionScript code
        //    [Bindable]
        //    public var b:spark.components:Button;
        VariableDefinition variableDefinition = new VariableDefinition(id);
        variableDefinition.setPublic();
        variableDefinition.setTypeReference(typeRef);
        variableDefinition.setNameLocation(idAttribute.getValueStart(), idAttribute.getValueEnd());
        variableDefinition.setBindable();
        currentClassScope.addDefinition(variableDefinition);
    }
View Full Code Here

Examples of org.apache.flex.compiler.internal.definitions.VariableDefinition

        {
            // Add the arguments Array to the function scope
            // only do this if there is not already a local property, or parameter that is named arguments
            // and something in the function body references arguments - this should avoid creating the
            // definition when it's not needed.
            VariableDefinition argumentsDef = new VariableDefinition(IASLanguageConstants.arguments);
            argumentsDef.setNamespaceReference(NamespaceDefinition.getDefaultNamespaceDefinition(funcScope));
            argumentsDef.setTypeReference(ReferenceFactory.builtinReference(IASLanguageConstants.BuiltinType.ARRAY));

            argumentsDef.setImplicit();

            funcScope.addDefinition(argumentsDef);
        }
    }
View Full Code Here

Examples of org.zkoss.zuss.metainfo.VariableDefinition

      final char symbol = ((Symbol)t0).getValue();
      if (symbol == ':') { //variable definition
        final Expression expr = new Expression(t0.getLine());
          //note: expr is NOT a child of any node but part of VariableDefinition below
        parseExpression(ctx, expr, ';');
        new VariableDefinition(
          ctx.block.owner, name, expr, lineno);
        return;
      } else if (symbol == '{') { //mixin definition
        newBlock(ctx, new MixinDefinition(
          ctx.block.owner, name,
View Full Code Here

Examples of org.zkoss.zuss.metainfo.VariableDefinition

  }

  /** Generates definitions other than rules, styles and mixins. */
  private void outOther(Scope scope, List<String> outerSels, NodeInfo node) throws IOException {
    if (node instanceof VariableDefinition) {
      final VariableDefinition vdef = (VariableDefinition)node;
      scope.setVariable(vdef.getName(), evalDefinition(scope, vdef));
        //spec: evaluate when it is defined (not when it is used)
    } else if (node instanceof FunctionDefinition) {
      final FunctionDefinition fd = (FunctionDefinition)node;
      scope.setVariable(fd.getName(), fd);
    } else if (node instanceof MixinDefinition) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.