Package dk.brics.automaton

Examples of dk.brics.automaton.RegExp.toAutomaton()


    private RunAutomaton runauto = null;
   
    public CompiledAutomaton( String rhsPattern ) {
        RegExp regexpr = new dk.brics.automaton.RegExp(rhsPattern);
        Automaton auto = regexpr.toAutomaton();
        this.runauto = new RunAutomaton(auto, true);
    }
   
    @Override
    public boolean match(String lhs, String rhs) {
View Full Code Here


    private RunAutomaton runauto = null;
   
    public CompiledAutomaton( String rhsPattern ) {
        RegExp regexpr = new dk.brics.automaton.RegExp(rhsPattern, RegExp.NONE);
        Automaton auto = regexpr.toAutomaton();
        this.runauto = new RunAutomaton(auto, true);
    }
   
    @Override
    public boolean match(String lhs, String rhs) {
View Full Code Here

    public static void main(String[] args) {
        boolean isLength = args[0].equals("length");
        RegExp r = new RegExp(args[1]);
        String prefix = args[2];
        int length=0;
        Automaton a = r.toAutomaton();
//        System.out.println(a.toDot());
        if (!isLength) {
            length = Integer.parseInt(args[3])-1;
            if (length==-1) {
                if (a.getInitialState().isAccept()) {
View Full Code Here

  /**
   * Builds the transition table data.
   */
  public void build() {
    RegExp regexp = new RegExp(this.expression);
    Automaton automata = regexp.toAutomaton(true);
    numOfStates = automata.getNumberOfStates();
    //System.out.println("Number of states " + numOfStates);
   
    State[] states = new State[numOfStates];
    automata.getStates().toArray(states);
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.