/** From label A build Graph o-A->o */ public StateCluster build_Atom(int label, GrammarAST associatedAST) { NFAState left = newState(); NFAState right = newState(); left.associatedASTNode = associatedAST; right.associatedASTNode = associatedAST; transitionBetweenStates(left, right, label); StateCluster g = new StateCluster(left, right); return g; }
/** From label A build Graph o-A->o */ public StateCluster build_Atom(int label, GrammarAST associatedAST) { NFAState left = newState(); NFAState right = newState(); left.associatedASTNode = associatedAST; right.associatedASTNode = associatedAST; transitionBetweenStates(left, right, label); StateCluster g = new StateCluster(left, right); return g; }
/** From label A build Graph o-A->o */ public StateCluster build_Atom(int label, GrammarAST associatedAST) { NFAState left = newState(); NFAState right = newState(); left.associatedASTNode = associatedAST; right.associatedASTNode = associatedAST; transitionBetweenStates(left, right, label); StateCluster g = new StateCluster(left, right); return g; }
/** From label A build Graph o-A->o */ public StateCluster build_Atom(int label, GrammarAST associatedAST) { NFAState left = newState(); NFAState right = newState(); left.associatedASTNode = associatedAST; right.associatedASTNode = associatedAST; transitionBetweenStates(left, right, label); StateCluster g = new StateCluster(left, right); return g; }
/** From a set ('a'|'b') build * * o->o-'a'..'b'->o->o (last NFAState is blockEndNFAState pointed to by all alts) */ public StateCluster build_AlternativeBlockFromSet(StateCluster set) { if ( set==null ) { return null; } // single alt, no decision, just return only alt state cluster NFAState startOfAlt = newState(); // must have this no matter what transitionBetweenStates(startOfAlt, set.left, Label.EPSILON); return new StateCluster(startOfAlt,set.right); }
/** From a set ('a'|'b') build * * o->o-'a'..'b'->o->o (last NFAState is blockEndNFAState pointed to by all alts) */ public StateCluster build_AlternativeBlockFromSet(StateCluster set) { if ( set==null ) { return null; } // single alt, no decision, just return only alt state cluster NFAState startOfAlt = newState(); // must have this no matter what transitionBetweenStates(startOfAlt, set.left, Label.EPSILON); return new StateCluster(startOfAlt,set.right); }
/** From a set ('a'|'b') build * * o->o-'a'..'b'->o->o (last NFAState is blockEndNFAState pointed to by all alts) */ public StateCluster build_AlternativeBlockFromSet(StateCluster set) { if ( set==null ) { return null; } // single alt, no decision, just return only alt state cluster NFAState startOfAlt = newState(); // must have this no matter what transitionBetweenStates(startOfAlt, set.left, Label.EPSILON); return new StateCluster(startOfAlt,set.right); }
/** From a set ('a'|'b') build * * o->o-'a'..'b'->o->o (last NFAState is blockEndNFAState pointed to by all alts) */ public StateCluster build_AlternativeBlockFromSet(StateCluster set) { if ( set==null ) { return null; } // single alt, no decision, just return only alt state cluster NFAState startOfAlt = newState(); // must have this no matter what transitionBetweenStates(startOfAlt, set.left, Label.EPSILON); return new StateCluster(startOfAlt,set.right); }
/** Build an atom with all possible values in its label */ public StateCluster build_Wildcard(GrammarAST associatedAST) { NFAState left = newState(); NFAState right = newState(); left.associatedASTNode = associatedAST; right.associatedASTNode = associatedAST; Label label = new Label(nfa.grammar.getTokenTypes()); // char or tokens Transition e = new Transition(label,right); left.addTransition(e); StateCluster g = new StateCluster(left, right); return g; }
/** Build what amounts to an epsilon transition with an action. * The action goes into NFA though it is ignored during analysis. * It slows things down a bit, but I must ignore predicates after * having seen an action (5-5-2008). */ public StateCluster build_Action(GrammarAST action) { NFAState left = newState(); NFAState right = newState(); Transition e = new Transition(new ActionLabel(action), right); left.addTransition(e); return new StateCluster(left, right); }
/** Build an atom with all possible values in its label */ public StateCluster build_Wildcard(GrammarAST associatedAST) { NFAState left = newState(); NFAState right = newState(); left.associatedASTNode = associatedAST; right.associatedASTNode = associatedAST; Label label = new Label(nfa.grammar.getTokenTypes()); // char or tokens Transition e = new Transition(label,right); left.addTransition(e); StateCluster g = new StateCluster(left, right); return g; }
/** Build what amounts to an epsilon transition with an action. * The action goes into NFA though it is ignored during analysis. * It slows things down a bit, but I must ignore predicates after * having seen an action (5-5-2008). */ public StateCluster build_Action(GrammarAST action) { NFAState left = newState(); NFAState right = newState(); Transition e = new Transition(new ActionLabel(action), right); left.addTransition(e); return new StateCluster(left, right); }
/** Build what amounts to an epsilon transition with an action. * The action goes into NFA though it is ignored during analysis. * It slows things down a bit, but I must ignore predicates after * having seen an action (5-5-2008). */ public StateCluster build_Action(GrammarAST action) { NFAState left = newState(); NFAState right = newState(); Transition e = new Transition(new ActionLabel(action), right); left.addTransition(e); return new StateCluster(left, right); }
/** Build an atom with all possible values in its label */ public StateCluster build_Wildcard(GrammarAST associatedAST) { NFAState left = newState(); NFAState right = newState(); left.associatedASTNode = associatedAST; right.associatedASTNode = associatedAST; Label label = new Label(nfa.grammar.getTokenTypes()); // char or tokens Transition e = new Transition(label,right); left.addTransition(e); StateCluster g = new StateCluster(left, right); return g; }
/** Build what amounts to an epsilon transition with an action. * The action goes into NFA though it is ignored during analysis. * It slows things down a bit, but I must ignore predicates after * having seen an action (5-5-2008). */ public StateCluster build_Action(GrammarAST action) { NFAState left = newState(); NFAState right = newState(); Transition e = new Transition(new ActionLabel(action), right); left.addTransition(e); return new StateCluster(left, right); }
/** Build an atom with all possible values in its label */ public StateCluster build_Wildcard(GrammarAST associatedAST) { NFAState left = newState(); NFAState right = newState(); left.associatedASTNode = associatedAST; right.associatedASTNode = associatedAST; Label label = new Label(nfa.grammar.getTokenTypes()); // char or tokens Transition e = new Transition(label,right); left.addTransition(e); StateCluster g = new StateCluster(left, right); return g; }