/* Generated By:JavaCC: Do not edit this line. SchemaParser.java */
/**
* Copyright 2009 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.safehaus.penrose.schema;
import java.util.*;
/**
* LDAP Schema Parser.
*
* <h3>Grammar for the LDAP v3 Schema</h3>
*
* See also: http://www.geocities.com/raoavm/ldapdesign.html
*
* <pre>
* AttributeTypeDescription = "(" whsp
* numericoid whsp ; AttributeType identifier
* [ "NAME" qdescrs ] ; name used in AttributeType
* [ "DESC" qdstring ] ; description
* [ "OBSOLETE" whsp ]
* [ "SUP" woid ] ; derived from this other
* ; AttributeType
* [ "EQUALITY" woid ; Matching Rule name
* [ "ORDERING" woid ; Matching Rule name
* [ "SUBSTR" woid ] ; Matching Rule name
* [ "SYNTAX" whsp noidlen whsp ] ; see section 4.3
* [ "SINGLE-VALUE" whsp ] ; default multi-valued
* [ "COLLECTIVE" whsp ] ; default not collective
* [ "NO-USER-MODIFICATION" whsp ]; default user modifiable
* [ "USAGE" whsp AttributeUsage ]; default userApplications
* whsp ")"
*
* AttributeUsage =
* "userApplications" /
* "directoryOperation" /
* "distributedOperation" / ; DSA-shared
* "dSAOperation" ; DSA-specific, value depends on server
* </pre>
*
* From RFC 2252:
*
* <pre>
* ObjectClassDescription = "(" whsp
* numericoid whsp ; ObjectClass identifier
* [ "NAME" qdescrs ]
* [ "DESC" qdstring ]
* [ "OBSOLETE" whsp ]
* [ "SUP" oids ] ; Superior ObjectClasses
* [ ( "ABSTRACT" / "STRUCTURAL" / "AUXILIARY" ) whsp ]
* ; default structural
* [ "MUST" oids ] ; AttributeTypes
* [ "MAY" oids ] ; AttributeTypes
* whsp ")"
* </pre>
*
*
* <h3>Example to use this SchemaParser</h3>
*
* <pre>
* Reader in = ...;
* SchemaParser parser = new SchemaParser(in);
* List schema = parser.parse();
* List errors = parser.getErrors();
* </pre>
*
* Alternatively, you could also call getSchema() to get the List of schema.
*/
public class SchemaParser implements SchemaParserConstants {
Schema schema = new Schema();
List errors = new ArrayList();
/**
* Start parsing
* @return the list of schema
*/
public Schema parse() throws ParseException {
try {
Schema();
} catch (ParseException ex) {
}
return this.schema;
}
/**
* Get the list of schema from parsing
*/
public Schema getSchema() {
return this.schema;
}
/**
* Get the list of errors from parsing
*/
public List getErrors() {
return this.errors;
}
final public void Schema() throws ParseException {
AttributeType at;
ObjectClass oc;
label_1:
while (true) {
;
if (jj_2_1(2147483647)) {
at = AttributeType();
schema.addAttributeType(at);
} else if (jj_2_2(2147483647)) {
oc = ObjectClass();
schema.addObjectClass(oc);
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
}
final public AttributeType AttributeType() throws ParseException {
AttributeType at = new AttributeType();
/* default values */
at.setObsolete(false);
at.setSingleValued(false);
at.setCollective(false);
at.setModifiable(true);
/* variables */
String oid;
List names = new ArrayList();
String desc;
String sup, equality, ordering, substr;
String syntax;
String usage;
if (jj_2_17(5)) {
jj_consume_token(ATTRIBUTETYPE);
jj_consume_token(LPAREN);
oid = numericoid();
at.setOid(oid);
label_2:
while (true) {
if (jj_2_3(5)) {
;
} else {
break label_2;
}
if (jj_2_4(5)) {
jj_consume_token(NAME);
names = qdescrs();
at.setNames(names);
} else if (jj_2_5(5)) {
jj_consume_token(DESC);
desc = qdstring();
at.setDescription(desc);
} else if (jj_2_6(5)) {
jj_consume_token(OBSOLETE);
at.setObsolete(true);
} else if (jj_2_7(5)) {
jj_consume_token(SUP);
sup = woid();
at.setSuperClass(sup);
} else if (jj_2_8(5)) {
jj_consume_token(EQUALITY);
equality = woid();
at.setEquality(equality);
} else if (jj_2_9(5)) {
jj_consume_token(ORDERING);
ordering = woid();
at.setOrdering(ordering);
} else if (jj_2_10(5)) {
jj_consume_token(SUBSTR);
substr = woid();
at.setSubstring(substr);
} else if (jj_2_11(5)) {
jj_consume_token(SYNTAX);
syntax = noidlen();
at.setSyntax(syntax);
} else if (jj_2_12(5)) {
jj_consume_token(SINGLE_VALUE);
at.setSingleValued(true);
} else if (jj_2_13(5)) {
jj_consume_token(COLLECTIVE);
at.setCollective(true);
} else if (jj_2_14(5)) {
jj_consume_token(NO_USER_MODIFICATION);
at.setModifiable(false);
} else if (jj_2_15(5)) {
jj_consume_token(USAGE);
usage = AttributeUsage();
at.setUsage(usage);
} else if (jj_2_16(5)) {
jj_consume_token(X_PARAMETER);
qdstring();
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
jj_consume_token(RPAREN);
{if (true) return at;}
} else {
error_skipto(RPAREN);
{if (true) return null;}
}
throw new Error("Missing return statement in function");
}
final public ObjectClass ObjectClass() throws ParseException {
ObjectClass oc = new ObjectClass();
/* variables */
String oid;
List names;
String desc;
List sup, must, may;
String type;
if (jj_2_29(5)) {
jj_consume_token(OBJECTCLASS);
jj_consume_token(LPAREN);
oid = numericoid();
oc.setOid(oid);
label_3:
while (true) {
if (jj_2_18(5)) {
;
} else {
break label_3;
}
if (jj_2_19(5)) {
jj_consume_token(NAME);
names = qdescrs();
oc.setNames(names);
} else if (jj_2_20(5)) {
jj_consume_token(DESC);
desc = qdstring();
oc.setDescription(desc);
} else if (jj_2_21(5)) {
jj_consume_token(OBSOLETE);
oc.setObsolete(true);
} else if (jj_2_22(5)) {
jj_consume_token(SUP);
sup = oids();
oc.setSuperClasses(sup);
} else if (jj_2_23(5)) {
jj_consume_token(ABSTRACT);
oc.setType(ObjectClass.ABSTRACT);
} else if (jj_2_24(5)) {
jj_consume_token(STRUCTURAL);
oc.setType(ObjectClass.STRUCTURAL);
} else if (jj_2_25(5)) {
jj_consume_token(AUXILIARY);
oc.setType(ObjectClass.AUXILIARY);
} else if (jj_2_26(5)) {
jj_consume_token(MUST);
must = oids();
oc.setRequiredAttributes(must);
} else if (jj_2_27(5)) {
jj_consume_token(MAY);
may = oids();
oc.setOptionalAttributes(may);
} else if (jj_2_28(5)) {
jj_consume_token(X_PARAMETER);
qdstring();
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
jj_consume_token(RPAREN);
{if (true) return oc;}
} else {
error_skipto(RPAREN);
{if (true) return null;}
}
throw new Error("Missing return statement in function");
}
final public String AttributeUsage() throws ParseException {
if (jj_2_30(5)) {
jj_consume_token(USER_APPLICATIONS);
{if (true) return AttributeType.USER_APPLICATIONS;}
} else if (jj_2_31(5)) {
jj_consume_token(DIRECTORY_OPERATION);
{if (true) return AttributeType.DIRECTORY_OPERATION;}
} else if (jj_2_32(5)) {
jj_consume_token(DISTRIBUTED_OPERATION);
{if (true) return AttributeType.DISTRIBUTED_OPERATION;}
} else if (jj_2_33(5)) {
jj_consume_token(DSA_OPERATION);
{if (true) return AttributeType.DSA_OPERATION;}
} else if (jj_2_34(5)) {
jj_consume_token(DSA_OPERATION2);
{if (true) return AttributeType.DSA_OPERATION;}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/**
* globally unique OID in dotted-decimal form.
*/
final public String numericoid() throws ParseException {
Token t;
StringBuilder sb = new StringBuilder();
t = jj_consume_token(DIGIT);
sb.append(t.toString());
label_4:
while (true) {
if (jj_2_35(5)) {
;
} else {
break label_4;
}
jj_consume_token(DOT);
t = jj_consume_token(DIGIT);
sb.append("." + t.toString());
}
{if (true) return sb.toString();}
throw new Error("Missing return statement in function");
}
/**
* single quoted string.
*/
final public String qdstring() throws ParseException {
Token t;
String s;
t = jj_consume_token(QDSTRING);
s = t.toString(); s = s.substring(1, s.length()-1); {if (true) return s;}
throw new Error("Missing return statement in function");
}
/**
* single quoted identifier.
*/
final public String qdident() throws ParseException {
Token t;
String s;
if (jj_2_36(5)) {
t = jj_consume_token(QDSTRING);
s = t.toString(); s = s.substring(1, s.length()-1); {if (true) return s;}
} else if (jj_2_37(5)) {
t = jj_consume_token(IDENT);
s = t.toString(); {if (true) return s;}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/**
* one or more names.
*/
final public List qdescrs() throws ParseException {
String s;
List l = new ArrayList();
if (jj_2_39(5)) {
s = qdident();
l.add(s); {if (true) return l;}
} else if (jj_2_40(5)) {
jj_consume_token(LPAREN);
label_5:
while (true) {
s = qdident();
l.add(s);
if (jj_2_38(5)) {
;
} else {
break label_5;
}
}
jj_consume_token(RPAREN);
{if (true) return l;}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/**
* syntax OID.
*/
final public String noidlen() throws ParseException {
String s;
s = woid();
{if (true) return s;}
throw new Error("Missing return statement in function");
}
/**
* either the name or OID optionally followed by a length specifier.
*/
final public String woid() throws ParseException {
Token t;
String s;
if (jj_2_42(5)) {
s = qdident();
{if (true) return s;}
} else if (jj_2_43(5)) {
s = numericoid();
if (jj_2_41(5)) {
jj_consume_token(LBRACE);
t = jj_consume_token(DIGIT);
jj_consume_token(RBRACE);
s += "{" + t.toString() + "}";
} else {
;
}
{if (true) return s;}
} else if (jj_2_44(5)) {
t = jj_consume_token(OBJECTCLASS);
{if (true) return t.toString();}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/**
* list of OIDs.
*/
final public List oids() throws ParseException {
String s;
List oids = new ArrayList();
if (jj_2_46(5)) {
s = woid();
oids.add(s); {if (true) return oids;}
} else if (jj_2_47(5)) {
jj_consume_token(LPAREN);
s = woid();
oids.add(s);
label_6:
while (true) {
if (jj_2_45(5)) {
;
} else {
break label_6;
}
jj_consume_token(DOLLAR);
s = woid();
oids.add(s);
}
jj_consume_token(RPAREN);
{if (true) return oids;}
} else {
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
void error_skipto(int token) throws ParseException {
ParseException e = generateParseException(); // generate the exception object.
// System.out.println(e.getMessage()); // print the error message
errors.add(e.getMessage());
Token t;
do {
t = getNextToken();
} while (t.kind != token && t.kind != EOF);
// The above loop consumes tokens all the way up to a token of
// "kind". We use a do-while loop rather than a while because the
// current token is the one immediately before the erroneous token
// (in our case the token immediately before what should have been
// "if"/"while".
if (t.kind == EOF) throw e;
}
final private boolean jj_2_1(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_1(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(0, xla); }
}
final private boolean jj_2_2(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_2(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(1, xla); }
}
final private boolean jj_2_3(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_3(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(2, xla); }
}
final private boolean jj_2_4(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_4(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(3, xla); }
}
final private boolean jj_2_5(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_5(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(4, xla); }
}
final private boolean jj_2_6(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_6(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(5, xla); }
}
final private boolean jj_2_7(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_7(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(6, xla); }
}
final private boolean jj_2_8(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_8(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(7, xla); }
}
final private boolean jj_2_9(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_9(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(8, xla); }
}
final private boolean jj_2_10(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_10(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(9, xla); }
}
final private boolean jj_2_11(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_11(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(10, xla); }
}
final private boolean jj_2_12(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_12(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(11, xla); }
}
final private boolean jj_2_13(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_13(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(12, xla); }
}
final private boolean jj_2_14(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_14(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(13, xla); }
}
final private boolean jj_2_15(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_15(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(14, xla); }
}
final private boolean jj_2_16(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_16(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(15, xla); }
}
final private boolean jj_2_17(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_17(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(16, xla); }
}
final private boolean jj_2_18(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_18(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(17, xla); }
}
final private boolean jj_2_19(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_19(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(18, xla); }
}
final private boolean jj_2_20(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_20(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(19, xla); }
}
final private boolean jj_2_21(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_21(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(20, xla); }
}
final private boolean jj_2_22(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_22(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(21, xla); }
}
final private boolean jj_2_23(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_23(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(22, xla); }
}
final private boolean jj_2_24(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_24(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(23, xla); }
}
final private boolean jj_2_25(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_25(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(24, xla); }
}
final private boolean jj_2_26(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_26(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(25, xla); }
}
final private boolean jj_2_27(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_27(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(26, xla); }
}
final private boolean jj_2_28(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_28(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(27, xla); }
}
final private boolean jj_2_29(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_29(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(28, xla); }
}
final private boolean jj_2_30(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_30(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(29, xla); }
}
final private boolean jj_2_31(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_31(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(30, xla); }
}
final private boolean jj_2_32(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_32(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(31, xla); }
}
final private boolean jj_2_33(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_33(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(32, xla); }
}
final private boolean jj_2_34(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_34(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(33, xla); }
}
final private boolean jj_2_35(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_35(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(34, xla); }
}
final private boolean jj_2_36(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_36(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(35, xla); }
}
final private boolean jj_2_37(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_37(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(36, xla); }
}
final private boolean jj_2_38(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_38(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(37, xla); }
}
final private boolean jj_2_39(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_39(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(38, xla); }
}
final private boolean jj_2_40(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_40(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(39, xla); }
}
final private boolean jj_2_41(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_41(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(40, xla); }
}
final private boolean jj_2_42(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_42(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(41, xla); }
}
final private boolean jj_2_43(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_43(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(42, xla); }
}
final private boolean jj_2_44(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_44(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(43, xla); }
}
final private boolean jj_2_45(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_45(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(44, xla); }
}
final private boolean jj_2_46(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_46(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(45, xla); }
}
final private boolean jj_2_47(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_47(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(46, xla); }
}
final private boolean jj_3_25() {
if (jj_scan_token(AUXILIARY)) return true;
return false;
}
final private boolean jj_3_24() {
if (jj_scan_token(STRUCTURAL)) return true;
return false;
}
final private boolean jj_3_28() {
if (jj_scan_token(X_PARAMETER)) return true;
if (jj_3R_8()) return true;
return false;
}
final private boolean jj_3_23() {
if (jj_scan_token(ABSTRACT)) return true;
return false;
}
final private boolean jj_3_22() {
if (jj_scan_token(SUP)) return true;
if (jj_3R_13()) return true;
return false;
}
final private boolean jj_3_21() {
if (jj_scan_token(OBSOLETE)) return true;
return false;
}
final private boolean jj_3_44() {
if (jj_scan_token(OBJECTCLASS)) return true;
return false;
}
final private boolean jj_3_41() {
if (jj_scan_token(LBRACE)) return true;
if (jj_scan_token(DIGIT)) return true;
if (jj_scan_token(RBRACE)) return true;
return false;
}
final private boolean jj_3_20() {
if (jj_scan_token(DESC)) return true;
if (jj_3R_8()) return true;
return false;
}
final private boolean jj_3_18() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_19()) {
jj_scanpos = xsp;
if (jj_3_20()) {
jj_scanpos = xsp;
if (jj_3_21()) {
jj_scanpos = xsp;
if (jj_3_22()) {
jj_scanpos = xsp;
if (jj_3_23()) {
jj_scanpos = xsp;
if (jj_3_24()) {
jj_scanpos = xsp;
if (jj_3_25()) {
jj_scanpos = xsp;
if (jj_3_26()) {
jj_scanpos = xsp;
if (jj_3_27()) {
jj_scanpos = xsp;
if (jj_3_28()) return true;
}
}
}
}
}
}
}
}
}
return false;
}
final private boolean jj_3_19() {
if (jj_scan_token(NAME)) return true;
if (jj_3R_7()) return true;
return false;
}
final private boolean jj_3_43() {
if (jj_3R_12()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_41()) jj_scanpos = xsp;
return false;
}
final private boolean jj_3R_9() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_42()) {
jj_scanpos = xsp;
if (jj_3_43()) {
jj_scanpos = xsp;
if (jj_3_44()) return true;
}
}
return false;
}
final private boolean jj_3_42() {
if (jj_3R_14()) return true;
return false;
}
final private boolean jj_3_29() {
if (jj_scan_token(OBJECTCLASS)) return true;
if (jj_scan_token(LPAREN)) return true;
if (jj_3R_12()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_18()) { jj_scanpos = xsp; break; }
}
if (jj_scan_token(RPAREN)) return true;
return false;
}
final private boolean jj_3R_10() {
if (jj_3R_9()) return true;
return false;
}
final private boolean jj_3_38() {
if (jj_3R_14()) return true;
return false;
}
final private boolean jj_3_15() {
if (jj_scan_token(USAGE)) return true;
if (jj_3R_11()) return true;
return false;
}
final private boolean jj_3_14() {
if (jj_scan_token(NO_USER_MODIFICATION)) return true;
return false;
}
final private boolean jj_3_13() {
if (jj_scan_token(COLLECTIVE)) return true;
return false;
}
final private boolean jj_3_16() {
if (jj_scan_token(X_PARAMETER)) return true;
if (jj_3R_8()) return true;
return false;
}
final private boolean jj_3_12() {
if (jj_scan_token(SINGLE_VALUE)) return true;
return false;
}
final private boolean jj_3_11() {
if (jj_scan_token(SYNTAX)) return true;
if (jj_3R_10()) return true;
return false;
}
final private boolean jj_3_10() {
if (jj_scan_token(SUBSTR)) return true;
if (jj_3R_9()) return true;
return false;
}
final private boolean jj_3_40() {
if (jj_scan_token(LPAREN)) return true;
Token xsp;
if (jj_3_38()) return true;
while (true) {
xsp = jj_scanpos;
if (jj_3_38()) { jj_scanpos = xsp; break; }
}
if (jj_scan_token(RPAREN)) return true;
return false;
}
final private boolean jj_3_9() {
if (jj_scan_token(ORDERING)) return true;
if (jj_3R_9()) return true;
return false;
}
final private boolean jj_3R_7() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_39()) {
jj_scanpos = xsp;
if (jj_3_40()) return true;
}
return false;
}
final private boolean jj_3_39() {
if (jj_3R_14()) return true;
return false;
}
final private boolean jj_3_8() {
if (jj_scan_token(EQUALITY)) return true;
if (jj_3R_9()) return true;
return false;
}
final private boolean jj_3_7() {
if (jj_scan_token(SUP)) return true;
if (jj_3R_9()) return true;
return false;
}
final private boolean jj_3_6() {
if (jj_scan_token(OBSOLETE)) return true;
return false;
}
final private boolean jj_3_5() {
if (jj_scan_token(DESC)) return true;
if (jj_3R_8()) return true;
return false;
}
final private boolean jj_3_3() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_4()) {
jj_scanpos = xsp;
if (jj_3_5()) {
jj_scanpos = xsp;
if (jj_3_6()) {
jj_scanpos = xsp;
if (jj_3_7()) {
jj_scanpos = xsp;
if (jj_3_8()) {
jj_scanpos = xsp;
if (jj_3_9()) {
jj_scanpos = xsp;
if (jj_3_10()) {
jj_scanpos = xsp;
if (jj_3_11()) {
jj_scanpos = xsp;
if (jj_3_12()) {
jj_scanpos = xsp;
if (jj_3_13()) {
jj_scanpos = xsp;
if (jj_3_14()) {
jj_scanpos = xsp;
if (jj_3_15()) {
jj_scanpos = xsp;
if (jj_3_16()) return true;
}
}
}
}
}
}
}
}
}
}
}
}
return false;
}
final private boolean jj_3_4() {
if (jj_scan_token(NAME)) return true;
if (jj_3R_7()) return true;
return false;
}
final private boolean jj_3_37() {
if (jj_scan_token(IDENT)) return true;
return false;
}
final private boolean jj_3R_14() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_36()) {
jj_scanpos = xsp;
if (jj_3_37()) return true;
}
return false;
}
final private boolean jj_3_36() {
if (jj_scan_token(QDSTRING)) return true;
return false;
}
final private boolean jj_3_17() {
if (jj_scan_token(ATTRIBUTETYPE)) return true;
if (jj_scan_token(LPAREN)) return true;
if (jj_3R_12()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_3()) { jj_scanpos = xsp; break; }
}
if (jj_scan_token(RPAREN)) return true;
return false;
}
final private boolean jj_3_2() {
if (jj_scan_token(OBJECTCLASS)) return true;
return false;
}
final private boolean jj_3_1() {
if (jj_scan_token(ATTRIBUTETYPE)) return true;
return false;
}
final private boolean jj_3R_8() {
if (jj_scan_token(QDSTRING)) return true;
return false;
}
final private boolean jj_3_35() {
if (jj_scan_token(DOT)) return true;
if (jj_scan_token(DIGIT)) return true;
return false;
}
final private boolean jj_3R_12() {
if (jj_scan_token(DIGIT)) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_35()) { jj_scanpos = xsp; break; }
}
return false;
}
final private boolean jj_3_45() {
if (jj_scan_token(DOLLAR)) return true;
if (jj_3R_9()) return true;
return false;
}
final private boolean jj_3_34() {
if (jj_scan_token(DSA_OPERATION2)) return true;
return false;
}
final private boolean jj_3_47() {
if (jj_scan_token(LPAREN)) return true;
if (jj_3R_9()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_45()) { jj_scanpos = xsp; break; }
}
if (jj_scan_token(RPAREN)) return true;
return false;
}
final private boolean jj_3_33() {
if (jj_scan_token(DSA_OPERATION)) return true;
return false;
}
final private boolean jj_3R_13() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_46()) {
jj_scanpos = xsp;
if (jj_3_47()) return true;
}
return false;
}
final private boolean jj_3_46() {
if (jj_3R_9()) return true;
return false;
}
final private boolean jj_3_32() {
if (jj_scan_token(DISTRIBUTED_OPERATION)) return true;
return false;
}
final private boolean jj_3_31() {
if (jj_scan_token(DIRECTORY_OPERATION)) return true;
return false;
}
final private boolean jj_3R_11() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_30()) {
jj_scanpos = xsp;
if (jj_3_31()) {
jj_scanpos = xsp;
if (jj_3_32()) {
jj_scanpos = xsp;
if (jj_3_33()) {
jj_scanpos = xsp;
if (jj_3_34()) return true;
}
}
}
}
return false;
}
final private boolean jj_3_30() {
if (jj_scan_token(USER_APPLICATIONS)) return true;
return false;
}
final private boolean jj_3_27() {
if (jj_scan_token(MAY)) return true;
if (jj_3R_13()) return true;
return false;
}
final private boolean jj_3_26() {
if (jj_scan_token(MUST)) return true;
if (jj_3R_13()) return true;
return false;
}
public SchemaParserTokenManager token_source;
SimpleCharStream jj_input_stream;
public Token token, jj_nt;
private int jj_ntk;
private Token jj_scanpos, jj_lastpos;
private int jj_la;
public boolean lookingAhead = false;
private boolean jj_semLA;
private int jj_gen;
final private int[] jj_la1 = new int[0];
static private int[] jj_la1_0;
static private int[] jj_la1_1;
static {
jj_la1_0();
jj_la1_1();
}
private static void jj_la1_0() {
jj_la1_0 = new int[] {};
}
private static void jj_la1_1() {
jj_la1_1 = new int[] {};
}
final private JJCalls[] jj_2_rtns = new JJCalls[47];
private boolean jj_rescan = false;
private int jj_gc = 0;
public SchemaParser(java.io.InputStream stream) {
jj_input_stream = new SimpleCharStream(stream, 1, 1);
token_source = new SchemaParserTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public void ReInit(java.io.InputStream stream) {
jj_input_stream.ReInit(stream, 1, 1);
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public SchemaParser(java.io.Reader stream) {
jj_input_stream = new SimpleCharStream(stream, 1, 1);
token_source = new SchemaParserTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public void ReInit(java.io.Reader stream) {
jj_input_stream.ReInit(stream, 1, 1);
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public SchemaParser(SchemaParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public void ReInit(SchemaParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 0; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
final private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
if ((oldToken = token).next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
for (int i = 0; i < jj_2_rtns.length; i++) {
JJCalls c = jj_2_rtns[i];
while (c != null) {
if (c.gen < jj_gen) c.first = null;
c = c.next;
}
}
}
return token;
}
token = oldToken;
jj_kind = kind;
throw generateParseException();
}
static private final class LookaheadSuccess extends java.lang.Error { }
final private LookaheadSuccess jj_ls = new LookaheadSuccess();
final private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_scanpos.next;
}
if (jj_rescan) {
int i = 0; Token tok = token;
while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
if (tok != null) jj_add_error_token(kind, i);
}
if (jj_scanpos.kind != kind) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
return false;
}
final public Token getNextToken() {
if (token.next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
jj_gen++;
return token;
}
final public Token getToken(int index) {
Token t = lookingAhead ? jj_scanpos : token;
for (int i = 0; i < index; i++) {
if (t.next != null) t = t.next;
else t = t.next = token_source.getNextToken();
}
return t;
}
final private int jj_ntk() {
if ((jj_nt=token.next) == null)
return (jj_ntk = (token.next=token_source.getNextToken()).kind);
else
return (jj_ntk = jj_nt.kind);
}
private java.util.Vector jj_expentries = new java.util.Vector();
private int[] jj_expentry;
private int jj_kind = -1;
private int[] jj_lasttokens = new int[100];
private int jj_endpos;
private void jj_add_error_token(int kind, int pos) {
if (pos >= 100) return;
if (pos == jj_endpos + 1) {
jj_lasttokens[jj_endpos++] = kind;
} else if (jj_endpos != 0) {
jj_expentry = new int[jj_endpos];
for (int i = 0; i < jj_endpos; i++) {
jj_expentry[i] = jj_lasttokens[i];
}
boolean exists = false;
for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
int[] oldentry = (int[])(e.nextElement());
if (oldentry.length == jj_expentry.length) {
exists = true;
for (int i = 0; i < jj_expentry.length; i++) {
if (oldentry[i] != jj_expentry[i]) {
exists = false;
break;
}
}
if (exists) break;
}
}
if (!exists) jj_expentries.addElement(jj_expentry);
if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
}
}
public ParseException generateParseException() {
jj_expentries.removeAllElements();
boolean[] la1tokens = new boolean[43];
for (int i = 0; i < 43; i++) {
la1tokens[i] = false;
}
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 0; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if ((jj_la1_0[i] & (1<<j)) != 0) {
la1tokens[j] = true;
}
if ((jj_la1_1[i] & (1<<j)) != 0) {
la1tokens[32+j] = true;
}
}
}
}
for (int i = 0; i < 43; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
jj_expentries.addElement(jj_expentry);
}
}
jj_endpos = 0;
jj_rescan_token();
jj_add_error_token(0, 0);
int[][] exptokseq = new int[jj_expentries.size()][];
for (int i = 0; i < jj_expentries.size(); i++) {
exptokseq[i] = (int[])jj_expentries.elementAt(i);
}
return new ParseException(token, exptokseq, tokenImage);
}
final public void enable_tracing() {
}
final public void disable_tracing() {
}
final private void jj_rescan_token() {
jj_rescan = true;
for (int i = 0; i < 47; i++) {
JJCalls p = jj_2_rtns[i];
do {
if (p.gen > jj_gen) {
jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
switch (i) {
case 0: jj_3_1(); break;
case 1: jj_3_2(); break;
case 2: jj_3_3(); break;
case 3: jj_3_4(); break;
case 4: jj_3_5(); break;
case 5: jj_3_6(); break;
case 6: jj_3_7(); break;
case 7: jj_3_8(); break;
case 8: jj_3_9(); break;
case 9: jj_3_10(); break;
case 10: jj_3_11(); break;
case 11: jj_3_12(); break;
case 12: jj_3_13(); break;
case 13: jj_3_14(); break;
case 14: jj_3_15(); break;
case 15: jj_3_16(); break;
case 16: jj_3_17(); break;
case 17: jj_3_18(); break;
case 18: jj_3_19(); break;
case 19: jj_3_20(); break;
case 20: jj_3_21(); break;
case 21: jj_3_22(); break;
case 22: jj_3_23(); break;
case 23: jj_3_24(); break;
case 24: jj_3_25(); break;
case 25: jj_3_26(); break;
case 26: jj_3_27(); break;
case 27: jj_3_28(); break;
case 28: jj_3_29(); break;
case 29: jj_3_30(); break;
case 30: jj_3_31(); break;
case 31: jj_3_32(); break;
case 32: jj_3_33(); break;
case 33: jj_3_34(); break;
case 34: jj_3_35(); break;
case 35: jj_3_36(); break;
case 36: jj_3_37(); break;
case 37: jj_3_38(); break;
case 38: jj_3_39(); break;
case 39: jj_3_40(); break;
case 40: jj_3_41(); break;
case 41: jj_3_42(); break;
case 42: jj_3_43(); break;
case 43: jj_3_44(); break;
case 44: jj_3_45(); break;
case 45: jj_3_46(); break;
case 46: jj_3_47(); break;
}
}
p = p.next;
} while (p != null);
}
jj_rescan = false;
}
final private void jj_save(int index, int xla) {
JJCalls p = jj_2_rtns[index];
while (p.gen > jj_gen) {
if (p.next == null) { p = p.next = new JJCalls(); break; }
p = p.next;
}
p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
}
static final class JJCalls {
int gen;
Token first;
int arg;
JJCalls next;
}
}