Examples of BinaryProduction


Examples of dk.brics.string.grammar.BinaryProduction

            for (Nonterminal nt : c.getNodes()) {
                List<Production> removedProductions = new LinkedList<Production>();
                List<Production> addedProductions = new LinkedList<Production>();
                for (Production prod : nt.getProductions()) {
                    if (prod instanceof BinaryProduction) {
                        BinaryProduction bp = (BinaryProduction)prod;
                       
                        // only consider assertions
                        if (!bp.getOperation().isAssertion())
                            continue;
                       
                        // if the destination node is also in a cycle
                        if (c.contains(bp.getNonterminal1()) || c.contains(bp.getNonterminal2())) {
                            removedProductions.add(prod);
                            addedProductions.add(new UnitProduction(bp.getNonterminal1()));
                        }
                    }
                    else if (prod instanceof UnaryProduction) {
                        UnaryProduction up = (UnaryProduction)prod;
                       
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.