1 20 21 package org.apache.directory.ldapstudio.browser.core.model.schema.parser; 23 24 25 import java.util.*; 26 27 import antlr.TokenBuffer; 28 import antlr.TokenStreamException; 29 import antlr.TokenStreamIOException; 30 import antlr.ANTLRException; 31 import antlr.LLkParser; 32 import antlr.Token; 33 import antlr.TokenStream; 34 import antlr.RecognitionException; 35 import antlr.NoViableAltException; 36 import antlr.MismatchedTokenException; 37 import antlr.SemanticException; 38 import antlr.ParserSharedInputState; 39 import antlr.collections.impl.BitSet; 40 41 42 public class SchemaValueParser extends antlr.LLkParser implements SchemaValueTokenTypes 43 { 44 45 protected SchemaValueParser( TokenBuffer tokenBuf, int k ) 46 { 47 super( tokenBuf, k ); 48 tokenNames = _tokenNames; 49 } 50 51 52 public SchemaValueParser( TokenBuffer tokenBuf ) 53 { 54 this( tokenBuf, 3 ); 55 } 56 57 58 protected SchemaValueParser( TokenStream lexer, int k ) 59 { 60 super( lexer, k ); 61 tokenNames = _tokenNames; 62 } 63 64 65 public SchemaValueParser( TokenStream lexer ) 66 { 67 this( lexer, 3 ); 68 } 69 70 71 public SchemaValueParser( ParserSharedInputState state ) 72 { 73 super( state, 3 ); 74 tokenNames = _tokenNames; 75 } 76 77 78 public final String [] oids() throws RecognitionException, TokenStreamException 79 { 80 String [] oids; 81 82 oids = new String [0]; 83 List oidList = new ArrayList(); 84 String oid = null; 85 86 { 87 switch ( LA( 1 ) ) 88 { 89 case NUMERICOID: 90 case DESCR: 91 { 92 { 93 oid = oid(); 94 oidList.add( oid ); 95 } 96 break; 97 } 98 case LPAR: 99 { 100 { 101 match( LPAR ); 102 oid = oid(); 103 oidList.add( oid ); 104 { 105 _loop30: do 106 { 107 if ( ( LA( 1 ) == DOLLAR ) ) 108 { 109 match( DOLLAR ); 110 oid = oid(); 111 oidList.add( oid ); 112 } 113 else 114 { 115 break _loop30; 116 } 117 118 } 119 while ( true ); 120 } 121 match( RPAR ); 122 } 123 break; 124 } 125 default: 126 { 127 throw new NoViableAltException( LT( 1 ), getFilename() ); 128 } 129 } 130 } 131 132 oids = ( String [] ) oidList.toArray( new String [oidList.size()] ); 133 134 return oids; 135 } 136 137 138 public final String oid() throws RecognitionException, TokenStreamException 139 { 140 String oid = null; 141 142 Token n = null; 143 Token d = null; 144 145 { 146 switch ( LA( 1 ) ) 147 { 148 case NUMERICOID: 149 { 150 n = LT( 1 ); 151 match( NUMERICOID ); 152 oid = n.getText(); 153 break; 154 } 155 case DESCR: 156 { 157 d = LT( 1 ); 158 match( DESCR ); 159 oid = d.getText(); 160 break; 161 } 162 default: 163 { 164 throw new NoViableAltException( LT( 1 ), getFilename() ); 165 } 166 } 167 } 168 return oid; 169 } 170 171 172 public final String [] qdescrs() throws RecognitionException, TokenStreamException 173 { 174 String [] qdescrs; 175 176 qdescrs = new String [0]; 177 List qdescrList = new ArrayList(); 178 String qdescr = null; 179 180 { 181 switch ( LA( 1 ) ) 182 { 183 case QUOTE: 184 { 185 { 186 qdescr = qdescr(); 187 qdescrList.add( qdescr ); 188 } 189 break; 190 } 191 case LPAR: 192 { 193 { 194 match( LPAR ); 195 qdescr = qdescr(); 196 qdescrList.add( qdescr ); 197 { 198 _loop38: do 199 { 200 if ( ( LA( 1 ) == QUOTE ) ) 201 { 202 qdescr = qdescr(); 203 qdescrList.add( qdescr ); 204 } 205 else 206 { 207 break _loop38; 208 } 209 210 } 211 while ( true ); 212 } 213 match( RPAR ); 214 } 215 break; 216 } 217 default: 218 { 219 throw new NoViableAltException( LT( 1 ), getFilename() ); 220 } 221 } 222 } 223 224 qdescrs = ( String [] ) qdescrList.toArray( new String [qdescrList.size()] ); 225 226 return qdescrs; 227 } 228 229 230 public final String qdescr() throws RecognitionException, TokenStreamException 231 { 232 String qdescr = null; 233 234 Token d = null; 235 236 { 237 match( QUOTE ); 238 d = LT( 1 ); 239 match( DESCR ); 240 qdescr = d.getText(); 241 match( QUOTE ); 242 } 243 return qdescr; 244 } 245 246 public static final String [] _tokenNames = 247 { "<0>", "EOF", "<2>", "NULL_TREE_LOOKAHEAD", "WHSP", "LPAR", "RPAR", "QUOTE", "DOLLAR", "LBRACKET", 248 "RBRACKET", "LEN", "DIGIT", "NUMERICOID", "DESCR" }; 249 250 } 251 | Popular Tags |