Package dk.brics.string.grammar

Examples of dk.brics.string.grammar.UnitProduction


                            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;
                       
                        // only consider assertions
                        if (!up.getOperation().isAssertion())
                            continue;
                       
                        // if the destination node is also in a cycle
                        if (c.contains(up.getNonterminal())) {
                            removedProductions.add(prod);
                            addedProductions.add(new UnitProduction(up.getNonterminal()));
                        }
                    }
                }
                nt.getProductions().removeAll(removedProductions);
                nt.getProductions().addAll(addedProductions);
View Full Code Here

TOP

Related Classes of dk.brics.string.grammar.UnitProduction

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.