Package org.apache.flex.compiler.tree.as

Examples of org.apache.flex.compiler.tree.as.IExpressionNode


        ModifiersSet modifiersSet = i.getModifiers();
        if (modifiersSet == null)
            return;

        ASModifier[] modifiers = modifiersSet.getAllModifiers();
        IExpressionNode site = i.getNameExpressionNode();
        for (ASModifier modifier : modifiers)
        {
            // final generates a different error for an interface
            if( modifier == ASModifier.FINAL || modifier == ASModifier.DYNAMIC)
            {
View Full Code Here


                    return null;
            }
            // Not a forward reference, but are we referencing ourselves from our own initializer?
            else
            {
                IExpressionNode initNode = this.getInitExpression();
                if (initNode != null)
                {
                    // We are looking up ourselves from inside our own initializer
                    // contains returns false if the start positions match, so just check that here
                    if (initNode.getAbsoluteStart() == fromNode.getAbsoluteStart() ||
                        initNode.contains(fromNode.getAbsoluteStart()))
                        return null;
                }
            }
        }
        return resolveValue(project);
View Full Code Here

            // A constructor cannot be static
            if( func.isStatic() )
                problems.add(new ConstructorIsStaticProblem(node));

            // A constructor cannot declare a return type, other than void.
            IExpressionNode returnTypeExpression = node.getReturnTypeNode();
            if (returnTypeExpression != null)
            {
                // We cannot check whether node.resolveReturnType() returns the definition
                // for the void type, because  the return type of a constructor is considered
                // to be the class of the object being constructed, rather than void.
View Full Code Here

    {
        ModifiersSet modifiersSet = f.getModifiers();
        if (modifiersSet == null)
            return;

        IExpressionNode site = f.getNameExpressionNode();
        if( modifiersSet.hasModifier(ASModifier.STATIC) )
        {
            if( modifiersSet.hasModifier(ASModifier.FINAL) )
            {
                classScope.addProblem(new FinalOutsideClassProblem(site) );
View Full Code Here

        ModifiersSet modifiersSet = v.getModifiers();
        if (modifiersSet == null)
            return;

        ASModifier[] modifiers = modifiersSet.getAllModifiers();
        IExpressionNode site = v.getNameExpressionNode();
        for (ASModifier modifier : modifiers)
        {
            if( modifier == ASModifier.NATIVE )
            {
                classScope.addProblem(new NativeVariableProblem(site));
View Full Code Here

        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;
View Full Code Here

        ITypeNode typeNode = this.getNode();
        IASNode site = typeNode;
        if (typeNode instanceof ClassNode)
        {
            ClassNode clsNode = (ClassNode)typeNode;
            IExpressionNode interfs[] = clsNode.getImplementedInterfaceNodes();
            site = interfs[i];
        }
        return site;
    }
View Full Code Here

    public Object resolveInitialValue(ICompilerProject project)
    {
        if (initValue != null)
            return initValue;

        IExpressionNode initExpr = getInitExpression();
        if (initExpr != null)
        {
            ICodeGenerator codeGenerator = CodeGeneratorManager.getCodeGenerator();
            IConstantValue constantValue = codeGenerator.generateConstantValue(initExpr, project);
            if (constantValue != null)
View Full Code Here

    private IExpressionNode initializer;

    protected IExpressionNode getInitExpression()
    {
        IExpressionNode init = null;
        if( hasInit() )
        {
            if( this.getVariableClassification() == VariableClassification.LOCAL )
            {
                IVariableNode n = getNodeIfExists();
View Full Code Here

            //  before it was set; if not, add it.
            if ( !this.localBindings.containsKey(var_name.getBaseName()) )
            {
                if ( var.getNode() instanceof BaseVariableNode )
                {
                    IExpressionNode name_node = ((BaseVariableNode)var.getNode()).getNameExpressionNode();
                    Binding var_binding = getBinding(name_node, var_name, var_def);
                    this.localBindings.put(var_name.getBaseName(), var_binding);
                    var_binding.setIsLocal(true);
                }
                else
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.tree.as.IExpressionNode

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.