1 package com.daffodilwoods.daffodildb.utils.parser; 2 3 import java.util.HashMap ; 4 import javax.swing.tree.*; 5 import com.daffodilwoods.database.utility.P; 6 import com.daffodilwoods.daffodildb.utils.DBStack; 7 8 13 14 public class ParseElements { 15 19 HashMap successfulRule; 20 21 24 HashMap hashMap; 25 26 29 30 33 int position; 34 35 38 39 42 DefaultMutableTreeNode parentNode; 43 44 48 Object recursiveObject; 49 50 53 String recursionState; 54 55 58 String query; 59 60 63 char[] queryArray; 64 65 69 char[][] queryTokenCharacterArray; 70 71 74 Object []tokens; 75 76 79 Object []index; 80 81 85 ParseException parseException = new ParseException(); 86 87 boolean tokenFlag; 88 boolean bestOptionFlag; 89 90 93 private DBStack treeNode = new DBStack(); 94 95 void pushElementsForTree(){ 96 treeNode.push(parentNode); 97 } 98 99 void popElementsFromTree(){ 100 parentNode = (DefaultMutableTreeNode)treeNode.pop(); 101 } 102 103 107 public int getIndexPosition(int position){ 108 if ( index == null ) 109 return position; 111 if ( position < index.length ){ 112 int pos = index[position].hashCode(); 113 parseException.setCauseOfParseException(position,null,pos); 114 return pos; 115 } 116 return position; 117 } 118 119 } 120 121 | Popular Tags |