Package net.sourceforge.chaperon.model.pattern

Examples of net.sourceforge.chaperon.model.pattern.CharacterSet


      {
        if (characterclass.getCharacterClassElement(i) instanceof CharacterInterval)
          statecount++;
        else if (characterclass.getCharacterClassElement(i) instanceof CharacterSet)
        {
          CharacterSet set = (CharacterSet)characterclass.getCharacterClassElement(i);

          statecount += set.getCharacters().length();
        }
      }

      statecount++;
    }
View Full Code Here


          state = stateindex--;
          automaton.addTransition(firststate, state);
        }
        else if (element.getCharacterClassElement(i) instanceof CharacterSet)
        {
          CharacterSet set = (CharacterSet)element.getCharacterClassElement(i);
          String chars = set.getCharacters();

          for (int j = 0; j<chars.length(); j++)
          {
            automaton.setType(stateindex, PatternAutomaton.TYPE_MATCH);
            automaton.setInterval(stateindex, chars.charAt(j), chars.charAt(j));
            automaton.addTransition(stateindex, laststate);
            state = stateindex--;
            automaton.addTransition(firststate, state);
          }
        }
      }

      return firststate;
    }
    else
    {
      state = stateindex--;
      automaton.setType(state, PatternAutomaton.TYPE_MATCHANY);
      automaton.setTransitions(state, new int[]{laststate});
      for (int i = element.getCharacterClassElementCount()-1; i>=0; i--)
      {
        if (element.getCharacterClassElement(i) instanceof CharacterInterval)
        {
          CharacterInterval interval = (CharacterInterval)element.getCharacterClassElement(i);

          automaton.setType(stateindex, PatternAutomaton.TYPE_MATCH);
          automaton.setInterval(stateindex, interval.getMinimum(), interval.getMaximum());
          automaton.setTransitions(stateindex, new int[]{state});
          state = stateindex--;
        }
        else if (element.getCharacterClassElement(i) instanceof CharacterSet)
        {
          CharacterSet set = (CharacterSet)element.getCharacterClassElement(i);
          String chars = set.getCharacters();

          for (int j = 0; j<chars.length(); j++)
          {
            automaton.setType(stateindex, PatternAutomaton.TYPE_EXMATCH);
            automaton.setInterval(stateindex, chars.charAt(j), chars.charAt(j));
View Full Code Here

TOP

Related Classes of net.sourceforge.chaperon.model.pattern.CharacterSet

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.