Package joust.optimisers.normalise

Examples of joust.optimisers.normalise.TreeNormalisingTranslator


        List<AJCTree> prospectiveRootNodes = List.nil();
        HashMap<AJCTree, Env<AttrContext>> environMap = new HashMap<AJCTree, Env<AttrContext>>();

        // Since it's stateless...
        final TreePreparationTranslator sanity = new TreePreparationTranslator();
        final TreeNormalisingTranslator normaliser = new TreeNormalisingTranslator();

        HashMap<MethodSymbol, AJCMethodDecl> prospectiveMethodTable = new HashMap<MethodSymbol, AJCMethodDecl>();

        InitialASTConverter.init();
        for (Pair<Env<AttrContext>, JCClassDecl> env : rootElements) {
            currentEnvironment = env.fst;
            JCClassDecl classTree = env.snd;
            log.trace("Input tree: {}", classTree);
            // Perform the sanity translations on the tree that are more convenient to do before the translation step...
            classTree.accept(sanity);
            log.trace("Prepared tree: {}", classTree);

            // Translate the tree to our tree representation...
            InitialASTConverter converter = new InitialASTConverter();
            classTree.accept(converter);

            AJCClassDecl translatedTree = (AJCClassDecl) converter.getResult();
            log.debug("Translated tree: {}", translatedTree);

            // Populate method and varsym tables.
            for (AJCMethodDecl defN : translatedTree.methods) {
                prospectiveMethodTable.put(defN.getTargetSymbol(), defN);
                log.debug("Method: {}", defN.getTargetSymbol());
            }

            // Normalise the tree.
            normaliser.visitTree(translatedTree);

            prospectiveRootNodes = prospectiveRootNodes.prepend(translatedTree);

            environMap.put(translatedTree, env.fst);
        }
View Full Code Here

TOP

Related Classes of joust.optimisers.normalise.TreeNormalisingTranslator

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.