// Path: karthik/regex/RegexTokenNames.java
// enum RegexTokenNames {
// 
//     CHAR, CHAR_CLASS, WHITESPACE, DOT, DIGIT, WORD,
//     NONDIGIT, NONWORD, NONWHITESPACE,
//     TAB, NEWLINE, FORMFEED, CARR_RETURN,
//     BRACE, STAR, PLUS, QUESTION,
//     LAZY_BRACE, LAZY_STAR, LAZY_PLUS, LAZY_QUESTION,
//     OR, AND, EPSILON,
//     GROUP, LOOKAHEAD, LOOKBEHIND,
//     WORD_BOUNDARY, NON_WORD_BOUNDARY,
//     STRING_START, STRING_END, LINE_START, LINE_END, JAVA_Z_STRING_END,
//     BACKREFERENCE, ENDBACKREFERENCE, BACKREF_STRING
// }


import karthik.regex.RegexTokenNames;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
        Integer starting_num_states = getNumStates();
        Integer n2States = n2.getNumStates();
        contains_backref = contains_backref | n2.contains_backref;
        Integer oldStart = start;
        Integer oldFinish = finish;

        // clone matrix from TransitionTable n2 to new matrix
        expand_table(n2States + 2);
        for (Integer i = 0; i < n2States; i++)
            for (Integer j : n2.get_all_transitions(i)) {
                token = n2.getTransition(i, j);
                setTransition(starting_num_states + i, starting_num_states + j,
                    token);
            }

        start = getNumStates() - 2;
        finish = getNumStates() - 1;
        // set e-transitions for new start_index state
        setTransition(start, oldStart, eps);
        setTransition(start, n2.getStart() + starting_num_states, eps);

        // set e-transition to go to new finish state
        setTransition(oldFinish, finish, eps);
        setTransition(n2.getFinish() + starting_num_states, finish, eps);

        return this;
    }

    TransitionTable plus(Integer quantGroupID, Integer uniqueID) {
        // plus implemented as a+ = a.a*
// Path: karthik/regex/RegexTokenNames.java
// enum RegexTokenNames {
// 
//     CHAR, CHAR_CLASS, WHITESPACE, DOT, DIGIT, WORD,
//     NONDIGIT, NONWORD, NONWHITESPACE,
//     TAB, NEWLINE, FORMFEED, CARR_RETURN,
//     BRACE, STAR, PLUS, QUESTION,
//     LAZY_BRACE, LAZY_STAR, LAZY_PLUS, LAZY_QUESTION,
//     OR, AND, EPSILON,
//     GROUP, LOOKAHEAD, LOOKBEHIND,
//     WORD_BOUNDARY, NON_WORD_BOUNDARY,
//     STRING_START, STRING_END, LINE_START, LINE_END, JAVA_Z_STRING_END,
//     BACKREFERENCE, ENDBACKREFERENCE, BACKREF_STRING
// }


// Path: karthik/regex/TransitionTable.java
import karthik.regex.RegexTokenNames;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

        Integer starting_num_states = getNumStates();
        Integer n2States = n2.getNumStates();
        contains_backref = contains_backref | n2.contains_backref;
        Integer oldStart = start;
        Integer oldFinish = finish;

        // clone matrix from TransitionTable n2 to new matrix
        expand_table(n2States + 2);
        for (Integer i = 0; i < n2States; i++)
            for (Integer j : n2.get_all_transitions(i)) {
                token = n2.getTransition(i, j);
                setTransition(starting_num_states + i, starting_num_states + j,
                    token);
            }

        start = getNumStates() - 2;
        finish = getNumStates() - 1;
        // set e-transitions for new start_index state
        setTransition(start, oldStart, eps);
        setTransition(start, n2.getStart() + starting_num_states, eps);

        // set e-transition to go to new finish state
        setTransition(oldFinish, finish, eps);
        setTransition(n2.getFinish() + starting_num_states, finish, eps);

        return this;
    }

    TransitionTable plus(Integer quantGroupID, Integer uniqueID) {
        // plus implemented as a+ = a.a*
        RegexTokenNames tok_type = (uniqueID == Pattern.GREEDY_ID) ? RegexTokenNames.PLUS : RegexTokenNames.LAZY_PLUS;