Package flex2.compiler.mxml.rep

Examples of flex2.compiler.mxml.rep.Primitive


    private void processPrimitiveEntry(Node node)
    {
        Type type = nodeTypeResolver.resolveType(node, document);

        Primitive primitive = initPrimitiveValue(type, node);

        CDATANode cdata = null;
        if (node instanceof CDATANode)
            cdata = (CDATANode)node;
        else
            cdata = getTextContent(node.getChildren(), false);

        if (cdata != null)
        {
            processTextInitializer(cdata.image, type, cdata.inCDATA, cdata.beginLine);
        }
        else
        {
            //  NOTE: our scanner gives us identical representations for <tag/> and <tag></tag>. Here is one place where
            //  that's suboptimal for usability. TODO worth doing something about?
            if (!topLevel)
            {
                if (typeTable.stringType.isAssignableTo(type))
                {
                    processTextInitializer("", type, true, node.beginLine);
                }
                else
                {
                    log(node.beginLine, new InitializerRequired());
                }
            }
        }

        processStateAttributes(node, primitive);

        String id = (String)getLanguageAttributeValue(node, StandardDefs.PROP_ID);
        if (id != null || topLevel || primitive.isDeclarationEnsured())
        {
            if (primitive.getValue() != null)
            {
                if(node.comment == null)
                {
                    node.comment = "";
                }

                // if generate ast if false, lets not scan the tokens here because they will be scanned later in asc scanner.
                // we will go the velocity template route
                if(!mxmlConfiguration.getGenerateAbstractSyntaxTree())
                {
                    primitive.comment = node.comment;
                }
                else
                {
                    primitive.comment = MxmlCommentUtil.commentToXmlComment(node.comment);  
                }                   
               
                registerModel(id, primitive, topLevel);
            }
            else
            {
                //  Note: primitives are currently the only kind of MXML tag that can be declared without initializing.
                //  TODO still, we should generalize 'register' to include uninitialized declarations
                boolean autogenerated = false;
                if (id == null)
                {
                    //  anon id has been generated
                    autogenerated = true;
                    id = primitive.getId();
                }

                String tempComment = null;
               
                if(node.comment == null)
                {
                    node.comment = "";
                }

                // if generate ast if false, lets not scan the tokens here because they will be scanned later in asc scanner.
                // we will go the velocity template route
                if(!mxmlConfiguration.getGenerateAbstractSyntaxTree())
                {
                    tempComment = node.comment;
                }
                else
                {
                    tempComment = MxmlCommentUtil.commentToXmlComment(node.comment);  
                }                   
               
                document.addDeclaration(id, type.getName(), node.beginLine, true, topLevel, autogenerated, primitive.getBindabilityEnsured(), tempComment);
            }
        }
    }
View Full Code Here


    /**
     *
     */
    private Primitive initPrimitiveValue(Type type, Node node)
    {
        Primitive primitive = new Primitive(document, type, parent, node.beginLine);
        primitive.setInspectable(true);
        if (property != null)
        {
            primitive.setParentIndex(property.getName(), property.getStateName());
        }
        value = primitive;
        return primitive;
    }
View Full Code Here

        output = null;
        directory = null;
        mimeMappings = new MimeMappings();
        meter = null;
        resolver = null;
        cc = new CompilerControl();

        //data = null;
        cacheName = null;
        configurationReport = null;
        messages = new ArrayList<Message>();
View Full Code Here

        logger = null;
        output = null;
        mimeMappings = new MimeMappings();
        meter = null;
        resolver = null;
        cc = new CompilerControl();
        //isGeneratedTargetFile = false;

        //data = null;
        cacheName = null;
        configurationReport = null;
View Full Code Here

                        level = Message.ERROR;
                    else if (cps.equals(CompilerProblemSeverity.WARNING))
                        level = Message.WARNING;
                    else
                        break; // skip if IGNORE?
                    CompilerMessage msg = new CompilerMessage(level,
                                                    prob.getSourcePath(),
                                                    prob.getLine() + 1,
                                                    prob.getColumn());
                    try
                    {
                        String errText = (String) aClass.getField("DESCRIPTION").get(aClass);
                        while (errText.contains("${"))
                        {
                            int start = errText.indexOf("${");
                            int end = errText.indexOf("}", start);
                            String token = errText.substring(start + 2, end);
                            String value = (String) aClass.getField(token).get(prob);
                            token = "${" + token + "}";
                            errText = errText.replace(token, value);
                        }
                        msg.setMessage(errText);
                    }
                    catch (IllegalArgumentException e1)
                    {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
View Full Code Here

                        level = Message.ERROR;
                    else if (cps.equals(CompilerProblemSeverity.WARNING))
                        level = Message.WARNING;
                    else
                        break; // skip if IGNORE?
                    CompilerMessage msg = new CompilerMessage(level,
                                                    prob.getSourcePath(),
                                                    prob.getLine() + 1,
                                                    prob.getColumn());
                    try
                    {
                        String errText = (String) aClass.getField("DESCRIPTION").get(aClass);
                        while (errText.contains("${"))
                        {
                            int start = errText.indexOf("${");
                            int end = errText.indexOf("}", start);
                            String token = errText.substring(start + 2, end);
                            String value = (String) aClass.getField(token).get(prob);
                            token = "${" + token + "}";
                            errText = errText.replace(token, value);
                        }
                        msg.setMessage(errText);
                    }
                    catch (IllegalArgumentException e1)
                    {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
View Full Code Here

        oemConfiguration = null;
        logger = null;
        output = null;
        directory = null;
        mimeMappings = new MimeMappings();
        meter = null;
        resolver = null;
        cc = new CompilerControl();

        //data = null;
View Full Code Here

            this.files.add(files[i]);
        }
        oemConfiguration = null;
        logger = null;
        output = null;
        mimeMappings = new MimeMappings();
        meter = null;
        resolver = null;
        cc = new CompilerControl();
        //isGeneratedTargetFile = false;
View Full Code Here

                }
            }
           
        }
        ISWF swf = mxmlc.getSWFTarget();
        movie = new SimpleMovie(null);
        org.apache.flex.swf.types.Rect r = swf.getFrameSize();
        flash.swf.types.Rect fr = new flash.swf.types.Rect();
        fr.xMin = r.xMin();
        fr.yMin = r.yMin();
        fr.xMax = r.xMax();
View Full Code Here

          }
          else
          {
              if (verbose)
                System.out.println("new application");
              job = new AppJob(new Application(mainAppFile));
              apps.put(key, job);
          }
            job.app.setProgressMeter(progress);
             
            //compilations one at the time on the same project
View Full Code Here

TOP

Related Classes of flex2.compiler.mxml.rep.Primitive

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.