Package eas.math.fundamentalAlgorithms.graphBased.algorithms.type0grammars

Examples of eas.math.fundamentalAlgorithms.graphBased.algorithms.type0grammars.Grammar.addRule()


        for (String fromState : reachableStates) {
            for (Transition targetTransition : this.getTransitionsFrom(fromState)) {
                String toState = targetTransition.getDestination();
                String symbol = targetTransition.getLabel();
               
                g.addRule(new Rule(
                        new Word(new Symbol[] {new Nonterminal(new StringBuffer(fromState))}),
                        new Word(new Symbol[] {
                                new Terminal(new StringBuffer(symbol)),
                                new Nonterminal(new StringBuffer(toState))})));
            }
View Full Code Here


                                new Terminal(new StringBuffer(symbol)),
                                new Nonterminal(new StringBuffer(toState))})));
            }
           
            if (this.finalStates.contains(fromState)) {
                g.addRule(new Rule(
                        new Word(new Symbol[] {new Nonterminal(new StringBuffer(fromState))}),
                        new Word(new Symbol[] {})));
            }
        }
       
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.