/* Generated By:JavaCC: Do not edit this line. DBPCDTokenManager.java */ package org.biolegato.database ; import java.awt.image.BufferedImage ; import java.io.File ; import java.io.Reader ; import java.io.FileReader ; import java.io.FileInputStream ; import java.io.IOException ; import java.io.InputStreamReader ; import java.io.BufferedReader ; import java.sql.Connection ; import java.sql.DriverManager ; import java.util.Set ; import java.util.Map ; import java.util.List ; import java.util.HashSet ; import java.util.HashMap ; import java.util.ArrayList ; import java.util.Collection ; import java.util.Collections ; import java.util.LinkedList ; import java.util.LinkedHashMap ; import javax.swing.Action ; import javax.swing.BoxLayout ; import javax.swing.JButton ; import javax.swing.JFrame ; import javax.swing.JMenu ; import javax.swing.JList ; import javax.swing.JPanel ; import javax.swing.JSlider ; import javax.swing.JTabbedPane ; import javax.swing.JTextField ; import javax.swing.JMenuItem ; import javax.swing.ImageIcon ; import javax.imageio.ImageIO ; import org.biopcd.sql.* ; import org.biopcd.widgets.* ; import org.biolegato.database.fields.*; /** Token Manager. */ public class DBPCDTokenManager implements DBPCDConstants { /** * Stores the current indentation scope */ private int indent = 0 ; /** * Used to store the size of an indent in spaces * This is necessary for calculations within the Java program */ public static final int INDENT_SIZE = 4 ; /** * Returns the current indentation level ** * @return the current indentation level */ public int getIndent() { return indent; } /** Debug output. */ public java.io.PrintStream debugStream = System.out; /** Set debug output. */ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } private final int jjStopStringLiteralDfa_0(int pos, long active0) { switch (pos) { case 0: if ((active0 & 0x3fffeL) != 0L) { jjmatchedKind = 21; return 8; } return -1; case 1: if ((active0 & 0x3fffeL) != 0L) { jjmatchedKind = 21; jjmatchedPos = 1; return 8; } return -1; case 2: if ((active0 & 0x6418L) != 0L) return 8; if ((active0 & 0x39be6L) != 0L) { jjmatchedKind = 21; jjmatchedPos = 2; return 8; } return -1; case 3: if ((active0 & 0x30984L) != 0L) return 8; if ((active0 & 0x9262L) != 0L) { if (jjmatchedPos != 3) { jjmatchedKind = 21; jjmatchedPos = 3; } return 8; } return -1; case 4: if ((active0 & 0x9022L) != 0L) return 8; if ((active0 & 0x20240L) != 0L) { jjmatchedKind = 21; jjmatchedPos = 4; return 8; } return -1; case 5: if ((active0 & 0x240L) != 0L) return 8; if ((active0 & 0x20000L) != 0L) { jjmatchedKind = 21; jjmatchedPos = 5; return 8; } return -1; default : return -1; } } private final int jjStartNfa_0(int pos, long active0) { return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); } private int jjStopAtPos(int pos, int kind) { jjmatchedKind = kind; jjmatchedPos = pos; return pos + 1; } private int jjMoveStringLiteralDfa0_0() { switch(curChar) { case 66: case 98: return jjMoveStringLiteralDfa1_0(0xc0L); case 69: case 101: return jjMoveStringLiteralDfa1_0(0x800L); case 70: case 102: return jjMoveStringLiteralDfa1_0(0x22L); case 73: case 105: return jjMoveStringLiteralDfa1_0(0x8L); case 75: case 107: return jjMoveStringLiteralDfa1_0(0x400L); case 76: case 108: return jjMoveStringLiteralDfa1_0(0x1000L); case 77: case 109: return jjMoveStringLiteralDfa1_0(0x6000L); case 78: case 110: return jjMoveStringLiteralDfa1_0(0x30000L); case 82: case 114: return jjMoveStringLiteralDfa1_0(0x10L); case 83: case 115: return jjMoveStringLiteralDfa1_0(0x200L); case 84: case 116: return jjMoveStringLiteralDfa1_0(0x8104L); default : return jjMoveNfa_0(0, 0); } } private int jjMoveStringLiteralDfa1_0(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(0, active0); return 1; } switch(curChar) { case 65: case 97: return jjMoveStringLiteralDfa2_0(active0, 0x3d002L); case 67: case 99: return jjMoveStringLiteralDfa2_0(active0, 0x200L); case 69: case 101: return jjMoveStringLiteralDfa2_0(active0, 0x510L); case 73: case 105: return jjMoveStringLiteralDfa2_0(active0, 0x2000L); case 76: case 108: return jjMoveStringLiteralDfa2_0(active0, 0x20L); case 78: case 110: return jjMoveStringLiteralDfa2_0(active0, 0x8L); case 79: case 111: return jjMoveStringLiteralDfa2_0(active0, 0x80L); case 82: case 114: return jjMoveStringLiteralDfa2_0(active0, 0x4L); case 85: case 117: return jjMoveStringLiteralDfa2_0(active0, 0x40L); case 88: case 120: return jjMoveStringLiteralDfa2_0(active0, 0x800L); default : break; } return jjStartNfa_0(0, active0); } private int jjMoveStringLiteralDfa2_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(0, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(1, active0); return 2; } switch(curChar) { case 66: case 98: return jjMoveStringLiteralDfa3_0(active0, 0x9000L); case 69: case 101: return jjMoveStringLiteralDfa3_0(active0, 0x800L); case 70: case 102: if ((active0 & 0x10L) != 0L) return jjStartNfaWithStates_0(2, 4, 8); break; case 72: case 104: return jjMoveStringLiteralDfa3_0(active0, 0x200L); case 76: case 108: return jjMoveStringLiteralDfa3_0(active0, 0x2L); case 77: case 109: return jjMoveStringLiteralDfa3_0(active0, 0x30000L); case 78: case 110: if ((active0 & 0x2000L) != 0L) return jjStartNfaWithStates_0(2, 13, 8); break; case 79: case 111: return jjMoveStringLiteralDfa3_0(active0, 0xa0L); case 84: case 116: if ((active0 & 0x8L) != 0L) return jjStartNfaWithStates_0(2, 3, 8); return jjMoveStringLiteralDfa3_0(active0, 0x40L); case 85: case 117: return jjMoveStringLiteralDfa3_0(active0, 0x4L); case 88: case 120: if ((active0 & 0x4000L) != 0L) return jjStartNfaWithStates_0(2, 14, 8); return jjMoveStringLiteralDfa3_0(active0, 0x100L); case 89: case 121: if ((active0 & 0x400L) != 0L) return jjStartNfaWithStates_0(2, 10, 8); break; default : break; } return jjStartNfa_0(1, active0); } private int jjMoveStringLiteralDfa3_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(1, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(2, active0); return 3; } switch(curChar) { case 65: case 97: return jjMoveStringLiteralDfa4_0(active0, 0x20L); case 67: case 99: if ((active0 & 0x800L) != 0L) return jjStartNfaWithStates_0(3, 11, 8); break; case 69: case 101: if ((active0 & 0x4L) != 0L) return jjStartNfaWithStates_0(3, 2, 8); else if ((active0 & 0x10000L) != 0L) { jjmatchedKind = 16; jjmatchedPos = 3; } return jjMoveStringLiteralDfa4_0(active0, 0x21200L); case 76: case 108: if ((active0 & 0x80L) != 0L) return jjStartNfaWithStates_0(3, 7, 8); return jjMoveStringLiteralDfa4_0(active0, 0x8000L); case 83: case 115: return jjMoveStringLiteralDfa4_0(active0, 0x2L); case 84: case 116: if ((active0 & 0x100L) != 0L) return jjStartNfaWithStates_0(3, 8, 8); return jjMoveStringLiteralDfa4_0(active0, 0x40L); default : break; } return jjStartNfa_0(2, active0); } private int jjMoveStringLiteralDfa4_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(2, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(3, active0); return 4; } switch(curChar) { case 67: case 99: return jjMoveStringLiteralDfa5_0(active0, 0x20000L); case 69: case 101: if ((active0 & 0x2L) != 0L) return jjStartNfaWithStates_0(4, 1, 8); else if ((active0 & 0x8000L) != 0L) return jjStartNfaWithStates_0(4, 15, 8); break; case 76: case 108: if ((active0 & 0x1000L) != 0L) return jjStartNfaWithStates_0(4, 12, 8); break; case 77: case 109: return jjMoveStringLiteralDfa5_0(active0, 0x200L); case 79: case 111: return jjMoveStringLiteralDfa5_0(active0, 0x40L); case 84: case 116: if ((active0 & 0x20L) != 0L) return jjStartNfaWithStates_0(4, 5, 8); break; default : break; } return jjStartNfa_0(3, active0); } private int jjMoveStringLiteralDfa5_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(3, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(4, active0); return 5; } switch(curChar) { case 65: case 97: if ((active0 & 0x200L) != 0L) return jjStartNfaWithStates_0(5, 9, 8); break; case 78: case 110: if ((active0 & 0x40L) != 0L) return jjStartNfaWithStates_0(5, 6, 8); break; case 79: case 111: return jjMoveStringLiteralDfa6_0(active0, 0x20000L); default : break; } return jjStartNfa_0(4, active0); } private int jjMoveStringLiteralDfa6_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(4, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_0(5, active0); return 6; } switch(curChar) { case 76: case 108: if ((active0 & 0x20000L) != 0L) return jjStartNfaWithStates_0(6, 17, 8); break; default : break; } return jjStartNfa_0(5, active0); } private int jjStartNfaWithStates_0(int pos, int kind, int state) { jjmatchedKind = kind; jjmatchedPos = pos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return pos + 1; } return jjMoveNfa_0(state, pos + 1); } static final long[] jjbitVec0 = { 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL }; private int jjMoveNfa_0(int startState, int curPos) { int startsAt = 0; jjnewStateCnt = 31; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; do { switch(jjstateSet[--i]) { case 0: if ((0x3ff000000000000L & l) != 0L) { if (kind > 20) kind = 20; jjCheckNAddStates(0, 4); } else if ((0x2400L & l) != 0L) { if (kind > 25) kind = 25; } else if (curChar == 32) { if (kind > 29) kind = 29; jjAddStates(5, 6); } else if (curChar == 35) jjCheckNAddTwoStates(19, 20); else if (curChar == 45) jjCheckNAddStates(7, 10); else if (curChar == 9) { if (kind > 27) kind = 27; } else if (curChar == 46) jjCheckNAdd(6); else if (curChar == 34) jjCheckNAddStates(11, 13); if (curChar == 13) jjAddStates(14, 15); break; case 1: if ((0xfffffffbffffffffL & l) != 0L) jjCheckNAddStates(11, 13); break; case 2: if (curChar == 34) jjCheckNAddStates(11, 13); break; case 3: if (curChar == 34) jjstateSet[jjnewStateCnt++] = 2; break; case 4: if (curChar == 34 && kind > 18) kind = 18; break; case 5: if (curChar == 46) jjCheckNAdd(6); break; case 6: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAdd(6); break; case 8: if ((0x3ff400000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjstateSet[jjnewStateCnt++] = 8; break; case 9: if (curChar == 9 && kind > 27) kind = 27; break; case 10: if (curChar == 45) jjCheckNAddStates(7, 10); break; case 11: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(11, 12); break; case 12: if (curChar == 46 && kind > 19) kind = 19; break; case 13: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(13, 14); break; case 14: if (curChar == 46) jjCheckNAdd(15); break; case 15: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAdd(15); break; case 16: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAdd(16); break; case 17: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAddStates(0, 4); break; case 18: if (curChar == 35) jjCheckNAddTwoStates(19, 20); break; case 19: if ((0xffffffffffffdbffL & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAdd(19); break; case 20: if ((0xffffffffffffdbffL & l) == 0L) break; if (kind > 26) kind = 26; jjCheckNAdd(20); break; case 21: if (curChar == 13) jjAddStates(14, 15); break; case 22: if (curChar == 10 && kind > 25) kind = 25; break; case 23: if (curChar == 10 && kind > 34) kind = 34; break; case 24: if ((0x2400L & l) != 0L && kind > 25) kind = 25; break; case 25: if (curChar != 32) break; if (kind > 29) kind = 29; jjAddStates(5, 6); break; case 26: if (curChar == 32) jjstateSet[jjnewStateCnt++] = 27; break; case 27: if (curChar == 32) jjstateSet[jjnewStateCnt++] = 28; break; case 28: if (curChar == 32 && kind > 28) kind = 28; break; case 29: if (curChar != 32) break; if (kind > 29) kind = 29; jjstateSet[jjnewStateCnt++] = 30; break; case 30: if (curChar == 32 && kind > 29) kind = 29; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); do { switch(jjstateSet[--i]) { case 0: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAdd(8); break; case 1: jjAddStates(11, 13); break; case 8: if ((0x7fffffe87fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAdd(8); break; case 19: if (kind > 23) kind = 23; jjstateSet[jjnewStateCnt++] = 19; break; case 20: if (kind > 26) kind = 26; jjstateSet[jjnewStateCnt++] = 20; break; default : break; } } while(i != startsAt); } else { int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); do { switch(jjstateSet[--i]) { case 1: if ((jjbitVec0[i2] & l2) != 0L) jjAddStates(11, 13); break; case 19: if ((jjbitVec0[i2] & l2) == 0L) break; if (kind > 23) kind = 23; jjstateSet[jjnewStateCnt++] = 19; break; case 20: if ((jjbitVec0[i2] & l2) == 0L) break; if (kind > 26) kind = 26; jjstateSet[jjnewStateCnt++] = 20; break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } private final int jjStopStringLiteralDfa_1(int pos, long active0) { switch (pos) { case 0: if ((active0 & 0x3fffeL) != 0L) { jjmatchedKind = 21; return 8; } return -1; case 1: if ((active0 & 0x3fffeL) != 0L) { jjmatchedKind = 21; jjmatchedPos = 1; return 8; } return -1; case 2: if ((active0 & 0x6418L) != 0L) return 8; if ((active0 & 0x39be6L) != 0L) { jjmatchedKind = 21; jjmatchedPos = 2; return 8; } return -1; case 3: if ((active0 & 0x30984L) != 0L) return 8; if ((active0 & 0x9262L) != 0L) { if (jjmatchedPos != 3) { jjmatchedKind = 21; jjmatchedPos = 3; } return 8; } return -1; case 4: if ((active0 & 0x9022L) != 0L) return 8; if ((active0 & 0x20240L) != 0L) { jjmatchedKind = 21; jjmatchedPos = 4; return 8; } return -1; case 5: if ((active0 & 0x240L) != 0L) return 8; if ((active0 & 0x20000L) != 0L) { jjmatchedKind = 21; jjmatchedPos = 5; return 8; } return -1; default : return -1; } } private final int jjStartNfa_1(int pos, long active0) { return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1); } private int jjMoveStringLiteralDfa0_1() { switch(curChar) { case 66: case 98: return jjMoveStringLiteralDfa1_1(0xc0L); case 69: case 101: return jjMoveStringLiteralDfa1_1(0x800L); case 70: case 102: return jjMoveStringLiteralDfa1_1(0x22L); case 73: case 105: return jjMoveStringLiteralDfa1_1(0x8L); case 75: case 107: return jjMoveStringLiteralDfa1_1(0x400L); case 76: case 108: return jjMoveStringLiteralDfa1_1(0x1000L); case 77: case 109: return jjMoveStringLiteralDfa1_1(0x6000L); case 78: case 110: return jjMoveStringLiteralDfa1_1(0x30000L); case 82: case 114: return jjMoveStringLiteralDfa1_1(0x10L); case 83: case 115: return jjMoveStringLiteralDfa1_1(0x200L); case 84: case 116: return jjMoveStringLiteralDfa1_1(0x8104L); default : return jjMoveNfa_1(0, 0); } } private int jjMoveStringLiteralDfa1_1(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(0, active0); return 1; } switch(curChar) { case 65: case 97: return jjMoveStringLiteralDfa2_1(active0, 0x3d002L); case 67: case 99: return jjMoveStringLiteralDfa2_1(active0, 0x200L); case 69: case 101: return jjMoveStringLiteralDfa2_1(active0, 0x510L); case 73: case 105: return jjMoveStringLiteralDfa2_1(active0, 0x2000L); case 76: case 108: return jjMoveStringLiteralDfa2_1(active0, 0x20L); case 78: case 110: return jjMoveStringLiteralDfa2_1(active0, 0x8L); case 79: case 111: return jjMoveStringLiteralDfa2_1(active0, 0x80L); case 82: case 114: return jjMoveStringLiteralDfa2_1(active0, 0x4L); case 85: case 117: return jjMoveStringLiteralDfa2_1(active0, 0x40L); case 88: case 120: return jjMoveStringLiteralDfa2_1(active0, 0x800L); default : break; } return jjStartNfa_1(0, active0); } private int jjMoveStringLiteralDfa2_1(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_1(0, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(1, active0); return 2; } switch(curChar) { case 66: case 98: return jjMoveStringLiteralDfa3_1(active0, 0x9000L); case 69: case 101: return jjMoveStringLiteralDfa3_1(active0, 0x800L); case 70: case 102: if ((active0 & 0x10L) != 0L) return jjStartNfaWithStates_1(2, 4, 8); break; case 72: case 104: return jjMoveStringLiteralDfa3_1(active0, 0x200L); case 76: case 108: return jjMoveStringLiteralDfa3_1(active0, 0x2L); case 77: case 109: return jjMoveStringLiteralDfa3_1(active0, 0x30000L); case 78: case 110: if ((active0 & 0x2000L) != 0L) return jjStartNfaWithStates_1(2, 13, 8); break; case 79: case 111: return jjMoveStringLiteralDfa3_1(active0, 0xa0L); case 84: case 116: if ((active0 & 0x8L) != 0L) return jjStartNfaWithStates_1(2, 3, 8); return jjMoveStringLiteralDfa3_1(active0, 0x40L); case 85: case 117: return jjMoveStringLiteralDfa3_1(active0, 0x4L); case 88: case 120: if ((active0 & 0x4000L) != 0L) return jjStartNfaWithStates_1(2, 14, 8); return jjMoveStringLiteralDfa3_1(active0, 0x100L); case 89: case 121: if ((active0 & 0x400L) != 0L) return jjStartNfaWithStates_1(2, 10, 8); break; default : break; } return jjStartNfa_1(1, active0); } private int jjMoveStringLiteralDfa3_1(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_1(1, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(2, active0); return 3; } switch(curChar) { case 65: case 97: return jjMoveStringLiteralDfa4_1(active0, 0x20L); case 67: case 99: if ((active0 & 0x800L) != 0L) return jjStartNfaWithStates_1(3, 11, 8); break; case 69: case 101: if ((active0 & 0x4L) != 0L) return jjStartNfaWithStates_1(3, 2, 8); else if ((active0 & 0x10000L) != 0L) { jjmatchedKind = 16; jjmatchedPos = 3; } return jjMoveStringLiteralDfa4_1(active0, 0x21200L); case 76: case 108: if ((active0 & 0x80L) != 0L) return jjStartNfaWithStates_1(3, 7, 8); return jjMoveStringLiteralDfa4_1(active0, 0x8000L); case 83: case 115: return jjMoveStringLiteralDfa4_1(active0, 0x2L); case 84: case 116: if ((active0 & 0x100L) != 0L) return jjStartNfaWithStates_1(3, 8, 8); return jjMoveStringLiteralDfa4_1(active0, 0x40L); default : break; } return jjStartNfa_1(2, active0); } private int jjMoveStringLiteralDfa4_1(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_1(2, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(3, active0); return 4; } switch(curChar) { case 67: case 99: return jjMoveStringLiteralDfa5_1(active0, 0x20000L); case 69: case 101: if ((active0 & 0x2L) != 0L) return jjStartNfaWithStates_1(4, 1, 8); else if ((active0 & 0x8000L) != 0L) return jjStartNfaWithStates_1(4, 15, 8); break; case 76: case 108: if ((active0 & 0x1000L) != 0L) return jjStartNfaWithStates_1(4, 12, 8); break; case 77: case 109: return jjMoveStringLiteralDfa5_1(active0, 0x200L); case 79: case 111: return jjMoveStringLiteralDfa5_1(active0, 0x40L); case 84: case 116: if ((active0 & 0x20L) != 0L) return jjStartNfaWithStates_1(4, 5, 8); break; default : break; } return jjStartNfa_1(3, active0); } private int jjMoveStringLiteralDfa5_1(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_1(3, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(4, active0); return 5; } switch(curChar) { case 65: case 97: if ((active0 & 0x200L) != 0L) return jjStartNfaWithStates_1(5, 9, 8); break; case 78: case 110: if ((active0 & 0x40L) != 0L) return jjStartNfaWithStates_1(5, 6, 8); break; case 79: case 111: return jjMoveStringLiteralDfa6_1(active0, 0x20000L); default : break; } return jjStartNfa_1(4, active0); } private int jjMoveStringLiteralDfa6_1(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_1(4, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(5, active0); return 6; } switch(curChar) { case 76: case 108: if ((active0 & 0x20000L) != 0L) return jjStartNfaWithStates_1(6, 17, 8); break; default : break; } return jjStartNfa_1(5, active0); } private int jjStartNfaWithStates_1(int pos, int kind, int state) { jjmatchedKind = kind; jjmatchedPos = pos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return pos + 1; } return jjMoveNfa_1(state, pos + 1); } private int jjMoveNfa_1(int startState, int curPos) { int startsAt = 0; jjnewStateCnt = 25; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; do { switch(jjstateSet[--i]) { case 0: if ((0x3ff000000000000L & l) != 0L) { if (kind > 20) kind = 20; jjCheckNAddStates(0, 4); } else if ((0x2400L & l) != 0L) { if (kind > 22) kind = 22; } else if ((0x100000200L & l) != 0L) { if (kind > 24) kind = 24; jjCheckNAdd(9); } else if (curChar == 35) jjCheckNAddTwoStates(19, 20); else if (curChar == 45) jjCheckNAddStates(7, 10); else if (curChar == 46) jjCheckNAdd(6); else if (curChar == 34) jjCheckNAddStates(11, 13); if (curChar == 13) jjAddStates(16, 17); break; case 1: if ((0xfffffffbffffffffL & l) != 0L) jjCheckNAddStates(11, 13); break; case 2: if (curChar == 34) jjCheckNAddStates(11, 13); break; case 3: if (curChar == 34) jjstateSet[jjnewStateCnt++] = 2; break; case 4: if (curChar == 34 && kind > 18) kind = 18; break; case 5: if (curChar == 46) jjCheckNAdd(6); break; case 6: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAdd(6); break; case 8: if ((0x3ff400000000000L & l) == 0L) break; if (kind > 21) kind = 21; jjstateSet[jjnewStateCnt++] = 8; break; case 9: if ((0x100000200L & l) == 0L) break; if (kind > 24) kind = 24; jjCheckNAdd(9); break; case 10: if (curChar == 45) jjCheckNAddStates(7, 10); break; case 11: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(11, 12); break; case 12: if (curChar == 46 && kind > 19) kind = 19; break; case 13: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(13, 14); break; case 14: if (curChar == 46) jjCheckNAdd(15); break; case 15: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 19) kind = 19; jjCheckNAdd(15); break; case 16: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAdd(16); break; case 17: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 20) kind = 20; jjCheckNAddStates(0, 4); break; case 18: if (curChar == 35) jjCheckNAddTwoStates(19, 20); break; case 19: if ((0xffffffffffffdbffL & l) == 0L) break; if (kind > 22) kind = 22; jjCheckNAdd(19); break; case 20: if ((0xffffffffffffdbffL & l) == 0L) break; if (kind > 23) kind = 23; jjCheckNAdd(20); break; case 21: if ((0x2400L & l) != 0L && kind > 22) kind = 22; break; case 22: if (curChar == 13) jjAddStates(16, 17); break; case 23: if (curChar == 10 && kind > 22) kind = 22; break; case 24: if (curChar == 10 && kind > 34) kind = 34; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); do { switch(jjstateSet[--i]) { case 0: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAdd(8); break; case 1: jjAddStates(11, 13); break; case 8: if ((0x7fffffe87fffffeL & l) == 0L) break; if (kind > 21) kind = 21; jjCheckNAdd(8); break; case 19: if (kind > 22) kind = 22; jjstateSet[jjnewStateCnt++] = 19; break; case 20: if (kind > 23) kind = 23; jjstateSet[jjnewStateCnt++] = 20; break; default : break; } } while(i != startsAt); } else { int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); do { switch(jjstateSet[--i]) { case 1: if ((jjbitVec0[i2] & l2) != 0L) jjAddStates(11, 13); break; case 19: if ((jjbitVec0[i2] & l2) == 0L) break; if (kind > 22) kind = 22; jjstateSet[jjnewStateCnt++] = 19; break; case 20: if ((jjbitVec0[i2] & l2) == 0L) break; if (kind > 23) kind = 23; jjstateSet[jjnewStateCnt++] = 20; break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 25 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } static final int[] jjnextStates = { 11, 12, 13, 14, 16, 26, 29, 11, 13, 5, 16, 1, 3, 4, 22, 23, 23, 24, }; /** Token literal values. */ public static final String[] jjstrLiteralImages = { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }; /** Lexer state names. */ public static final String[] lexStateNames = { "DEFAULT", "DATA", }; /** Lex State array. */ public static final int[] jjnewLexState = { -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; static final long[] jjtoToken = { 0x17fffffL, }; static final long[] jjtoSkip = { 0x3e800000L, }; static final long[] jjtoMore = { 0x400000000L, }; protected SimpleCharStream input_stream; private final int[] jjrounds = new int[31]; private final int[] jjstateSet = new int[62]; private final StringBuilder jjimage = new StringBuilder(); private StringBuilder image = jjimage; private int jjimageLen; private int lengthOfMatch; protected char curChar; /** Constructor. */ public DBPCDTokenManager(SimpleCharStream stream){ if (SimpleCharStream.staticFlag) throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); input_stream = stream; } /** Constructor. */ public DBPCDTokenManager(SimpleCharStream stream, int lexState){ this(stream); SwitchTo(lexState); } /** Reinitialise parser. */ public void ReInit(SimpleCharStream stream) { jjmatchedPos = jjnewStateCnt = 0; curLexState = defaultLexState; input_stream = stream; ReInitRounds(); } private void ReInitRounds() { int i; jjround = 0x80000001; for (i = 31; i-- > 0;) jjrounds[i] = 0x80000000; } /** Reinitialise parser. */ public void ReInit(SimpleCharStream stream, int lexState) { ReInit(stream); SwitchTo(lexState); } /** Switch to specified lex state. */ public void SwitchTo(int lexState) { if (lexState >= 2 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; } protected Token jjFillToken() { final Token t; final String curTokenImage; final int beginLine; final int endLine; final int beginColumn; final int endColumn; String im = jjstrLiteralImages[jjmatchedKind]; curTokenImage = (im == null) ? input_stream.GetImage() : im; beginLine = input_stream.getBeginLine(); beginColumn = input_stream.getBeginColumn(); endLine = input_stream.getEndLine(); endColumn = input_stream.getEndColumn(); t = Token.newToken(jjmatchedKind, curTokenImage); t.beginLine = beginLine; t.endLine = endLine; t.beginColumn = beginColumn; t.endColumn = endColumn; return t; } int curLexState = 0; int defaultLexState = 0; int jjnewStateCnt; int jjround; int jjmatchedPos; int jjmatchedKind; /** Get the next Token. */ public Token getNextToken() { Token matchedToken; int curPos = 0; EOFLoop : for (;;) { try { curChar = input_stream.BeginToken(); } catch(java.io.IOException e) { jjmatchedKind = 0; matchedToken = jjFillToken(); return matchedToken; } image = jjimage; image.setLength(0); jjimageLen = 0; for (;;) { switch(curLexState) { case 0: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); break; case 1: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_1(); break; } if (jjmatchedKind != 0x7fffffff) { if (jjmatchedPos + 1 < curPos) input_stream.backup(curPos - jjmatchedPos - 1); if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); TokenLexicalActions(matchedToken); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; return matchedToken; } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { SkipLexicalActions(null); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; continue EOFLoop; } jjimageLen += jjmatchedPos + 1; if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; curPos = 0; jjmatchedKind = 0x7fffffff; try { curChar = input_stream.readChar(); continue; } catch (java.io.IOException e1) { } } int error_line = input_stream.getEndLine(); int error_column = input_stream.getEndColumn(); String error_after = null; boolean EOFSeen = false; try { input_stream.readChar(); input_stream.backup(1); } catch (java.io.IOException e1) { EOFSeen = true; error_after = curPos <= 1 ? "" : input_stream.GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else error_column++; } if (!EOFSeen) { input_stream.backup(1); error_after = curPos <= 1 ? "" : input_stream.GetImage(); } throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); } } } void SkipLexicalActions(Token matchedToken) { switch(jjmatchedKind) { case 25 : image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); indent = 0; break; case 26 : image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); indent = 0; break; case 28 : image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); indent++; break; default : break; } } void TokenLexicalActions(Token matchedToken) { switch(jjmatchedKind) { case 22 : image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); indent = 0; break; default : break; } } private void jjCheckNAdd(int state) { if (jjrounds[state] != jjround) { jjstateSet[jjnewStateCnt++] = state; jjrounds[state] = jjround; } } private void jjAddStates(int start, int end) { do { jjstateSet[jjnewStateCnt++] = jjnextStates[start]; } while (start++ != end); } private void jjCheckNAddTwoStates(int state1, int state2) { jjCheckNAdd(state1); jjCheckNAdd(state2); } private void jjCheckNAddStates(int start, int end) { do { jjCheckNAdd(jjnextStates[start]); } while (start++ != end); } }