Examples of PatternAutomaton


Examples of net.sourceforge.chaperon.process.PatternAutomaton

      throw new IllegalArgumentException("Lexicon is not valid: "+violations.getViolation(0));

    LexicalAutomaton automaton = new LexicalAutomaton(lexicon.getLexemeCount());

    Lexeme lexeme;
    PatternAutomaton definition = null;

    for (int i = 0; i<lexicon.getLexemeCount(); i++)
    {
      lexeme = lexicon.getLexeme(i);
      automaton.setLexemeSymbol(i, (lexeme.getSymbol()!=null) ? lexeme.getSymbol().getName() : null);
View Full Code Here

Examples of net.sourceforge.chaperon.process.PatternAutomaton

    stateindex = statecount-1;

    groupcount = getGroupCount(pattern);
    groupindex = groupcount;

    PatternAutomaton automaton = new PatternAutomaton(statecount);

    automaton.setGroupCount(groupcount+1);

    int finalstate = stateindex--;

    automaton.setFinalState(finalstate);

    automaton.setType(stateindex, PatternAutomaton.TYPE_GROUPEND);
    automaton.setGroupIndex(stateindex, 0);
    automaton.setTransitions(stateindex, new int[]{finalstate});

    int state = stateindex--;

    state = traverse(automaton, pattern, state);

    automaton.setType(stateindex, PatternAutomaton.TYPE_GROUPSTART);
    automaton.setGroupIndex(stateindex, 0);
    automaton.setTransitions(stateindex, new int[]{state});

    automaton.setFirstState(stateindex);

    this.automaton = automaton;
  }
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.