1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.java Wed Apr 27 01:27:09 2016 +0800 1.3 @@ -0,0 +1,3388 @@ 1.4 +/* 1.5 + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 +/* 1.29 + * Copyright (C) 2004-2011 1.30 + * 1.31 + * Permission is hereby granted, free of charge, to any person obtaining a copy 1.32 + * of this software and associated documentation files (the "Software"), to deal 1.33 + * in the Software without restriction, including without limitation the rights 1.34 + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1.35 + * copies of the Software, and to permit persons to whom the Software is 1.36 + * furnished to do so, subject to the following conditions: 1.37 + * 1.38 + * The above copyright notice and this permission notice shall be included in 1.39 + * all copies or substantial portions of the Software. 1.40 + * 1.41 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1.42 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1.43 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1.44 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1.45 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1.46 + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 1.47 + * THE SOFTWARE. 1.48 + */ 1.49 +/* Generated By:JavaCC: Do not edit this line. CompactSyntax.java */ 1.50 +package com.sun.xml.internal.rngom.parse.compact; 1.51 + 1.52 +import java.io.Reader; 1.53 +import java.net.MalformedURLException; 1.54 +import java.net.URL; 1.55 +import java.util.Arrays; 1.56 +import java.util.ArrayList; 1.57 +import java.util.Collections; 1.58 +import java.util.Enumeration; 1.59 +import java.util.Hashtable; 1.60 +import java.util.List; 1.61 + 1.62 +import com.sun.xml.internal.rngom.ast.builder.Annotations; 1.63 +import com.sun.xml.internal.rngom.ast.builder.BuildException; 1.64 +import com.sun.xml.internal.rngom.ast.builder.CommentList; 1.65 +import com.sun.xml.internal.rngom.ast.builder.DataPatternBuilder; 1.66 +import com.sun.xml.internal.rngom.ast.builder.Div; 1.67 +import com.sun.xml.internal.rngom.ast.builder.ElementAnnotationBuilder; 1.68 +import com.sun.xml.internal.rngom.ast.builder.Grammar; 1.69 +import com.sun.xml.internal.rngom.ast.builder.GrammarSection; 1.70 +import com.sun.xml.internal.rngom.ast.builder.Include; 1.71 +import com.sun.xml.internal.rngom.ast.builder.IncludedGrammar; 1.72 +import com.sun.xml.internal.rngom.ast.builder.NameClassBuilder; 1.73 +import com.sun.xml.internal.rngom.ast.builder.SchemaBuilder; 1.74 +import com.sun.xml.internal.rngom.ast.builder.Scope; 1.75 +import com.sun.xml.internal.rngom.ast.om.Location; 1.76 +import com.sun.xml.internal.rngom.ast.om.ParsedElementAnnotation; 1.77 +import com.sun.xml.internal.rngom.ast.om.ParsedNameClass; 1.78 +import com.sun.xml.internal.rngom.ast.om.ParsedPattern; 1.79 +import com.sun.xml.internal.rngom.parse.Context; 1.80 +import com.sun.xml.internal.rngom.parse.IllegalSchemaException; 1.81 +import com.sun.xml.internal.rngom.parse.Parseable; 1.82 +import org.xml.sax.ErrorHandler; 1.83 +import org.xml.sax.SAXException; 1.84 +import org.xml.sax.SAXParseException; 1.85 +import org.xml.sax.helpers.LocatorImpl; 1.86 + 1.87 +import com.sun.xml.internal.rngom.util.Localizer; 1.88 +import com.sun.xml.internal.rngom.xml.util.WellKnownNamespaces; 1.89 + 1.90 + 1.91 +public class CompactSyntax implements Context, CompactSyntaxConstants { 1.92 + private static final int IN_ELEMENT = 0; 1.93 + private static final int IN_ATTRIBUTE = 1; 1.94 + private static final int IN_ANY_NAME = 2; 1.95 + private static final int IN_NS_NAME = 4; 1.96 + 1.97 + private String defaultNamespace; 1.98 + private String compatibilityPrefix = null; 1.99 + private SchemaBuilder sb; 1.100 + private NameClassBuilder ncb; 1.101 + private String sourceUri; 1.102 + /** 1.103 + * This is what we are parsing right now. 1.104 + */ 1.105 + private CompactParseable parseable; 1.106 + private ErrorHandler eh; 1.107 + private final Hashtable namespaceTable = new Hashtable(); 1.108 + private final Hashtable datatypesTable = new Hashtable(); 1.109 + private boolean hadError = false; 1.110 + private static final Localizer localizer = new Localizer(new Localizer(Parseable.class),CompactSyntax.class); 1.111 + private final Hashtable attributeNameTable = new Hashtable(); 1.112 + private boolean annotationsIncludeElements = false; 1.113 + 1.114 + /** 1.115 + * String that represents the inherited namespace. 1.116 + * 1.117 + * <p> 1.118 + * HACK: we always allocate a new String instance so that 1.119 + * we can distinguish inherited value from the explicitly 1.120 + * given value. 1.121 + */ 1.122 + private /*final*/ String inheritedNs; // essentially final but JavaCC don't let us declare it as so. 1.123 + 1.124 + final class LocatedString { 1.125 + private final String str; 1.126 + private final Token tok; 1.127 + 1.128 + LocatedString(String str, Token tok) { 1.129 + this.str = str; 1.130 + this.tok = tok; 1.131 + } 1.132 + 1.133 + String getString() { 1.134 + return str; 1.135 + } 1.136 + 1.137 + Location getLocation() { 1.138 + return makeLocation(tok); 1.139 + } 1.140 + 1.141 + Token getToken() { 1.142 + return tok; 1.143 + } 1.144 + 1.145 + } 1.146 + 1.147 + public CompactSyntax(CompactParseable parseable, Reader r, String sourceUri, SchemaBuilder sb, ErrorHandler eh, String inheritedNs) { 1.148 + this(r); 1.149 + this.sourceUri = sourceUri; 1.150 + this.parseable = parseable; 1.151 + this.sb = sb; 1.152 + this.ncb = sb.getNameClassBuilder(); 1.153 + this.eh = eh; 1.154 + // this causes the root pattern to have non-null annotations 1.155 + // which is useful because it gives a context to trang 1.156 + this.topLevelComments = sb.makeCommentList(); 1.157 + this.inheritedNs = defaultNamespace = new String(inheritedNs); 1.158 + } 1.159 + 1.160 + ParsedPattern parse(Scope scope) throws IllegalSchemaException { 1.161 + try { 1.162 + ParsedPattern p = Input(scope); 1.163 + if (!hadError) 1.164 + return p; 1.165 + } 1.166 + catch (ParseException e) { 1.167 + error("syntax_error", e.getMessage(), e.currentToken.next); 1.168 + } 1.169 + catch (EscapeSyntaxException e) { 1.170 + reportEscapeSyntaxException(e); 1.171 + } 1.172 + throw new IllegalSchemaException(); 1.173 + } 1.174 + 1.175 + ParsedPattern parseInclude(IncludedGrammar g) throws IllegalSchemaException { 1.176 + try { 1.177 + ParsedPattern p = IncludedGrammar(g); 1.178 + if (!hadError) 1.179 + return p; 1.180 + } 1.181 + catch (ParseException e) { 1.182 + error("syntax_error", e.getMessage(), e.currentToken.next); 1.183 + } 1.184 + catch (EscapeSyntaxException e) { 1.185 + reportEscapeSyntaxException(e); 1.186 + } 1.187 + throw new IllegalSchemaException(); 1.188 + } 1.189 + 1.190 + private void checkNsName(int context, LocatedString ns) { 1.191 + if ((context & IN_NS_NAME) != 0) 1.192 + error("ns_name_except_contains_ns_name", ns.getToken()); 1.193 + } 1.194 + 1.195 + private void checkAnyName(int context, Token t) { 1.196 + if ((context & IN_NS_NAME) != 0) 1.197 + error("ns_name_except_contains_any_name", t); 1.198 + if ((context & IN_ANY_NAME) != 0) 1.199 + error("any_name_except_contains_any_name", t); 1.200 + } 1.201 + 1.202 + private void error(String key, Token tok) { 1.203 + doError(localizer.message(key), tok); 1.204 + } 1.205 + 1.206 + private void error(String key, String arg, Token tok) { 1.207 + doError(localizer.message(key, arg), tok); 1.208 + } 1.209 + 1.210 + private void error(String key, String arg1, String arg2, Token tok) { 1.211 + doError(localizer.message(key, arg1, arg2), tok); 1.212 + } 1.213 + 1.214 + private void doError(String message, Token tok) { 1.215 + hadError = true; 1.216 + if (eh != null) { 1.217 + LocatorImpl loc = new LocatorImpl(); 1.218 + loc.setLineNumber(tok.beginLine); 1.219 + loc.setColumnNumber(tok.beginColumn); 1.220 + loc.setSystemId(sourceUri); 1.221 + try { 1.222 + eh.error(new SAXParseException(message, loc)); 1.223 + } 1.224 + catch (SAXException se) { 1.225 + throw new BuildException(se); 1.226 + } 1.227 + } 1.228 + } 1.229 + 1.230 + private void reportEscapeSyntaxException(EscapeSyntaxException e) { 1.231 + if (eh != null) { 1.232 + LocatorImpl loc = new LocatorImpl(); 1.233 + loc.setLineNumber(e.getLineNumber()); 1.234 + loc.setColumnNumber(e.getColumnNumber()); 1.235 + loc.setSystemId(sourceUri); 1.236 + try { 1.237 + eh.error(new SAXParseException(localizer.message(e.getKey()), loc)); 1.238 + } 1.239 + catch (SAXException se) { 1.240 + throw new BuildException(se); 1.241 + } 1.242 + } 1.243 + } 1.244 + 1.245 + private static String unquote(String s) { 1.246 + if (s.length() >= 6 && s.charAt(0) == s.charAt(1)) { 1.247 + s = s.replace('\u0000', '\u005cn'); 1.248 + return s.substring(3, s.length() - 3); 1.249 + } 1.250 + else 1.251 + return s.substring(1, s.length() - 1); 1.252 + } 1.253 + 1.254 + Location makeLocation(Token t) { 1.255 + return sb.makeLocation(sourceUri, t.beginLine, t.beginColumn); 1.256 + } 1.257 + 1.258 + private static ParsedPattern[] addPattern(ParsedPattern[] patterns, int i, ParsedPattern p) { 1.259 + if (i >= patterns.length) { 1.260 + ParsedPattern[] oldPatterns = patterns; 1.261 + patterns = new ParsedPattern[oldPatterns.length*2]; 1.262 + System.arraycopy(oldPatterns, 0, patterns, 0, oldPatterns.length); 1.263 + } 1.264 + patterns[i] = p; 1.265 + return patterns; 1.266 + } 1.267 + 1.268 + String getCompatibilityPrefix() { 1.269 + if (compatibilityPrefix == null) { 1.270 + compatibilityPrefix = "a"; 1.271 + while (namespaceTable.get(compatibilityPrefix) != null) 1.272 + compatibilityPrefix = compatibilityPrefix + "a"; 1.273 + } 1.274 + return compatibilityPrefix; 1.275 + } 1.276 + 1.277 + public String resolveNamespacePrefix(String prefix) { 1.278 + String result = (String)namespaceTable.get(prefix); 1.279 + if (result.length() == 0) 1.280 + return null; 1.281 + return result; 1.282 + } 1.283 + 1.284 + public Enumeration prefixes() { 1.285 + return namespaceTable.keys(); 1.286 + } 1.287 + 1.288 + public String getBaseUri() { 1.289 + return sourceUri; 1.290 + } 1.291 + 1.292 + public boolean isUnparsedEntity(String entityName) { 1.293 + return false; 1.294 + } 1.295 + 1.296 + public boolean isNotation(String notationName) { 1.297 + return false; 1.298 + } 1.299 + 1.300 + public Context copy() { 1.301 + return this; 1.302 + } 1.303 + 1.304 + private Context getContext() { 1.305 + return this; 1.306 + } 1.307 + 1.308 + private CommentList getComments() { 1.309 + return getComments(getTopLevelComments()); 1.310 + } 1.311 + 1.312 + private CommentList topLevelComments; 1.313 + 1.314 + private CommentList getTopLevelComments() { 1.315 + CommentList tem = topLevelComments; 1.316 + topLevelComments = null; 1.317 + return tem; 1.318 + } 1.319 + 1.320 + private void noteTopLevelComments() { 1.321 + topLevelComments = getComments(topLevelComments); 1.322 + } 1.323 + 1.324 + private void topLevelComments(GrammarSection section) { 1.325 + section.topLevelComment(getComments(null)); 1.326 + } 1.327 + 1.328 + private Token lastCommentSourceToken = null; 1.329 + 1.330 + private CommentList getComments(CommentList comments) { 1.331 + Token nextToken = getToken(1); 1.332 + if (lastCommentSourceToken != nextToken) { 1.333 + if (lastCommentSourceToken == null) 1.334 + lastCommentSourceToken = token; 1.335 + do { 1.336 + lastCommentSourceToken = lastCommentSourceToken.next; 1.337 + Token t = lastCommentSourceToken.specialToken; 1.338 + if (t != null) { 1.339 + while (t.specialToken != null) 1.340 + t = t.specialToken; 1.341 + if (comments == null) 1.342 + comments = sb.makeCommentList(); 1.343 + for (; t != null; t = t.next) { 1.344 + String s = mungeComment(t.image); 1.345 + Location loc = makeLocation(t); 1.346 + if (t.next != null 1.347 + && t.next.kind == CompactSyntaxConstants.SINGLE_LINE_COMMENT_CONTINUE) { 1.348 + StringBuffer buf = new StringBuffer(s); 1.349 + do { 1.350 + t = t.next; 1.351 + buf.append('\u005cn'); 1.352 + buf.append(mungeComment(t.image)); 1.353 + } while (t.next != null 1.354 + && t.next.kind == CompactSyntaxConstants.SINGLE_LINE_COMMENT_CONTINUE); 1.355 + s = buf.toString(); 1.356 + } 1.357 + comments.addComment(s, loc); 1.358 + } 1.359 + } 1.360 + } while (lastCommentSourceToken != nextToken); 1.361 + } 1.362 + return comments; 1.363 + } 1.364 + 1.365 + private ParsedPattern afterComments(ParsedPattern p) { 1.366 + CommentList comments = getComments(null); 1.367 + if (comments == null) 1.368 + return p; 1.369 + return sb.commentAfter(p, comments); 1.370 + } 1.371 + 1.372 + private ParsedNameClass afterComments(ParsedNameClass nc) { 1.373 + CommentList comments = getComments(null); 1.374 + if (comments == null) 1.375 + return nc; 1.376 + return ncb.commentAfter(nc, comments); 1.377 + } 1.378 + 1.379 + private static String mungeComment(String image) { 1.380 + int i = image.indexOf('#') + 1; 1.381 + while (i < image.length() && image.charAt(i) == '#') 1.382 + i++; 1.383 + if (i < image.length() && image.charAt(i) == ' ') 1.384 + i++; 1.385 + return image.substring(i); 1.386 + } 1.387 + 1.388 + private Annotations getCommentsAsAnnotations() { 1.389 + CommentList comments = getComments(); 1.390 + if (comments == null) 1.391 + return null; 1.392 + return sb.makeAnnotations(comments, getContext()); 1.393 + } 1.394 + 1.395 + private Annotations addCommentsToChildAnnotations(Annotations a) { 1.396 + CommentList comments = getComments(); 1.397 + if (comments == null) 1.398 + return a; 1.399 + if (a == null) 1.400 + a = sb.makeAnnotations(null, getContext()); 1.401 + a.addComment(comments); 1.402 + return a; 1.403 + } 1.404 + 1.405 + private Annotations addCommentsToLeadingAnnotations(Annotations a) { 1.406 + CommentList comments = getComments(); 1.407 + if (comments == null) 1.408 + return a; 1.409 + if (a == null) 1.410 + return sb.makeAnnotations(comments, getContext()); 1.411 + a.addLeadingComment(comments); 1.412 + return a; 1.413 + } 1.414 + 1.415 + private Annotations getTopLevelCommentsAsAnnotations() { 1.416 + CommentList comments = getTopLevelComments(); 1.417 + if (comments == null) 1.418 + return null; 1.419 + return sb.makeAnnotations(comments, getContext()); 1.420 + } 1.421 + 1.422 + private void clearAttributeList() { 1.423 + attributeNameTable.clear(); 1.424 + } 1.425 + 1.426 + private void addAttribute(Annotations a, String ns, String localName, String prefix, String value, Token tok) { 1.427 + String key = ns + "#" + localName; 1.428 + if (attributeNameTable.get(key) != null) 1.429 + error("duplicate_attribute", ns, localName, tok); 1.430 + else { 1.431 + attributeNameTable.put(key, key); 1.432 + a.addAttribute(ns, localName, prefix, value, makeLocation(tok)); 1.433 + } 1.434 + } 1.435 + 1.436 + private void checkExcept(Token[] except) { 1.437 + if (except[0] != null) 1.438 + error("except_missing_parentheses", except[0]); 1.439 + } 1.440 + 1.441 + private String lookupPrefix(String prefix, Token t) { 1.442 + String ns = (String)namespaceTable.get(prefix); 1.443 + if (ns == null) { 1.444 + error("undeclared_prefix", prefix, t); 1.445 + return "#error"; 1.446 + } 1.447 + return ns; 1.448 + } 1.449 + private String lookupDatatype(String prefix, Token t) { 1.450 + String ns = (String)datatypesTable.get(prefix); 1.451 + if (ns == null) { 1.452 + error("undeclared_prefix", prefix, t); 1.453 + return ""; // XXX 1.454 + } 1.455 + return ns; 1.456 + } 1.457 + private String resolve(String str) { 1.458 + try { 1.459 + return new URL(new URL(sourceUri), str).toString(); 1.460 + } 1.461 + catch (MalformedURLException e) { } 1.462 + return str; 1.463 + } 1.464 + 1.465 + final public ParsedPattern Input(Scope scope) throws ParseException { 1.466 + ParsedPattern p; 1.467 + Preamble(); 1.468 + if (jj_2_1(2147483647)) { 1.469 + p = TopLevelGrammar(scope); 1.470 + } else { 1.471 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.472 + case 1: 1.473 + case 10: 1.474 + case 17: 1.475 + case 18: 1.476 + case 19: 1.477 + case 26: 1.478 + case 27: 1.479 + case 28: 1.480 + case 31: 1.481 + case 32: 1.482 + case 33: 1.483 + case 34: 1.484 + case 35: 1.485 + case 36: 1.486 + case DOCUMENTATION: 1.487 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.488 + case IDENTIFIER: 1.489 + case ESCAPED_IDENTIFIER: 1.490 + case PREFIXED_NAME: 1.491 + case LITERAL: 1.492 + p = Expr(true, scope, null, null); 1.493 + p = afterComments(p); 1.494 + jj_consume_token(0); 1.495 + break; 1.496 + default: 1.497 + jj_la1[0] = jj_gen; 1.498 + jj_consume_token(-1); 1.499 + throw new ParseException(); 1.500 + } 1.501 + } 1.502 + {if (true) return p;} 1.503 + throw new Error("Missing return statement in function"); 1.504 + } 1.505 + 1.506 + final public void TopLevelLookahead() throws ParseException { 1.507 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.508 + case PREFIXED_NAME: 1.509 + jj_consume_token(PREFIXED_NAME); 1.510 + jj_consume_token(1); 1.511 + break; 1.512 + case IDENTIFIER: 1.513 + case ESCAPED_IDENTIFIER: 1.514 + Identifier(); 1.515 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.516 + case 1: 1.517 + jj_consume_token(1); 1.518 + break; 1.519 + case 2: 1.520 + jj_consume_token(2); 1.521 + break; 1.522 + case 3: 1.523 + jj_consume_token(3); 1.524 + break; 1.525 + case 4: 1.526 + jj_consume_token(4); 1.527 + break; 1.528 + default: 1.529 + jj_la1[1] = jj_gen; 1.530 + jj_consume_token(-1); 1.531 + throw new ParseException(); 1.532 + } 1.533 + break; 1.534 + case 5: 1.535 + case 6: 1.536 + case 7: 1.537 + LookaheadGrammarKeyword(); 1.538 + break; 1.539 + case 1: 1.540 + LookaheadBody(); 1.541 + LookaheadAfterAnnotations(); 1.542 + break; 1.543 + case DOCUMENTATION: 1.544 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.545 + LookaheadDocumentation(); 1.546 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.547 + case 1: 1.548 + LookaheadBody(); 1.549 + break; 1.550 + default: 1.551 + jj_la1[2] = jj_gen; 1.552 + ; 1.553 + } 1.554 + LookaheadAfterAnnotations(); 1.555 + break; 1.556 + default: 1.557 + jj_la1[3] = jj_gen; 1.558 + jj_consume_token(-1); 1.559 + throw new ParseException(); 1.560 + } 1.561 + } 1.562 + 1.563 + final public void LookaheadAfterAnnotations() throws ParseException { 1.564 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.565 + case IDENTIFIER: 1.566 + case ESCAPED_IDENTIFIER: 1.567 + Identifier(); 1.568 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.569 + case 2: 1.570 + jj_consume_token(2); 1.571 + break; 1.572 + case 3: 1.573 + jj_consume_token(3); 1.574 + break; 1.575 + case 4: 1.576 + jj_consume_token(4); 1.577 + break; 1.578 + default: 1.579 + jj_la1[4] = jj_gen; 1.580 + jj_consume_token(-1); 1.581 + throw new ParseException(); 1.582 + } 1.583 + break; 1.584 + case 5: 1.585 + case 6: 1.586 + case 7: 1.587 + LookaheadGrammarKeyword(); 1.588 + break; 1.589 + default: 1.590 + jj_la1[5] = jj_gen; 1.591 + jj_consume_token(-1); 1.592 + throw new ParseException(); 1.593 + } 1.594 + } 1.595 + 1.596 + final public void LookaheadGrammarKeyword() throws ParseException { 1.597 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.598 + case 5: 1.599 + jj_consume_token(5); 1.600 + break; 1.601 + case 6: 1.602 + jj_consume_token(6); 1.603 + break; 1.604 + case 7: 1.605 + jj_consume_token(7); 1.606 + break; 1.607 + default: 1.608 + jj_la1[6] = jj_gen; 1.609 + jj_consume_token(-1); 1.610 + throw new ParseException(); 1.611 + } 1.612 + } 1.613 + 1.614 + final public void LookaheadDocumentation() throws ParseException { 1.615 + label_1: 1.616 + while (true) { 1.617 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.618 + case DOCUMENTATION: 1.619 + jj_consume_token(DOCUMENTATION); 1.620 + break; 1.621 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.622 + jj_consume_token(DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT); 1.623 + break; 1.624 + default: 1.625 + jj_la1[7] = jj_gen; 1.626 + jj_consume_token(-1); 1.627 + throw new ParseException(); 1.628 + } 1.629 + label_2: 1.630 + while (true) { 1.631 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.632 + case DOCUMENTATION_CONTINUE: 1.633 + ; 1.634 + break; 1.635 + default: 1.636 + jj_la1[8] = jj_gen; 1.637 + break label_2; 1.638 + } 1.639 + jj_consume_token(DOCUMENTATION_CONTINUE); 1.640 + } 1.641 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.642 + case DOCUMENTATION: 1.643 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.644 + ; 1.645 + break; 1.646 + default: 1.647 + jj_la1[9] = jj_gen; 1.648 + break label_1; 1.649 + } 1.650 + } 1.651 + } 1.652 + 1.653 + final public void LookaheadBody() throws ParseException { 1.654 + jj_consume_token(1); 1.655 + label_3: 1.656 + while (true) { 1.657 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.658 + case 1: 1.659 + case 2: 1.660 + case 5: 1.661 + case 6: 1.662 + case 7: 1.663 + case 8: 1.664 + case 10: 1.665 + case 13: 1.666 + case 14: 1.667 + case 15: 1.668 + case 16: 1.669 + case 17: 1.670 + case 18: 1.671 + case 19: 1.672 + case 26: 1.673 + case 27: 1.674 + case 31: 1.675 + case 32: 1.676 + case 33: 1.677 + case 34: 1.678 + case 35: 1.679 + case 36: 1.680 + case IDENTIFIER: 1.681 + case ESCAPED_IDENTIFIER: 1.682 + case PREFIXED_NAME: 1.683 + case LITERAL: 1.684 + ; 1.685 + break; 1.686 + default: 1.687 + jj_la1[10] = jj_gen; 1.688 + break label_3; 1.689 + } 1.690 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.691 + case PREFIXED_NAME: 1.692 + jj_consume_token(PREFIXED_NAME); 1.693 + break; 1.694 + case 5: 1.695 + case 6: 1.696 + case 7: 1.697 + case 10: 1.698 + case 13: 1.699 + case 14: 1.700 + case 15: 1.701 + case 16: 1.702 + case 17: 1.703 + case 18: 1.704 + case 19: 1.705 + case 26: 1.706 + case 27: 1.707 + case 31: 1.708 + case 32: 1.709 + case 33: 1.710 + case 34: 1.711 + case 35: 1.712 + case 36: 1.713 + case IDENTIFIER: 1.714 + case ESCAPED_IDENTIFIER: 1.715 + UnprefixedName(); 1.716 + break; 1.717 + case 2: 1.718 + jj_consume_token(2); 1.719 + break; 1.720 + case LITERAL: 1.721 + jj_consume_token(LITERAL); 1.722 + break; 1.723 + case 8: 1.724 + jj_consume_token(8); 1.725 + break; 1.726 + case 1: 1.727 + LookaheadBody(); 1.728 + break; 1.729 + default: 1.730 + jj_la1[11] = jj_gen; 1.731 + jj_consume_token(-1); 1.732 + throw new ParseException(); 1.733 + } 1.734 + } 1.735 + jj_consume_token(9); 1.736 + } 1.737 + 1.738 + final public ParsedPattern IncludedGrammar(IncludedGrammar g) throws ParseException { 1.739 + Annotations a; 1.740 + ParsedPattern p; 1.741 + Preamble(); 1.742 + if (jj_2_2(2147483647)) { 1.743 + a = GrammarBody(g, g, getTopLevelCommentsAsAnnotations()); 1.744 + } else { 1.745 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.746 + case 1: 1.747 + case 10: 1.748 + case DOCUMENTATION: 1.749 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.750 + a = Annotations(); 1.751 + jj_consume_token(10); 1.752 + jj_consume_token(11); 1.753 + a = GrammarBody(g, g, a); 1.754 + topLevelComments(g); 1.755 + jj_consume_token(12); 1.756 + break; 1.757 + default: 1.758 + jj_la1[12] = jj_gen; 1.759 + jj_consume_token(-1); 1.760 + throw new ParseException(); 1.761 + } 1.762 + } 1.763 + p = afterComments(g.endIncludedGrammar(sb.makeLocation(sourceUri, 1, 1), a)); 1.764 + jj_consume_token(0); 1.765 + {if (true) return p;} 1.766 + throw new Error("Missing return statement in function"); 1.767 + } 1.768 + 1.769 + final public ParsedPattern TopLevelGrammar(Scope scope) throws ParseException { 1.770 + Annotations a = getTopLevelCommentsAsAnnotations(); 1.771 + Grammar g; 1.772 + ParsedPattern p; 1.773 + g = sb.makeGrammar(scope); 1.774 + a = GrammarBody(g, g, a); 1.775 + p = afterComments(g.endGrammar(sb.makeLocation(sourceUri, 1, 1), a)); 1.776 + jj_consume_token(0); 1.777 + {if (true) return p;} 1.778 + throw new Error("Missing return statement in function"); 1.779 + } 1.780 + 1.781 + final public void Preamble() throws ParseException { 1.782 + label_4: 1.783 + while (true) { 1.784 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.785 + case 13: 1.786 + case 14: 1.787 + case 16: 1.788 + ; 1.789 + break; 1.790 + default: 1.791 + jj_la1[13] = jj_gen; 1.792 + break label_4; 1.793 + } 1.794 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.795 + case 13: 1.796 + case 14: 1.797 + NamespaceDecl(); 1.798 + break; 1.799 + case 16: 1.800 + DatatypesDecl(); 1.801 + break; 1.802 + default: 1.803 + jj_la1[14] = jj_gen; 1.804 + jj_consume_token(-1); 1.805 + throw new ParseException(); 1.806 + } 1.807 + } 1.808 + namespaceTable.put("xml", WellKnownNamespaces.XML); 1.809 + if (datatypesTable.get("xsd") == null) 1.810 + datatypesTable.put("xsd", WellKnownNamespaces.XML_SCHEMA_DATATYPES); 1.811 + } 1.812 + 1.813 + final public void NamespaceDecl() throws ParseException { 1.814 + LocatedString prefix = null; 1.815 + boolean isDefault = false; 1.816 + String namespaceName; 1.817 + noteTopLevelComments(); 1.818 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.819 + case 13: 1.820 + jj_consume_token(13); 1.821 + prefix = UnprefixedName(); 1.822 + break; 1.823 + case 14: 1.824 + jj_consume_token(14); 1.825 + isDefault = true; 1.826 + jj_consume_token(13); 1.827 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.828 + case 5: 1.829 + case 6: 1.830 + case 7: 1.831 + case 10: 1.832 + case 13: 1.833 + case 14: 1.834 + case 15: 1.835 + case 16: 1.836 + case 17: 1.837 + case 18: 1.838 + case 19: 1.839 + case 26: 1.840 + case 27: 1.841 + case 31: 1.842 + case 32: 1.843 + case 33: 1.844 + case 34: 1.845 + case 35: 1.846 + case 36: 1.847 + case IDENTIFIER: 1.848 + case ESCAPED_IDENTIFIER: 1.849 + prefix = UnprefixedName(); 1.850 + break; 1.851 + default: 1.852 + jj_la1[15] = jj_gen; 1.853 + ; 1.854 + } 1.855 + break; 1.856 + default: 1.857 + jj_la1[16] = jj_gen; 1.858 + jj_consume_token(-1); 1.859 + throw new ParseException(); 1.860 + } 1.861 + jj_consume_token(2); 1.862 + namespaceName = NamespaceName(); 1.863 + if (isDefault) 1.864 + defaultNamespace = namespaceName; 1.865 + if (prefix != null) { 1.866 + if (prefix.getString().equals("xmlns")) 1.867 + error("xmlns_prefix", prefix.getToken()); 1.868 + else if (prefix.getString().equals("xml")) { 1.869 + if (!namespaceName.equals(WellKnownNamespaces.XML)) 1.870 + error("xml_prefix_bad_uri", prefix.getToken()); 1.871 + } 1.872 + else if (namespaceName.equals(WellKnownNamespaces.XML)) 1.873 + error("xml_uri_bad_prefix", prefix.getToken()); 1.874 + else { 1.875 + if (namespaceName.equals(WellKnownNamespaces.RELAX_NG_COMPATIBILITY_ANNOTATIONS)) 1.876 + compatibilityPrefix = prefix.getString(); 1.877 + namespaceTable.put(prefix.getString(), namespaceName); 1.878 + } 1.879 + } 1.880 + } 1.881 + 1.882 + final public String NamespaceName() throws ParseException { 1.883 + String r; 1.884 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.885 + case LITERAL: 1.886 + r = Literal(); 1.887 + break; 1.888 + case 15: 1.889 + jj_consume_token(15); 1.890 + r = this.inheritedNs; 1.891 + break; 1.892 + default: 1.893 + jj_la1[17] = jj_gen; 1.894 + jj_consume_token(-1); 1.895 + throw new ParseException(); 1.896 + } 1.897 + {if (true) return r;} 1.898 + throw new Error("Missing return statement in function"); 1.899 + } 1.900 + 1.901 + final public void DatatypesDecl() throws ParseException { 1.902 + LocatedString prefix; 1.903 + String uri; 1.904 + noteTopLevelComments(); 1.905 + jj_consume_token(16); 1.906 + prefix = UnprefixedName(); 1.907 + jj_consume_token(2); 1.908 + uri = Literal(); 1.909 + datatypesTable.put(prefix.getString(), uri); 1.910 + } 1.911 + 1.912 + final public ParsedPattern AnnotatedPrimaryExpr(boolean topLevel, Scope scope, Token[] except) throws ParseException { 1.913 + Annotations a; 1.914 + ParsedPattern p; 1.915 + ParsedElementAnnotation e; 1.916 + Token t; 1.917 + a = Annotations(); 1.918 + p = PrimaryExpr(topLevel, scope, a, except); 1.919 + label_5: 1.920 + while (true) { 1.921 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.922 + case FANNOTATE: 1.923 + ; 1.924 + break; 1.925 + default: 1.926 + jj_la1[18] = jj_gen; 1.927 + break label_5; 1.928 + } 1.929 + t = jj_consume_token(FANNOTATE); 1.930 + e = AnnotationElement(false); 1.931 + if (topLevel) 1.932 + error("top_level_follow_annotation", t); 1.933 + else 1.934 + p = sb.annotateAfter(p, e); 1.935 + } 1.936 + {if (true) return p;} 1.937 + throw new Error("Missing return statement in function"); 1.938 + } 1.939 + 1.940 + final public ParsedPattern PrimaryExpr(boolean topLevel, Scope scope, Annotations a, Token[] except) throws ParseException { 1.941 + ParsedPattern p; 1.942 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.943 + case 26: 1.944 + p = ElementExpr(scope, a); 1.945 + break; 1.946 + case 27: 1.947 + p = AttributeExpr(scope, a); 1.948 + break; 1.949 + case 10: 1.950 + p = GrammarExpr(scope, a); 1.951 + break; 1.952 + case 33: 1.953 + p = ExternalRefExpr(scope, a); 1.954 + break; 1.955 + case 31: 1.956 + p = ListExpr(scope, a); 1.957 + break; 1.958 + case 32: 1.959 + p = MixedExpr(scope, a); 1.960 + break; 1.961 + case 28: 1.962 + p = ParenExpr(topLevel, scope, a); 1.963 + break; 1.964 + case IDENTIFIER: 1.965 + case ESCAPED_IDENTIFIER: 1.966 + p = IdentifierExpr(scope, a); 1.967 + break; 1.968 + case 34: 1.969 + p = ParentExpr(scope, a); 1.970 + break; 1.971 + case 35: 1.972 + case 36: 1.973 + case PREFIXED_NAME: 1.974 + p = DataExpr(topLevel, scope, a, except); 1.975 + break; 1.976 + case LITERAL: 1.977 + p = ValueExpr(topLevel, a); 1.978 + break; 1.979 + case 18: 1.980 + p = TextExpr(a); 1.981 + break; 1.982 + case 17: 1.983 + p = EmptyExpr(a); 1.984 + break; 1.985 + case 19: 1.986 + p = NotAllowedExpr(a); 1.987 + break; 1.988 + default: 1.989 + jj_la1[19] = jj_gen; 1.990 + jj_consume_token(-1); 1.991 + throw new ParseException(); 1.992 + } 1.993 + {if (true) return p;} 1.994 + throw new Error("Missing return statement in function"); 1.995 + } 1.996 + 1.997 + final public ParsedPattern EmptyExpr(Annotations a) throws ParseException { 1.998 + Token t; 1.999 + t = jj_consume_token(17); 1.1000 + {if (true) return sb.makeEmpty(makeLocation(t), a);} 1.1001 + throw new Error("Missing return statement in function"); 1.1002 + } 1.1003 + 1.1004 + final public ParsedPattern TextExpr(Annotations a) throws ParseException { 1.1005 + Token t; 1.1006 + t = jj_consume_token(18); 1.1007 + {if (true) return sb.makeText(makeLocation(t), a);} 1.1008 + throw new Error("Missing return statement in function"); 1.1009 + } 1.1010 + 1.1011 + final public ParsedPattern NotAllowedExpr(Annotations a) throws ParseException { 1.1012 + Token t; 1.1013 + t = jj_consume_token(19); 1.1014 + {if (true) return sb.makeNotAllowed(makeLocation(t), a);} 1.1015 + throw new Error("Missing return statement in function"); 1.1016 + } 1.1017 + 1.1018 + final public ParsedPattern Expr(boolean topLevel, Scope scope, Token t, Annotations a) throws ParseException { 1.1019 + List patterns = new ArrayList(); 1.1020 + ParsedPattern p; 1.1021 + boolean[] hadOccur = new boolean[1]; 1.1022 + Token[] except = new Token[1]; 1.1023 + p = UnaryExpr(topLevel, scope, hadOccur, except); 1.1024 + patterns.add(p); 1.1025 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1026 + case 20: 1.1027 + case 21: 1.1028 + case 22: 1.1029 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1030 + case 20: 1.1031 + checkExcept(except); 1.1032 + label_6: 1.1033 + while (true) { 1.1034 + t = jj_consume_token(20); 1.1035 + p = UnaryExpr(topLevel, scope, null, except); 1.1036 + patterns.add(p); checkExcept(except); 1.1037 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1038 + case 20: 1.1039 + ; 1.1040 + break; 1.1041 + default: 1.1042 + jj_la1[20] = jj_gen; 1.1043 + break label_6; 1.1044 + } 1.1045 + } 1.1046 + p = sb.makeChoice(patterns, makeLocation(t), a); 1.1047 + break; 1.1048 + case 21: 1.1049 + label_7: 1.1050 + while (true) { 1.1051 + t = jj_consume_token(21); 1.1052 + p = UnaryExpr(topLevel, scope, null, except); 1.1053 + patterns.add(p); checkExcept(except); 1.1054 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1055 + case 21: 1.1056 + ; 1.1057 + break; 1.1058 + default: 1.1059 + jj_la1[21] = jj_gen; 1.1060 + break label_7; 1.1061 + } 1.1062 + } 1.1063 + p = sb.makeInterleave(patterns, makeLocation(t), a); 1.1064 + break; 1.1065 + case 22: 1.1066 + label_8: 1.1067 + while (true) { 1.1068 + t = jj_consume_token(22); 1.1069 + p = UnaryExpr(topLevel, scope, null, except); 1.1070 + patterns.add(p); checkExcept(except); 1.1071 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1072 + case 22: 1.1073 + ; 1.1074 + break; 1.1075 + default: 1.1076 + jj_la1[22] = jj_gen; 1.1077 + break label_8; 1.1078 + } 1.1079 + } 1.1080 + p = sb.makeGroup(patterns, makeLocation(t), a); 1.1081 + break; 1.1082 + default: 1.1083 + jj_la1[23] = jj_gen; 1.1084 + jj_consume_token(-1); 1.1085 + throw new ParseException(); 1.1086 + } 1.1087 + break; 1.1088 + default: 1.1089 + jj_la1[24] = jj_gen; 1.1090 + ; 1.1091 + } 1.1092 + if (patterns.size() == 1 && a != null) { 1.1093 + if (hadOccur[0]) 1.1094 + p = sb.annotate(p, a); 1.1095 + else 1.1096 + p = sb.makeGroup(patterns, makeLocation(t), a); 1.1097 + } 1.1098 + {if (true) return p;} 1.1099 + throw new Error("Missing return statement in function"); 1.1100 + } 1.1101 + 1.1102 + final public ParsedPattern UnaryExpr(boolean topLevel, Scope scope, boolean[] hadOccur, Token[] except) throws ParseException { 1.1103 + ParsedPattern p; 1.1104 + Token t; 1.1105 + ParsedElementAnnotation e; 1.1106 + p = AnnotatedPrimaryExpr(topLevel, scope, except); 1.1107 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1108 + case 23: 1.1109 + case 24: 1.1110 + case 25: 1.1111 + if (hadOccur != null) hadOccur[0] = true; 1.1112 + p = afterComments(p); 1.1113 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1114 + case 23: 1.1115 + t = jj_consume_token(23); 1.1116 + checkExcept(except); p = sb.makeOneOrMore(p, makeLocation(t), null); 1.1117 + break; 1.1118 + case 24: 1.1119 + t = jj_consume_token(24); 1.1120 + checkExcept(except); p = sb.makeOptional(p, makeLocation(t), null); 1.1121 + break; 1.1122 + case 25: 1.1123 + t = jj_consume_token(25); 1.1124 + checkExcept(except); p = sb.makeZeroOrMore(p, makeLocation(t), null); 1.1125 + break; 1.1126 + default: 1.1127 + jj_la1[25] = jj_gen; 1.1128 + jj_consume_token(-1); 1.1129 + throw new ParseException(); 1.1130 + } 1.1131 + label_9: 1.1132 + while (true) { 1.1133 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1134 + case FANNOTATE: 1.1135 + ; 1.1136 + break; 1.1137 + default: 1.1138 + jj_la1[26] = jj_gen; 1.1139 + break label_9; 1.1140 + } 1.1141 + t = jj_consume_token(FANNOTATE); 1.1142 + e = AnnotationElement(false); 1.1143 + if (topLevel) 1.1144 + error("top_level_follow_annotation", t); 1.1145 + else 1.1146 + p = sb.annotateAfter(p, e); 1.1147 + } 1.1148 + break; 1.1149 + default: 1.1150 + jj_la1[27] = jj_gen; 1.1151 + ; 1.1152 + } 1.1153 + {if (true) return p;} 1.1154 + throw new Error("Missing return statement in function"); 1.1155 + } 1.1156 + 1.1157 + final public ParsedPattern ElementExpr(Scope scope, Annotations a) throws ParseException { 1.1158 + Token t; 1.1159 + ParsedNameClass nc; 1.1160 + ParsedPattern p; 1.1161 + t = jj_consume_token(26); 1.1162 + nc = NameClass(IN_ELEMENT, null); 1.1163 + jj_consume_token(11); 1.1164 + p = Expr(false, scope, null, null); 1.1165 + p = afterComments(p); 1.1166 + jj_consume_token(12); 1.1167 + {if (true) return sb.makeElement(nc, p, makeLocation(t), a);} 1.1168 + throw new Error("Missing return statement in function"); 1.1169 + } 1.1170 + 1.1171 + final public ParsedPattern AttributeExpr(Scope scope, Annotations a) throws ParseException { 1.1172 + Token t; 1.1173 + ParsedNameClass nc; 1.1174 + ParsedPattern p; 1.1175 + t = jj_consume_token(27); 1.1176 + nc = NameClass(IN_ATTRIBUTE, null); 1.1177 + jj_consume_token(11); 1.1178 + p = Expr(false, scope, null, null); 1.1179 + p = afterComments(p); 1.1180 + jj_consume_token(12); 1.1181 + {if (true) return sb.makeAttribute(nc, p, makeLocation(t), a);} 1.1182 + throw new Error("Missing return statement in function"); 1.1183 + } 1.1184 + 1.1185 + final public ParsedNameClass NameClass(int context, Annotations[] pa) throws ParseException { 1.1186 + Annotations a; 1.1187 + ParsedNameClass nc; 1.1188 + a = Annotations(); 1.1189 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1190 + case 5: 1.1191 + case 6: 1.1192 + case 7: 1.1193 + case 10: 1.1194 + case 13: 1.1195 + case 14: 1.1196 + case 15: 1.1197 + case 16: 1.1198 + case 17: 1.1199 + case 18: 1.1200 + case 19: 1.1201 + case 26: 1.1202 + case 27: 1.1203 + case 28: 1.1204 + case 31: 1.1205 + case 32: 1.1206 + case 33: 1.1207 + case 34: 1.1208 + case 35: 1.1209 + case 36: 1.1210 + case IDENTIFIER: 1.1211 + case ESCAPED_IDENTIFIER: 1.1212 + case PREFIXED_NAME: 1.1213 + nc = PrimaryNameClass(context, a); 1.1214 + nc = AnnotateAfter(nc); 1.1215 + nc = NameClassAlternatives(context, nc, pa); 1.1216 + break; 1.1217 + case 25: 1.1218 + nc = AnyNameExceptClass(context, a, pa); 1.1219 + break; 1.1220 + case PREFIX_STAR: 1.1221 + nc = NsNameExceptClass(context, a, pa); 1.1222 + break; 1.1223 + default: 1.1224 + jj_la1[28] = jj_gen; 1.1225 + jj_consume_token(-1); 1.1226 + throw new ParseException(); 1.1227 + } 1.1228 + {if (true) return nc;} 1.1229 + throw new Error("Missing return statement in function"); 1.1230 + } 1.1231 + 1.1232 + final public ParsedNameClass AnnotateAfter(ParsedNameClass nc) throws ParseException { 1.1233 + ParsedElementAnnotation e; 1.1234 + label_10: 1.1235 + while (true) { 1.1236 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1237 + case FANNOTATE: 1.1238 + ; 1.1239 + break; 1.1240 + default: 1.1241 + jj_la1[29] = jj_gen; 1.1242 + break label_10; 1.1243 + } 1.1244 + jj_consume_token(FANNOTATE); 1.1245 + e = AnnotationElement(false); 1.1246 + nc = ncb.annotateAfter(nc, e); 1.1247 + } 1.1248 + {if (true) return nc;} 1.1249 + throw new Error("Missing return statement in function"); 1.1250 + } 1.1251 + 1.1252 + final public ParsedNameClass NameClassAlternatives(int context, ParsedNameClass nc, Annotations[] pa) throws ParseException { 1.1253 + Token t; 1.1254 + ParsedNameClass[] nameClasses; 1.1255 + int nNameClasses; 1.1256 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1257 + case 20: 1.1258 + nameClasses = new ParsedNameClass[2]; 1.1259 + nameClasses[0] = nc; 1.1260 + nNameClasses = 1; 1.1261 + label_11: 1.1262 + while (true) { 1.1263 + t = jj_consume_token(20); 1.1264 + nc = BasicNameClass(context); 1.1265 + nc = AnnotateAfter(nc); 1.1266 + if (nNameClasses >= nameClasses.length) { 1.1267 + ParsedNameClass[] oldNameClasses = nameClasses; 1.1268 + nameClasses = new ParsedNameClass[oldNameClasses.length*2]; 1.1269 + System.arraycopy(oldNameClasses, 0, nameClasses, 0, oldNameClasses.length); 1.1270 + } 1.1271 + nameClasses[nNameClasses++] = nc; 1.1272 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1273 + case 20: 1.1274 + ; 1.1275 + break; 1.1276 + default: 1.1277 + jj_la1[30] = jj_gen; 1.1278 + break label_11; 1.1279 + } 1.1280 + } 1.1281 + Annotations a; 1.1282 + if (pa == null) 1.1283 + a = null; 1.1284 + else { 1.1285 + a = pa[0]; 1.1286 + pa[0] = null; 1.1287 + } 1.1288 + nc = ncb.makeChoice(Arrays.asList(nameClasses).subList(0,nNameClasses), makeLocation(t), a); 1.1289 + break; 1.1290 + default: 1.1291 + jj_la1[31] = jj_gen; 1.1292 + ; 1.1293 + } 1.1294 + {if (true) return nc;} 1.1295 + throw new Error("Missing return statement in function"); 1.1296 + } 1.1297 + 1.1298 + final public ParsedNameClass BasicNameClass(int context) throws ParseException { 1.1299 + Annotations a; 1.1300 + ParsedNameClass nc; 1.1301 + a = Annotations(); 1.1302 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1303 + case 5: 1.1304 + case 6: 1.1305 + case 7: 1.1306 + case 10: 1.1307 + case 13: 1.1308 + case 14: 1.1309 + case 15: 1.1310 + case 16: 1.1311 + case 17: 1.1312 + case 18: 1.1313 + case 19: 1.1314 + case 26: 1.1315 + case 27: 1.1316 + case 28: 1.1317 + case 31: 1.1318 + case 32: 1.1319 + case 33: 1.1320 + case 34: 1.1321 + case 35: 1.1322 + case 36: 1.1323 + case IDENTIFIER: 1.1324 + case ESCAPED_IDENTIFIER: 1.1325 + case PREFIXED_NAME: 1.1326 + nc = PrimaryNameClass(context, a); 1.1327 + break; 1.1328 + case 25: 1.1329 + case PREFIX_STAR: 1.1330 + nc = OpenNameClass(context, a); 1.1331 + break; 1.1332 + default: 1.1333 + jj_la1[32] = jj_gen; 1.1334 + jj_consume_token(-1); 1.1335 + throw new ParseException(); 1.1336 + } 1.1337 + {if (true) return nc;} 1.1338 + throw new Error("Missing return statement in function"); 1.1339 + } 1.1340 + 1.1341 + final public ParsedNameClass PrimaryNameClass(int context, Annotations a) throws ParseException { 1.1342 + ParsedNameClass nc; 1.1343 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1344 + case 5: 1.1345 + case 6: 1.1346 + case 7: 1.1347 + case 10: 1.1348 + case 13: 1.1349 + case 14: 1.1350 + case 15: 1.1351 + case 16: 1.1352 + case 17: 1.1353 + case 18: 1.1354 + case 19: 1.1355 + case 26: 1.1356 + case 27: 1.1357 + case 31: 1.1358 + case 32: 1.1359 + case 33: 1.1360 + case 34: 1.1361 + case 35: 1.1362 + case 36: 1.1363 + case IDENTIFIER: 1.1364 + case ESCAPED_IDENTIFIER: 1.1365 + nc = UnprefixedNameClass(context, a); 1.1366 + break; 1.1367 + case PREFIXED_NAME: 1.1368 + nc = PrefixedNameClass(a); 1.1369 + break; 1.1370 + case 28: 1.1371 + nc = ParenNameClass(context, a); 1.1372 + break; 1.1373 + default: 1.1374 + jj_la1[33] = jj_gen; 1.1375 + jj_consume_token(-1); 1.1376 + throw new ParseException(); 1.1377 + } 1.1378 + {if (true) return nc;} 1.1379 + throw new Error("Missing return statement in function"); 1.1380 + } 1.1381 + 1.1382 + final public ParsedNameClass OpenNameClass(int context, Annotations a) throws ParseException { 1.1383 + Token t; 1.1384 + LocatedString ns; 1.1385 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1386 + case PREFIX_STAR: 1.1387 + ns = NsName(); 1.1388 + checkNsName(context, ns); {if (true) return ncb.makeNsName(ns.getString(), ns.getLocation(), a);} 1.1389 + break; 1.1390 + case 25: 1.1391 + t = jj_consume_token(25); 1.1392 + checkAnyName(context, t); {if (true) return ncb.makeAnyName(makeLocation(t), a);} 1.1393 + break; 1.1394 + default: 1.1395 + jj_la1[34] = jj_gen; 1.1396 + jj_consume_token(-1); 1.1397 + throw new ParseException(); 1.1398 + } 1.1399 + throw new Error("Missing return statement in function"); 1.1400 + } 1.1401 + 1.1402 + final public ParsedNameClass UnprefixedNameClass(int context, Annotations a) throws ParseException { 1.1403 + LocatedString name; 1.1404 + name = UnprefixedName(); 1.1405 + String ns; 1.1406 + if ((context & (IN_ATTRIBUTE|IN_ELEMENT)) == IN_ATTRIBUTE) 1.1407 + ns = ""; 1.1408 + else 1.1409 + ns = defaultNamespace; 1.1410 + {if (true) return ncb.makeName(ns, name.getString(), null, name.getLocation(), a);} 1.1411 + throw new Error("Missing return statement in function"); 1.1412 + } 1.1413 + 1.1414 + final public ParsedNameClass PrefixedNameClass(Annotations a) throws ParseException { 1.1415 + Token t; 1.1416 + t = jj_consume_token(PREFIXED_NAME); 1.1417 + String qn = t.image; 1.1418 + int colon = qn.indexOf(':'); 1.1419 + String prefix = qn.substring(0, colon); 1.1420 + {if (true) return ncb.makeName(lookupPrefix(prefix, t), qn.substring(colon + 1), prefix, makeLocation(t), a);} 1.1421 + throw new Error("Missing return statement in function"); 1.1422 + } 1.1423 + 1.1424 + final public ParsedNameClass NsNameExceptClass(int context, Annotations a, Annotations[] pa) throws ParseException { 1.1425 + LocatedString ns; 1.1426 + ParsedNameClass nc; 1.1427 + ns = NsName(); 1.1428 + checkNsName(context, ns); 1.1429 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1430 + case 30: 1.1431 + nc = ExceptNameClass(context | IN_NS_NAME); 1.1432 + nc = ncb.makeNsName(ns.getString(), nc, ns.getLocation(), a); 1.1433 + nc = AnnotateAfter(nc); 1.1434 + break; 1.1435 + default: 1.1436 + jj_la1[35] = jj_gen; 1.1437 + nc = ncb.makeNsName(ns.getString(), ns.getLocation(), a); 1.1438 + nc = AnnotateAfter(nc); 1.1439 + nc = NameClassAlternatives(context, nc, pa); 1.1440 + } 1.1441 + {if (true) return nc;} 1.1442 + throw new Error("Missing return statement in function"); 1.1443 + } 1.1444 + 1.1445 + final public LocatedString NsName() throws ParseException { 1.1446 + Token t; 1.1447 + t = jj_consume_token(PREFIX_STAR); 1.1448 + String qn = t.image; 1.1449 + String prefix = qn.substring(0, qn.length() - 2); 1.1450 + {if (true) return new LocatedString(lookupPrefix(prefix, t), t);} 1.1451 + throw new Error("Missing return statement in function"); 1.1452 + } 1.1453 + 1.1454 + final public ParsedNameClass AnyNameExceptClass(int context, Annotations a, Annotations[] pa) throws ParseException { 1.1455 + Token t; 1.1456 + ParsedNameClass nc; 1.1457 + t = jj_consume_token(25); 1.1458 + checkAnyName(context, t); 1.1459 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1460 + case 30: 1.1461 + nc = ExceptNameClass(context | IN_ANY_NAME); 1.1462 + nc = ncb.makeAnyName(nc, makeLocation(t), a); 1.1463 + nc = AnnotateAfter(nc); 1.1464 + break; 1.1465 + default: 1.1466 + jj_la1[36] = jj_gen; 1.1467 + nc = ncb.makeAnyName(makeLocation(t), a); 1.1468 + nc = AnnotateAfter(nc); 1.1469 + nc = NameClassAlternatives(context, nc, pa); 1.1470 + } 1.1471 + {if (true) return nc;} 1.1472 + throw new Error("Missing return statement in function"); 1.1473 + } 1.1474 + 1.1475 + final public ParsedNameClass ParenNameClass(int context, Annotations a) throws ParseException { 1.1476 + Token t; 1.1477 + ParsedNameClass nc; 1.1478 + Annotations[] pa = new Annotations[]{ a }; 1.1479 + t = jj_consume_token(28); 1.1480 + nc = NameClass(context, pa); 1.1481 + nc = afterComments(nc); 1.1482 + jj_consume_token(29); 1.1483 + if (pa[0] != null) 1.1484 + nc = ncb.makeChoice(Collections.singletonList(nc), makeLocation(t), pa[0]); 1.1485 + {if (true) return nc;} 1.1486 + throw new Error("Missing return statement in function"); 1.1487 + } 1.1488 + 1.1489 + final public ParsedNameClass ExceptNameClass(int context) throws ParseException { 1.1490 + ParsedNameClass nc; 1.1491 + jj_consume_token(30); 1.1492 + nc = BasicNameClass(context); 1.1493 + {if (true) return nc;} 1.1494 + throw new Error("Missing return statement in function"); 1.1495 + } 1.1496 + 1.1497 + final public ParsedPattern ListExpr(Scope scope, Annotations a) throws ParseException { 1.1498 + Token t; 1.1499 + ParsedPattern p; 1.1500 + t = jj_consume_token(31); 1.1501 + jj_consume_token(11); 1.1502 + p = Expr(false, scope, null, null); 1.1503 + p = afterComments(p); 1.1504 + jj_consume_token(12); 1.1505 + {if (true) return sb.makeList(p, makeLocation(t), a);} 1.1506 + throw new Error("Missing return statement in function"); 1.1507 + } 1.1508 + 1.1509 + final public ParsedPattern MixedExpr(Scope scope, Annotations a) throws ParseException { 1.1510 + Token t; 1.1511 + ParsedPattern p; 1.1512 + t = jj_consume_token(32); 1.1513 + jj_consume_token(11); 1.1514 + p = Expr(false, scope, null, null); 1.1515 + p = afterComments(p); 1.1516 + jj_consume_token(12); 1.1517 + {if (true) return sb.makeMixed(p, makeLocation(t), a);} 1.1518 + throw new Error("Missing return statement in function"); 1.1519 + } 1.1520 + 1.1521 + final public ParsedPattern GrammarExpr(Scope scope, Annotations a) throws ParseException { 1.1522 + Token t; 1.1523 + Grammar g; 1.1524 + t = jj_consume_token(10); 1.1525 + g = sb.makeGrammar(scope); 1.1526 + jj_consume_token(11); 1.1527 + a = GrammarBody(g, g, a); 1.1528 + topLevelComments(g); 1.1529 + jj_consume_token(12); 1.1530 + {if (true) return g.endGrammar(makeLocation(t), a);} 1.1531 + throw new Error("Missing return statement in function"); 1.1532 + } 1.1533 + 1.1534 + final public ParsedPattern ParenExpr(boolean topLevel, Scope scope, Annotations a) throws ParseException { 1.1535 + Token t; 1.1536 + ParsedPattern p; 1.1537 + t = jj_consume_token(28); 1.1538 + p = Expr(topLevel, scope, t, a); 1.1539 + p = afterComments(p); 1.1540 + jj_consume_token(29); 1.1541 + {if (true) return p;} 1.1542 + throw new Error("Missing return statement in function"); 1.1543 + } 1.1544 + 1.1545 + final public Annotations GrammarBody(GrammarSection section, Scope scope, Annotations a) throws ParseException { 1.1546 + ParsedElementAnnotation e; 1.1547 + label_12: 1.1548 + while (true) { 1.1549 + if (jj_2_3(2)) { 1.1550 + ; 1.1551 + } else { 1.1552 + break label_12; 1.1553 + } 1.1554 + e = AnnotationElementNotKeyword(); 1.1555 + if (a == null) a = sb.makeAnnotations(null, getContext()); a.addElement(e); 1.1556 + } 1.1557 + label_13: 1.1558 + while (true) { 1.1559 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1560 + case 1: 1.1561 + case 5: 1.1562 + case 6: 1.1563 + case 7: 1.1564 + case DOCUMENTATION: 1.1565 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.1566 + case IDENTIFIER: 1.1567 + case ESCAPED_IDENTIFIER: 1.1568 + ; 1.1569 + break; 1.1570 + default: 1.1571 + jj_la1[37] = jj_gen; 1.1572 + break label_13; 1.1573 + } 1.1574 + GrammarComponent(section, scope); 1.1575 + } 1.1576 + {if (true) return a;} 1.1577 + throw new Error("Missing return statement in function"); 1.1578 + } 1.1579 + 1.1580 + final public void GrammarComponent(GrammarSection section, Scope scope) throws ParseException { 1.1581 + ParsedElementAnnotation e; 1.1582 + Annotations a; 1.1583 + a = Annotations(); 1.1584 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1585 + case 5: 1.1586 + case IDENTIFIER: 1.1587 + case ESCAPED_IDENTIFIER: 1.1588 + Definition(section, scope, a); 1.1589 + break; 1.1590 + case 7: 1.1591 + Include(section, scope, a); 1.1592 + break; 1.1593 + case 6: 1.1594 + Div(section, scope, a); 1.1595 + break; 1.1596 + default: 1.1597 + jj_la1[38] = jj_gen; 1.1598 + jj_consume_token(-1); 1.1599 + throw new ParseException(); 1.1600 + } 1.1601 + label_14: 1.1602 + while (true) { 1.1603 + if (jj_2_4(2)) { 1.1604 + ; 1.1605 + } else { 1.1606 + break label_14; 1.1607 + } 1.1608 + e = AnnotationElementNotKeyword(); 1.1609 + section.topLevelAnnotation(e); 1.1610 + } 1.1611 + } 1.1612 + 1.1613 + final public void Definition(GrammarSection section, Scope scope, Annotations a) throws ParseException { 1.1614 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1615 + case IDENTIFIER: 1.1616 + case ESCAPED_IDENTIFIER: 1.1617 + Define(section, scope, a); 1.1618 + break; 1.1619 + case 5: 1.1620 + Start(section, scope, a); 1.1621 + break; 1.1622 + default: 1.1623 + jj_la1[39] = jj_gen; 1.1624 + jj_consume_token(-1); 1.1625 + throw new ParseException(); 1.1626 + } 1.1627 + } 1.1628 + 1.1629 + final public void Start(GrammarSection section, Scope scope, Annotations a) throws ParseException { 1.1630 + Token t; 1.1631 + GrammarSection.Combine combine; 1.1632 + ParsedPattern p; 1.1633 + t = jj_consume_token(5); 1.1634 + combine = AssignOp(); 1.1635 + p = Expr(false, scope, null, null); 1.1636 + section.define(GrammarSection.START, combine, p, makeLocation(t), a); 1.1637 + } 1.1638 + 1.1639 + final public void Define(GrammarSection section, Scope scope, Annotations a) throws ParseException { 1.1640 + LocatedString name; 1.1641 + GrammarSection.Combine combine; 1.1642 + ParsedPattern p; 1.1643 + name = Identifier(); 1.1644 + combine = AssignOp(); 1.1645 + p = Expr(false, scope, null, null); 1.1646 + section.define(name.getString(), combine, p, name.getLocation(), a); 1.1647 + } 1.1648 + 1.1649 + final public GrammarSection.Combine AssignOp() throws ParseException { 1.1650 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1651 + case 2: 1.1652 + jj_consume_token(2); 1.1653 + {if (true) return null;} 1.1654 + break; 1.1655 + case 4: 1.1656 + jj_consume_token(4); 1.1657 + {if (true) return GrammarSection.COMBINE_CHOICE;} 1.1658 + break; 1.1659 + case 3: 1.1660 + jj_consume_token(3); 1.1661 + {if (true) return GrammarSection.COMBINE_INTERLEAVE;} 1.1662 + break; 1.1663 + default: 1.1664 + jj_la1[40] = jj_gen; 1.1665 + jj_consume_token(-1); 1.1666 + throw new ParseException(); 1.1667 + } 1.1668 + throw new Error("Missing return statement in function"); 1.1669 + } 1.1670 + 1.1671 + final public void Include(GrammarSection section, Scope scope, Annotations a) throws ParseException { 1.1672 + Token t; 1.1673 + String href; 1.1674 + String ns; 1.1675 + Include include = section.makeInclude(); 1.1676 + t = jj_consume_token(7); 1.1677 + href = Literal(); 1.1678 + ns = Inherit(); 1.1679 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1680 + case 11: 1.1681 + jj_consume_token(11); 1.1682 + a = IncludeBody(include, scope, a); 1.1683 + topLevelComments(include); 1.1684 + jj_consume_token(12); 1.1685 + break; 1.1686 + default: 1.1687 + jj_la1[41] = jj_gen; 1.1688 + ; 1.1689 + } 1.1690 + try { 1.1691 + include.endInclude(parseable, resolve(href), ns, makeLocation(t), a); 1.1692 + } 1.1693 + catch (IllegalSchemaException e) { } 1.1694 + } 1.1695 + 1.1696 + final public Annotations IncludeBody(GrammarSection section, Scope scope, Annotations a) throws ParseException { 1.1697 + ParsedElementAnnotation e; 1.1698 + label_15: 1.1699 + while (true) { 1.1700 + if (jj_2_5(2)) { 1.1701 + ; 1.1702 + } else { 1.1703 + break label_15; 1.1704 + } 1.1705 + e = AnnotationElementNotKeyword(); 1.1706 + if (a == null) a = sb.makeAnnotations(null, getContext()); a.addElement(e); 1.1707 + } 1.1708 + label_16: 1.1709 + while (true) { 1.1710 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1711 + case 1: 1.1712 + case 5: 1.1713 + case 6: 1.1714 + case DOCUMENTATION: 1.1715 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.1716 + case IDENTIFIER: 1.1717 + case ESCAPED_IDENTIFIER: 1.1718 + ; 1.1719 + break; 1.1720 + default: 1.1721 + jj_la1[42] = jj_gen; 1.1722 + break label_16; 1.1723 + } 1.1724 + IncludeComponent(section, scope); 1.1725 + } 1.1726 + {if (true) return a;} 1.1727 + throw new Error("Missing return statement in function"); 1.1728 + } 1.1729 + 1.1730 + final public void IncludeComponent(GrammarSection section, Scope scope) throws ParseException { 1.1731 + ParsedElementAnnotation e; 1.1732 + Annotations a; 1.1733 + a = Annotations(); 1.1734 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1735 + case 5: 1.1736 + case IDENTIFIER: 1.1737 + case ESCAPED_IDENTIFIER: 1.1738 + Definition(section, scope, a); 1.1739 + break; 1.1740 + case 6: 1.1741 + IncludeDiv(section, scope, a); 1.1742 + break; 1.1743 + default: 1.1744 + jj_la1[43] = jj_gen; 1.1745 + jj_consume_token(-1); 1.1746 + throw new ParseException(); 1.1747 + } 1.1748 + label_17: 1.1749 + while (true) { 1.1750 + if (jj_2_6(2)) { 1.1751 + ; 1.1752 + } else { 1.1753 + break label_17; 1.1754 + } 1.1755 + e = AnnotationElementNotKeyword(); 1.1756 + section.topLevelAnnotation(e); 1.1757 + } 1.1758 + } 1.1759 + 1.1760 + final public void Div(GrammarSection section, Scope scope, Annotations a) throws ParseException { 1.1761 + Token t; 1.1762 + Div div = section.makeDiv(); 1.1763 + t = jj_consume_token(6); 1.1764 + jj_consume_token(11); 1.1765 + a = GrammarBody(div, scope, a); 1.1766 + topLevelComments(div); 1.1767 + jj_consume_token(12); 1.1768 + div.endDiv(makeLocation(t), a); 1.1769 + } 1.1770 + 1.1771 + final public void IncludeDiv(GrammarSection section, Scope scope, Annotations a) throws ParseException { 1.1772 + Token t; 1.1773 + Div div = section.makeDiv(); 1.1774 + t = jj_consume_token(6); 1.1775 + jj_consume_token(11); 1.1776 + a = IncludeBody(div, scope, a); 1.1777 + topLevelComments(div); 1.1778 + jj_consume_token(12); 1.1779 + div.endDiv(makeLocation(t), a); 1.1780 + } 1.1781 + 1.1782 + final public ParsedPattern ExternalRefExpr(Scope scope, Annotations a) throws ParseException { 1.1783 + Token t; 1.1784 + String href; 1.1785 + String ns; 1.1786 + t = jj_consume_token(33); 1.1787 + href = Literal(); 1.1788 + ns = Inherit(); 1.1789 + try { 1.1790 + {if (true) return sb.makeExternalRef(parseable, resolve(href), ns, scope, makeLocation(t), a);} 1.1791 + } 1.1792 + catch (IllegalSchemaException e) { 1.1793 + {if (true) return sb.makeErrorPattern();} 1.1794 + } 1.1795 + throw new Error("Missing return statement in function"); 1.1796 + } 1.1797 + 1.1798 + final public String Inherit() throws ParseException { 1.1799 + String ns = null; 1.1800 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1801 + case 15: 1.1802 + jj_consume_token(15); 1.1803 + jj_consume_token(2); 1.1804 + ns = Prefix(); 1.1805 + break; 1.1806 + default: 1.1807 + jj_la1[44] = jj_gen; 1.1808 + ; 1.1809 + } 1.1810 + if (ns == null) 1.1811 + ns = defaultNamespace; 1.1812 + {if (true) return ns;} 1.1813 + throw new Error("Missing return statement in function"); 1.1814 + } 1.1815 + 1.1816 + final public ParsedPattern ParentExpr(Scope scope, Annotations a) throws ParseException { 1.1817 + LocatedString name; 1.1818 + jj_consume_token(34); 1.1819 + a = addCommentsToChildAnnotations(a); 1.1820 + name = Identifier(); 1.1821 + if(scope==null) { 1.1822 + error("parent_ref_outside_grammar",name.getToken()); 1.1823 + {if (true) return sb.makeErrorPattern();} 1.1824 + } else { 1.1825 + {if (true) return scope.makeParentRef(name.getString(), name.getLocation(), a);} 1.1826 + } 1.1827 + throw new Error("Missing return statement in function"); 1.1828 + } 1.1829 + 1.1830 + final public ParsedPattern IdentifierExpr(Scope scope, Annotations a) throws ParseException { 1.1831 + LocatedString name; 1.1832 + name = Identifier(); 1.1833 + if(scope==null) { 1.1834 + error("ref_outside_grammar",name.getToken()); 1.1835 + {if (true) return sb.makeErrorPattern();} 1.1836 + } else { 1.1837 + {if (true) return scope.makeRef(name.getString(), name.getLocation(), a);} 1.1838 + } 1.1839 + throw new Error("Missing return statement in function"); 1.1840 + } 1.1841 + 1.1842 + final public ParsedPattern ValueExpr(boolean topLevel, Annotations a) throws ParseException { 1.1843 + LocatedString s; 1.1844 + s = LocatedLiteral(); 1.1845 + if (topLevel && annotationsIncludeElements) { 1.1846 + error("top_level_follow_annotation", s.getToken()); 1.1847 + a = null; 1.1848 + } 1.1849 + {if (true) return sb.makeValue("", "token", s.getString(), getContext(), defaultNamespace, s.getLocation(), a);} 1.1850 + throw new Error("Missing return statement in function"); 1.1851 + } 1.1852 + 1.1853 + final public ParsedPattern DataExpr(boolean topLevel, Scope scope, Annotations a, Token[] except) throws ParseException { 1.1854 + Token datatypeToken; 1.1855 + Location loc; 1.1856 + String datatype; 1.1857 + String datatypeUri = null; 1.1858 + String s = null; 1.1859 + ParsedPattern e = null; 1.1860 + DataPatternBuilder dpb; 1.1861 + datatypeToken = DatatypeName(); 1.1862 + datatype = datatypeToken.image; 1.1863 + loc = makeLocation(datatypeToken); 1.1864 + int colon = datatype.indexOf(':'); 1.1865 + if (colon < 0) 1.1866 + datatypeUri = ""; 1.1867 + else { 1.1868 + String prefix = datatype.substring(0, colon); 1.1869 + datatypeUri = lookupDatatype(prefix, datatypeToken); 1.1870 + datatype = datatype.substring(colon + 1); 1.1871 + } 1.1872 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1873 + case LITERAL: 1.1874 + s = Literal(); 1.1875 + if (topLevel && annotationsIncludeElements) { 1.1876 + error("top_level_follow_annotation", datatypeToken); 1.1877 + a = null; 1.1878 + } 1.1879 + {if (true) return sb.makeValue(datatypeUri, datatype, s, getContext(), defaultNamespace, loc, a);} 1.1880 + break; 1.1881 + default: 1.1882 + jj_la1[48] = jj_gen; 1.1883 + dpb = sb.makeDataPatternBuilder(datatypeUri, datatype, loc); 1.1884 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1885 + case 11: 1.1886 + Params(dpb); 1.1887 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1888 + case 30: 1.1889 + e = Except(scope, except); 1.1890 + break; 1.1891 + default: 1.1892 + jj_la1[45] = jj_gen; 1.1893 + ; 1.1894 + } 1.1895 + break; 1.1896 + default: 1.1897 + jj_la1[47] = jj_gen; 1.1898 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1899 + case 30: 1.1900 + e = Except(scope, except); 1.1901 + break; 1.1902 + default: 1.1903 + jj_la1[46] = jj_gen; 1.1904 + ; 1.1905 + } 1.1906 + } 1.1907 + {if (true) return e == null ? dpb.makePattern(loc, a) : dpb.makePattern(e, loc, a);} 1.1908 + } 1.1909 + throw new Error("Missing return statement in function"); 1.1910 + } 1.1911 + 1.1912 + final public Token DatatypeName() throws ParseException { 1.1913 + Token t; 1.1914 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1915 + case 35: 1.1916 + t = jj_consume_token(35); 1.1917 + break; 1.1918 + case 36: 1.1919 + t = jj_consume_token(36); 1.1920 + break; 1.1921 + case PREFIXED_NAME: 1.1922 + t = jj_consume_token(PREFIXED_NAME); 1.1923 + break; 1.1924 + default: 1.1925 + jj_la1[49] = jj_gen; 1.1926 + jj_consume_token(-1); 1.1927 + throw new ParseException(); 1.1928 + } 1.1929 + {if (true) return t;} 1.1930 + throw new Error("Missing return statement in function"); 1.1931 + } 1.1932 + 1.1933 + final public LocatedString Identifier() throws ParseException { 1.1934 + LocatedString s; 1.1935 + Token t; 1.1936 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1937 + case IDENTIFIER: 1.1938 + t = jj_consume_token(IDENTIFIER); 1.1939 + s = new LocatedString(t.image, t); 1.1940 + break; 1.1941 + case ESCAPED_IDENTIFIER: 1.1942 + t = jj_consume_token(ESCAPED_IDENTIFIER); 1.1943 + s = new LocatedString(t.image.substring(1), t); 1.1944 + break; 1.1945 + default: 1.1946 + jj_la1[50] = jj_gen; 1.1947 + jj_consume_token(-1); 1.1948 + throw new ParseException(); 1.1949 + } 1.1950 + {if (true) return s;} 1.1951 + throw new Error("Missing return statement in function"); 1.1952 + } 1.1953 + 1.1954 + final public String Prefix() throws ParseException { 1.1955 + Token t; 1.1956 + String prefix; 1.1957 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.1958 + case IDENTIFIER: 1.1959 + t = jj_consume_token(IDENTIFIER); 1.1960 + prefix = t.image; 1.1961 + break; 1.1962 + case ESCAPED_IDENTIFIER: 1.1963 + t = jj_consume_token(ESCAPED_IDENTIFIER); 1.1964 + prefix = t.image.substring(1); 1.1965 + break; 1.1966 + case 5: 1.1967 + case 6: 1.1968 + case 7: 1.1969 + case 10: 1.1970 + case 13: 1.1971 + case 14: 1.1972 + case 15: 1.1973 + case 16: 1.1974 + case 17: 1.1975 + case 18: 1.1976 + case 19: 1.1977 + case 26: 1.1978 + case 27: 1.1979 + case 31: 1.1980 + case 32: 1.1981 + case 33: 1.1982 + case 34: 1.1983 + case 35: 1.1984 + case 36: 1.1985 + t = Keyword(); 1.1986 + prefix = t.image; 1.1987 + break; 1.1988 + default: 1.1989 + jj_la1[51] = jj_gen; 1.1990 + jj_consume_token(-1); 1.1991 + throw new ParseException(); 1.1992 + } 1.1993 + {if (true) return lookupPrefix(prefix, t);} 1.1994 + throw new Error("Missing return statement in function"); 1.1995 + } 1.1996 + 1.1997 + final public LocatedString UnprefixedName() throws ParseException { 1.1998 + LocatedString s; 1.1999 + Token t; 1.2000 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2001 + case IDENTIFIER: 1.2002 + case ESCAPED_IDENTIFIER: 1.2003 + s = Identifier(); 1.2004 + break; 1.2005 + case 5: 1.2006 + case 6: 1.2007 + case 7: 1.2008 + case 10: 1.2009 + case 13: 1.2010 + case 14: 1.2011 + case 15: 1.2012 + case 16: 1.2013 + case 17: 1.2014 + case 18: 1.2015 + case 19: 1.2016 + case 26: 1.2017 + case 27: 1.2018 + case 31: 1.2019 + case 32: 1.2020 + case 33: 1.2021 + case 34: 1.2022 + case 35: 1.2023 + case 36: 1.2024 + t = Keyword(); 1.2025 + s = new LocatedString(t.image, t); 1.2026 + break; 1.2027 + default: 1.2028 + jj_la1[52] = jj_gen; 1.2029 + jj_consume_token(-1); 1.2030 + throw new ParseException(); 1.2031 + } 1.2032 + {if (true) return s;} 1.2033 + throw new Error("Missing return statement in function"); 1.2034 + } 1.2035 + 1.2036 + final public void Params(DataPatternBuilder dpb) throws ParseException { 1.2037 + jj_consume_token(11); 1.2038 + label_18: 1.2039 + while (true) { 1.2040 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2041 + case 1: 1.2042 + case 5: 1.2043 + case 6: 1.2044 + case 7: 1.2045 + case 10: 1.2046 + case 13: 1.2047 + case 14: 1.2048 + case 15: 1.2049 + case 16: 1.2050 + case 17: 1.2051 + case 18: 1.2052 + case 19: 1.2053 + case 26: 1.2054 + case 27: 1.2055 + case 31: 1.2056 + case 32: 1.2057 + case 33: 1.2058 + case 34: 1.2059 + case 35: 1.2060 + case 36: 1.2061 + case DOCUMENTATION: 1.2062 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.2063 + case IDENTIFIER: 1.2064 + case ESCAPED_IDENTIFIER: 1.2065 + ; 1.2066 + break; 1.2067 + default: 1.2068 + jj_la1[53] = jj_gen; 1.2069 + break label_18; 1.2070 + } 1.2071 + Param(dpb); 1.2072 + } 1.2073 + jj_consume_token(12); 1.2074 + } 1.2075 + 1.2076 + final public void Param(DataPatternBuilder dpb) throws ParseException { 1.2077 + LocatedString name; 1.2078 + Annotations a; 1.2079 + String value; 1.2080 + a = Annotations(); 1.2081 + name = UnprefixedName(); 1.2082 + jj_consume_token(2); 1.2083 + a = addCommentsToLeadingAnnotations(a); 1.2084 + value = Literal(); 1.2085 + dpb.addParam(name.getString(), value, getContext(), defaultNamespace, name.getLocation(), a); 1.2086 + } 1.2087 + 1.2088 + final public ParsedPattern Except(Scope scope, Token[] except) throws ParseException { 1.2089 + Annotations a; 1.2090 + ParsedPattern p; 1.2091 + Token t; 1.2092 + Token[] innerExcept = new Token[1]; 1.2093 + t = jj_consume_token(30); 1.2094 + a = Annotations(); 1.2095 + p = PrimaryExpr(false, scope, a, innerExcept); 1.2096 + checkExcept(innerExcept); 1.2097 + except[0] = t; 1.2098 + {if (true) return p;} 1.2099 + throw new Error("Missing return statement in function"); 1.2100 + } 1.2101 + 1.2102 + final public ParsedElementAnnotation Documentation() throws ParseException { 1.2103 + CommentList comments = getComments(); 1.2104 + ElementAnnotationBuilder eab; 1.2105 + Token t; 1.2106 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2107 + case DOCUMENTATION: 1.2108 + t = jj_consume_token(DOCUMENTATION); 1.2109 + break; 1.2110 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.2111 + t = jj_consume_token(DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT); 1.2112 + break; 1.2113 + default: 1.2114 + jj_la1[54] = jj_gen; 1.2115 + jj_consume_token(-1); 1.2116 + throw new ParseException(); 1.2117 + } 1.2118 + eab = sb.makeElementAnnotationBuilder(WellKnownNamespaces.RELAX_NG_COMPATIBILITY_ANNOTATIONS, 1.2119 + "documentation", 1.2120 + getCompatibilityPrefix(), 1.2121 + makeLocation(t), 1.2122 + comments, 1.2123 + getContext()); 1.2124 + eab.addText(mungeComment(t.image), makeLocation(t), null); 1.2125 + label_19: 1.2126 + while (true) { 1.2127 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2128 + case DOCUMENTATION_CONTINUE: 1.2129 + ; 1.2130 + break; 1.2131 + default: 1.2132 + jj_la1[55] = jj_gen; 1.2133 + break label_19; 1.2134 + } 1.2135 + t = jj_consume_token(DOCUMENTATION_CONTINUE); 1.2136 + eab.addText("\u005cn" + mungeComment(t.image), makeLocation(t), null); 1.2137 + } 1.2138 + {if (true) return eab.makeElementAnnotation();} 1.2139 + throw new Error("Missing return statement in function"); 1.2140 + } 1.2141 + 1.2142 + final public Annotations Annotations() throws ParseException { 1.2143 + CommentList comments = getComments(); 1.2144 + Annotations a = null; 1.2145 + ParsedElementAnnotation e; 1.2146 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2147 + case DOCUMENTATION: 1.2148 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.2149 + a = sb.makeAnnotations(comments, getContext()); 1.2150 + label_20: 1.2151 + while (true) { 1.2152 + e = Documentation(); 1.2153 + a.addElement(e); 1.2154 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2155 + case DOCUMENTATION: 1.2156 + case DOCUMENTATION_AFTER_SINGLE_LINE_COMMENT: 1.2157 + ; 1.2158 + break; 1.2159 + default: 1.2160 + jj_la1[56] = jj_gen; 1.2161 + break label_20; 1.2162 + } 1.2163 + } 1.2164 + comments = getComments(); 1.2165 + if (comments != null) 1.2166 + a.addLeadingComment(comments); 1.2167 + break; 1.2168 + default: 1.2169 + jj_la1[57] = jj_gen; 1.2170 + ; 1.2171 + } 1.2172 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2173 + case 1: 1.2174 + jj_consume_token(1); 1.2175 + if (a == null) a = sb.makeAnnotations(comments, getContext()); clearAttributeList(); annotationsIncludeElements = false; 1.2176 + label_21: 1.2177 + while (true) { 1.2178 + if (jj_2_7(2)) { 1.2179 + ; 1.2180 + } else { 1.2181 + break label_21; 1.2182 + } 1.2183 + PrefixedAnnotationAttribute(a, false); 1.2184 + } 1.2185 + label_22: 1.2186 + while (true) { 1.2187 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2188 + case 5: 1.2189 + case 6: 1.2190 + case 7: 1.2191 + case 10: 1.2192 + case 13: 1.2193 + case 14: 1.2194 + case 15: 1.2195 + case 16: 1.2196 + case 17: 1.2197 + case 18: 1.2198 + case 19: 1.2199 + case 26: 1.2200 + case 27: 1.2201 + case 31: 1.2202 + case 32: 1.2203 + case 33: 1.2204 + case 34: 1.2205 + case 35: 1.2206 + case 36: 1.2207 + case IDENTIFIER: 1.2208 + case ESCAPED_IDENTIFIER: 1.2209 + case PREFIXED_NAME: 1.2210 + ; 1.2211 + break; 1.2212 + default: 1.2213 + jj_la1[58] = jj_gen; 1.2214 + break label_22; 1.2215 + } 1.2216 + e = AnnotationElement(false); 1.2217 + a.addElement(e); annotationsIncludeElements = true; 1.2218 + } 1.2219 + a.addComment(getComments()); 1.2220 + jj_consume_token(9); 1.2221 + break; 1.2222 + default: 1.2223 + jj_la1[59] = jj_gen; 1.2224 + ; 1.2225 + } 1.2226 + if (a == null && comments != null) 1.2227 + a = sb.makeAnnotations(comments, getContext()); 1.2228 + {if (true) return a;} 1.2229 + throw new Error("Missing return statement in function"); 1.2230 + } 1.2231 + 1.2232 + final public void AnnotationAttribute(Annotations a) throws ParseException { 1.2233 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2234 + case PREFIXED_NAME: 1.2235 + PrefixedAnnotationAttribute(a, true); 1.2236 + break; 1.2237 + case 5: 1.2238 + case 6: 1.2239 + case 7: 1.2240 + case 10: 1.2241 + case 13: 1.2242 + case 14: 1.2243 + case 15: 1.2244 + case 16: 1.2245 + case 17: 1.2246 + case 18: 1.2247 + case 19: 1.2248 + case 26: 1.2249 + case 27: 1.2250 + case 31: 1.2251 + case 32: 1.2252 + case 33: 1.2253 + case 34: 1.2254 + case 35: 1.2255 + case 36: 1.2256 + case IDENTIFIER: 1.2257 + case ESCAPED_IDENTIFIER: 1.2258 + UnprefixedAnnotationAttribute(a); 1.2259 + break; 1.2260 + default: 1.2261 + jj_la1[60] = jj_gen; 1.2262 + jj_consume_token(-1); 1.2263 + throw new ParseException(); 1.2264 + } 1.2265 + } 1.2266 + 1.2267 + final public void PrefixedAnnotationAttribute(Annotations a, boolean nested) throws ParseException { 1.2268 + Token t; 1.2269 + String value; 1.2270 + t = jj_consume_token(PREFIXED_NAME); 1.2271 + jj_consume_token(2); 1.2272 + value = Literal(); 1.2273 + String qn = t.image; 1.2274 + int colon = qn.indexOf(':'); 1.2275 + String prefix = qn.substring(0, colon); 1.2276 + String ns = lookupPrefix(prefix, t); 1.2277 + if (ns == this.inheritedNs) 1.2278 + error("inherited_annotation_namespace", t); 1.2279 + else if (ns.length() == 0 && !nested) 1.2280 + error("unqualified_annotation_attribute", t); 1.2281 + else if (ns.equals(WellKnownNamespaces.RELAX_NG) && !nested) 1.2282 + error("relax_ng_namespace", t); 1.2283 + /*else if (ns.length() == 0 1.2284 + && qn.length() - colon - 1 == 5 1.2285 + && qn.regionMatches(colon + 1, "xmlns", 0, 5)) 1.2286 + error("xmlns_annotation_attribute", t);*/ 1.2287 + else if (ns.equals(WellKnownNamespaces.XMLNS)) 1.2288 + error("xmlns_annotation_attribute_uri", t); 1.2289 + else { 1.2290 + if (ns.length() == 0) 1.2291 + prefix = null; 1.2292 + addAttribute(a, ns, qn.substring(colon + 1), prefix, value, t); 1.2293 + } 1.2294 + } 1.2295 + 1.2296 + final public void UnprefixedAnnotationAttribute(Annotations a) throws ParseException { 1.2297 + LocatedString name; 1.2298 + String value; 1.2299 + name = UnprefixedName(); 1.2300 + jj_consume_token(2); 1.2301 + value = Literal(); 1.2302 + if (name.getString().equals("xmlns")) 1.2303 + error("xmlns_annotation_attribute", name.getToken()); 1.2304 + else 1.2305 + addAttribute(a, "", name.getString(), null, value, name.getToken()); 1.2306 + } 1.2307 + 1.2308 + final public ParsedElementAnnotation AnnotationElement(boolean nested) throws ParseException { 1.2309 + ParsedElementAnnotation a; 1.2310 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2311 + case PREFIXED_NAME: 1.2312 + a = PrefixedAnnotationElement(nested); 1.2313 + break; 1.2314 + case 5: 1.2315 + case 6: 1.2316 + case 7: 1.2317 + case 10: 1.2318 + case 13: 1.2319 + case 14: 1.2320 + case 15: 1.2321 + case 16: 1.2322 + case 17: 1.2323 + case 18: 1.2324 + case 19: 1.2325 + case 26: 1.2326 + case 27: 1.2327 + case 31: 1.2328 + case 32: 1.2329 + case 33: 1.2330 + case 34: 1.2331 + case 35: 1.2332 + case 36: 1.2333 + case IDENTIFIER: 1.2334 + case ESCAPED_IDENTIFIER: 1.2335 + a = UnprefixedAnnotationElement(); 1.2336 + break; 1.2337 + default: 1.2338 + jj_la1[61] = jj_gen; 1.2339 + jj_consume_token(-1); 1.2340 + throw new ParseException(); 1.2341 + } 1.2342 + {if (true) return a;} 1.2343 + throw new Error("Missing return statement in function"); 1.2344 + } 1.2345 + 1.2346 + final public ParsedElementAnnotation AnnotationElementNotKeyword() throws ParseException { 1.2347 + ParsedElementAnnotation a; 1.2348 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2349 + case PREFIXED_NAME: 1.2350 + a = PrefixedAnnotationElement(false); 1.2351 + break; 1.2352 + case IDENTIFIER: 1.2353 + case ESCAPED_IDENTIFIER: 1.2354 + a = IdentifierAnnotationElement(); 1.2355 + break; 1.2356 + default: 1.2357 + jj_la1[62] = jj_gen; 1.2358 + jj_consume_token(-1); 1.2359 + throw new ParseException(); 1.2360 + } 1.2361 + {if (true) return a;} 1.2362 + throw new Error("Missing return statement in function"); 1.2363 + } 1.2364 + 1.2365 + final public ParsedElementAnnotation PrefixedAnnotationElement(boolean nested) throws ParseException { 1.2366 + CommentList comments = getComments(); 1.2367 + Token t; 1.2368 + ElementAnnotationBuilder eab; 1.2369 + t = jj_consume_token(PREFIXED_NAME); 1.2370 + String qn = t.image; 1.2371 + int colon = qn.indexOf(':'); 1.2372 + String prefix = qn.substring(0, colon); 1.2373 + String ns = lookupPrefix(prefix, t); 1.2374 + if (ns == this.inheritedNs) { 1.2375 + error("inherited_annotation_namespace", t); 1.2376 + ns = ""; 1.2377 + } 1.2378 + else if (!nested && ns.equals(WellKnownNamespaces.RELAX_NG)) { 1.2379 + error("relax_ng_namespace", t); 1.2380 + ns = ""; 1.2381 + } 1.2382 + else { 1.2383 + if (ns.length() == 0) 1.2384 + prefix = null; 1.2385 + } 1.2386 + eab = sb.makeElementAnnotationBuilder(ns, qn.substring(colon + 1), prefix, 1.2387 + makeLocation(t), comments, getContext()); 1.2388 + AnnotationElementContent(eab); 1.2389 + {if (true) return eab.makeElementAnnotation();} 1.2390 + throw new Error("Missing return statement in function"); 1.2391 + } 1.2392 + 1.2393 + final public ParsedElementAnnotation UnprefixedAnnotationElement() throws ParseException { 1.2394 + CommentList comments = getComments(); 1.2395 + LocatedString name; 1.2396 + ElementAnnotationBuilder eab; 1.2397 + name = UnprefixedName(); 1.2398 + eab = sb.makeElementAnnotationBuilder("", name.getString(), null, 1.2399 + name.getLocation(), comments, getContext()); 1.2400 + AnnotationElementContent(eab); 1.2401 + {if (true) return eab.makeElementAnnotation();} 1.2402 + throw new Error("Missing return statement in function"); 1.2403 + } 1.2404 + 1.2405 + final public ParsedElementAnnotation IdentifierAnnotationElement() throws ParseException { 1.2406 + CommentList comments = getComments(); 1.2407 + LocatedString name; 1.2408 + ElementAnnotationBuilder eab; 1.2409 + name = Identifier(); 1.2410 + eab = sb.makeElementAnnotationBuilder("", name.getString(), null, 1.2411 + name.getLocation(), comments, getContext()); 1.2412 + AnnotationElementContent(eab); 1.2413 + {if (true) return eab.makeElementAnnotation();} 1.2414 + throw new Error("Missing return statement in function"); 1.2415 + } 1.2416 + 1.2417 + final public void AnnotationElementContent(ElementAnnotationBuilder eab) throws ParseException { 1.2418 + ParsedElementAnnotation e; 1.2419 + jj_consume_token(1); 1.2420 + clearAttributeList(); 1.2421 + label_23: 1.2422 + while (true) { 1.2423 + if (jj_2_8(2)) { 1.2424 + ; 1.2425 + } else { 1.2426 + break label_23; 1.2427 + } 1.2428 + AnnotationAttribute(eab); 1.2429 + } 1.2430 + label_24: 1.2431 + while (true) { 1.2432 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2433 + case 5: 1.2434 + case 6: 1.2435 + case 7: 1.2436 + case 10: 1.2437 + case 13: 1.2438 + case 14: 1.2439 + case 15: 1.2440 + case 16: 1.2441 + case 17: 1.2442 + case 18: 1.2443 + case 19: 1.2444 + case 26: 1.2445 + case 27: 1.2446 + case 31: 1.2447 + case 32: 1.2448 + case 33: 1.2449 + case 34: 1.2450 + case 35: 1.2451 + case 36: 1.2452 + case IDENTIFIER: 1.2453 + case ESCAPED_IDENTIFIER: 1.2454 + case PREFIXED_NAME: 1.2455 + case LITERAL: 1.2456 + ; 1.2457 + break; 1.2458 + default: 1.2459 + jj_la1[63] = jj_gen; 1.2460 + break label_24; 1.2461 + } 1.2462 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2463 + case LITERAL: 1.2464 + AnnotationElementLiteral(eab); 1.2465 + label_25: 1.2466 + while (true) { 1.2467 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2468 + case 8: 1.2469 + ; 1.2470 + break; 1.2471 + default: 1.2472 + jj_la1[64] = jj_gen; 1.2473 + break label_25; 1.2474 + } 1.2475 + jj_consume_token(8); 1.2476 + AnnotationElementLiteral(eab); 1.2477 + } 1.2478 + break; 1.2479 + case 5: 1.2480 + case 6: 1.2481 + case 7: 1.2482 + case 10: 1.2483 + case 13: 1.2484 + case 14: 1.2485 + case 15: 1.2486 + case 16: 1.2487 + case 17: 1.2488 + case 18: 1.2489 + case 19: 1.2490 + case 26: 1.2491 + case 27: 1.2492 + case 31: 1.2493 + case 32: 1.2494 + case 33: 1.2495 + case 34: 1.2496 + case 35: 1.2497 + case 36: 1.2498 + case IDENTIFIER: 1.2499 + case ESCAPED_IDENTIFIER: 1.2500 + case PREFIXED_NAME: 1.2501 + e = AnnotationElement(true); 1.2502 + eab.addElement(e); 1.2503 + break; 1.2504 + default: 1.2505 + jj_la1[65] = jj_gen; 1.2506 + jj_consume_token(-1); 1.2507 + throw new ParseException(); 1.2508 + } 1.2509 + } 1.2510 + eab.addComment(getComments()); 1.2511 + jj_consume_token(9); 1.2512 + } 1.2513 + 1.2514 + final public void AnnotationElementLiteral(ElementAnnotationBuilder eab) throws ParseException { 1.2515 + Token t; 1.2516 + CommentList comments = getComments(); 1.2517 + t = jj_consume_token(LITERAL); 1.2518 + eab.addText(unquote(t.image), makeLocation(t), comments); 1.2519 + } 1.2520 + 1.2521 + final public String Literal() throws ParseException { 1.2522 + Token t; 1.2523 + String s; 1.2524 + StringBuffer buf; 1.2525 + t = jj_consume_token(LITERAL); 1.2526 + s = unquote(t.image); 1.2527 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2528 + case 8: 1.2529 + buf = new StringBuffer(s); 1.2530 + label_26: 1.2531 + while (true) { 1.2532 + jj_consume_token(8); 1.2533 + t = jj_consume_token(LITERAL); 1.2534 + buf.append(unquote(t.image)); 1.2535 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2536 + case 8: 1.2537 + ; 1.2538 + break; 1.2539 + default: 1.2540 + jj_la1[66] = jj_gen; 1.2541 + break label_26; 1.2542 + } 1.2543 + } 1.2544 + s = buf.toString(); 1.2545 + break; 1.2546 + default: 1.2547 + jj_la1[67] = jj_gen; 1.2548 + ; 1.2549 + } 1.2550 + {if (true) return s;} 1.2551 + throw new Error("Missing return statement in function"); 1.2552 + } 1.2553 + 1.2554 + final public LocatedString LocatedLiteral() throws ParseException { 1.2555 + Token t; 1.2556 + Token t2; 1.2557 + String s; 1.2558 + StringBuffer buf; 1.2559 + t = jj_consume_token(LITERAL); 1.2560 + s = unquote(t.image); 1.2561 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2562 + case 8: 1.2563 + buf = new StringBuffer(s); 1.2564 + label_27: 1.2565 + while (true) { 1.2566 + jj_consume_token(8); 1.2567 + t2 = jj_consume_token(LITERAL); 1.2568 + buf.append(unquote(t2.image)); 1.2569 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2570 + case 8: 1.2571 + ; 1.2572 + break; 1.2573 + default: 1.2574 + jj_la1[68] = jj_gen; 1.2575 + break label_27; 1.2576 + } 1.2577 + } 1.2578 + s = buf.toString(); 1.2579 + break; 1.2580 + default: 1.2581 + jj_la1[69] = jj_gen; 1.2582 + ; 1.2583 + } 1.2584 + {if (true) return new LocatedString(s, t);} 1.2585 + throw new Error("Missing return statement in function"); 1.2586 + } 1.2587 + 1.2588 + final public Token Keyword() throws ParseException { 1.2589 + Token t; 1.2590 + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1.2591 + case 26: 1.2592 + t = jj_consume_token(26); 1.2593 + break; 1.2594 + case 27: 1.2595 + t = jj_consume_token(27); 1.2596 + break; 1.2597 + case 13: 1.2598 + t = jj_consume_token(13); 1.2599 + break; 1.2600 + case 31: 1.2601 + t = jj_consume_token(31); 1.2602 + break; 1.2603 + case 32: 1.2604 + t = jj_consume_token(32); 1.2605 + break; 1.2606 + case 10: 1.2607 + t = jj_consume_token(10); 1.2608 + break; 1.2609 + case 17: 1.2610 + t = jj_consume_token(17); 1.2611 + break; 1.2612 + case 18: 1.2613 + t = jj_consume_token(18); 1.2614 + break; 1.2615 + case 34: 1.2616 + t = jj_consume_token(34); 1.2617 + break; 1.2618 + case 33: 1.2619 + t = jj_consume_token(33); 1.2620 + break; 1.2621 + case 19: 1.2622 + t = jj_consume_token(19); 1.2623 + break; 1.2624 + case 5: 1.2625 + t = jj_consume_token(5); 1.2626 + break; 1.2627 + case 7: 1.2628 + t = jj_consume_token(7); 1.2629 + break; 1.2630 + case 14: 1.2631 + t = jj_consume_token(14); 1.2632 + break; 1.2633 + case 15: 1.2634 + t = jj_consume_token(15); 1.2635 + break; 1.2636 + case 35: 1.2637 + t = jj_consume_token(35); 1.2638 + break; 1.2639 + case 36: 1.2640 + t = jj_consume_token(36); 1.2641 + break; 1.2642 + case 16: 1.2643 + t = jj_consume_token(16); 1.2644 + break; 1.2645 + case 6: 1.2646 + t = jj_consume_token(6); 1.2647 + break; 1.2648 + default: 1.2649 + jj_la1[70] = jj_gen; 1.2650 + jj_consume_token(-1); 1.2651 + throw new ParseException(); 1.2652 + } 1.2653 + {if (true) return t;} 1.2654 + throw new Error("Missing return statement in function"); 1.2655 + } 1.2656 + 1.2657 + private boolean jj_2_1(int xla) { 1.2658 + jj_la = xla; jj_lastpos = jj_scanpos = token; 1.2659 + try { return !jj_3_1(); } 1.2660 + catch(LookaheadSuccess ls) { return true; } 1.2661 + finally { jj_save(0, xla); } 1.2662 + } 1.2663 + 1.2664 + private boolean jj_2_2(int xla) { 1.2665 + jj_la = xla; jj_lastpos = jj_scanpos = token; 1.2666 + try { return !jj_3_2(); } 1.2667 + catch(LookaheadSuccess ls) { return true; } 1.2668 + finally { jj_save(1, xla); } 1.2669 + } 1.2670 + 1.2671 + private boolean jj_2_3(int xla) { 1.2672 + jj_la = xla; jj_lastpos = jj_scanpos = token; 1.2673 + try { return !jj_3_3(); } 1.2674 + catch(LookaheadSuccess ls) { return true; } 1.2675 + finally { jj_save(2, xla); } 1.2676 + } 1.2677 + 1.2678 + private boolean jj_2_4(int xla) { 1.2679 + jj_la = xla; jj_lastpos = jj_scanpos = token; 1.2680 + try { return !jj_3_4(); } 1.2681 + catch(LookaheadSuccess ls) { return true; } 1.2682 + finally { jj_save(3, xla); } 1.2683 + } 1.2684 + 1.2685 + private boolean jj_2_5(int xla) { 1.2686 + jj_la = xla; jj_lastpos = jj_scanpos = token; 1.2687 + try { return !jj_3_5(); } 1.2688 + catch(LookaheadSuccess ls) { return true; } 1.2689 + finally { jj_save(4, xla); } 1.2690 + } 1.2691 + 1.2692 + private boolean jj_2_6(int xla) { 1.2693 + jj_la = xla; jj_lastpos = jj_scanpos = token; 1.2694 + try { return !jj_3_6(); } 1.2695 + catch(LookaheadSuccess ls) { return true; } 1.2696 + finally { jj_save(5, xla); } 1.2697 + } 1.2698 + 1.2699 + private boolean jj_2_7(int xla) { 1.2700 + jj_la = xla; jj_lastpos = jj_scanpos = token; 1.2701 + try { return !jj_3_7(); } 1.2702 + catch(LookaheadSuccess ls) { return true; } 1.2703 + finally { jj_save(6, xla); } 1.2704 + } 1.2705 + 1.2706 + private boolean jj_2_8(int xla) { 1.2707 + jj_la = xla; jj_lastpos = jj_scanpos = token; 1.2708 + try { return !jj_3_8(); } 1.2709 + catch(LookaheadSuccess ls) { return true; } 1.2710 + finally { jj_save(7, xla); } 1.2711 + } 1.2712 + 1.2713 + private boolean jj_3R_43() { 1.2714 + if (jj_scan_token(1)) return true; 1.2715 + Token xsp; 1.2716 + while (true) { 1.2717 + xsp = jj_scanpos; 1.2718 + if (jj_3R_52()) { jj_scanpos = xsp; break; } 1.2719 + } 1.2720 + if (jj_scan_token(9)) return true; 1.2721 + return false; 1.2722 + } 1.2723 + 1.2724 + private boolean jj_3R_51() { 1.2725 + if (jj_scan_token(ESCAPED_IDENTIFIER)) return true; 1.2726 + return false; 1.2727 + } 1.2728 + 1.2729 + private boolean jj_3R_50() { 1.2730 + if (jj_scan_token(IDENTIFIER)) return true; 1.2731 + return false; 1.2732 + } 1.2733 + 1.2734 + private boolean jj_3R_41() { 1.2735 + Token xsp; 1.2736 + xsp = jj_scanpos; 1.2737 + if (jj_3R_50()) { 1.2738 + jj_scanpos = xsp; 1.2739 + if (jj_3R_51()) return true; 1.2740 + } 1.2741 + return false; 1.2742 + } 1.2743 + 1.2744 + private boolean jj_3R_47() { 1.2745 + if (jj_scan_token(PREFIXED_NAME)) return true; 1.2746 + if (jj_3R_56()) return true; 1.2747 + return false; 1.2748 + } 1.2749 + 1.2750 + private boolean jj_3R_55() { 1.2751 + Token xsp; 1.2752 + xsp = jj_scanpos; 1.2753 + if (jj_scan_token(40)) { 1.2754 + jj_scanpos = xsp; 1.2755 + if (jj_scan_token(43)) return true; 1.2756 + } 1.2757 + while (true) { 1.2758 + xsp = jj_scanpos; 1.2759 + if (jj_scan_token(41)) { jj_scanpos = xsp; break; } 1.2760 + } 1.2761 + return false; 1.2762 + } 1.2763 + 1.2764 + private boolean jj_3R_45() { 1.2765 + Token xsp; 1.2766 + if (jj_3R_55()) return true; 1.2767 + while (true) { 1.2768 + xsp = jj_scanpos; 1.2769 + if (jj_3R_55()) { jj_scanpos = xsp; break; } 1.2770 + } 1.2771 + return false; 1.2772 + } 1.2773 + 1.2774 + private boolean jj_3R_38() { 1.2775 + if (jj_3R_48()) return true; 1.2776 + return false; 1.2777 + } 1.2778 + 1.2779 + private boolean jj_3R_42() { 1.2780 + Token xsp; 1.2781 + xsp = jj_scanpos; 1.2782 + if (jj_scan_token(5)) { 1.2783 + jj_scanpos = xsp; 1.2784 + if (jj_scan_token(6)) { 1.2785 + jj_scanpos = xsp; 1.2786 + if (jj_scan_token(7)) return true; 1.2787 + } 1.2788 + } 1.2789 + return false; 1.2790 + } 1.2791 + 1.2792 + private boolean jj_3R_37() { 1.2793 + if (jj_3R_47()) return true; 1.2794 + return false; 1.2795 + } 1.2796 + 1.2797 + private boolean jj_3R_54() { 1.2798 + if (jj_3R_42()) return true; 1.2799 + return false; 1.2800 + } 1.2801 + 1.2802 + private boolean jj_3R_29() { 1.2803 + Token xsp; 1.2804 + xsp = jj_scanpos; 1.2805 + if (jj_3R_37()) { 1.2806 + jj_scanpos = xsp; 1.2807 + if (jj_3R_38()) return true; 1.2808 + } 1.2809 + return false; 1.2810 + } 1.2811 + 1.2812 + private boolean jj_3R_44() { 1.2813 + Token xsp; 1.2814 + xsp = jj_scanpos; 1.2815 + if (jj_3R_53()) { 1.2816 + jj_scanpos = xsp; 1.2817 + if (jj_3R_54()) return true; 1.2818 + } 1.2819 + return false; 1.2820 + } 1.2821 + 1.2822 + private boolean jj_3R_53() { 1.2823 + if (jj_3R_41()) return true; 1.2824 + Token xsp; 1.2825 + xsp = jj_scanpos; 1.2826 + if (jj_scan_token(2)) { 1.2827 + jj_scanpos = xsp; 1.2828 + if (jj_scan_token(3)) { 1.2829 + jj_scanpos = xsp; 1.2830 + if (jj_scan_token(4)) return true; 1.2831 + } 1.2832 + } 1.2833 + return false; 1.2834 + } 1.2835 + 1.2836 + private boolean jj_3R_36() { 1.2837 + if (jj_3R_45()) return true; 1.2838 + Token xsp; 1.2839 + xsp = jj_scanpos; 1.2840 + if (jj_3R_46()) jj_scanpos = xsp; 1.2841 + if (jj_3R_44()) return true; 1.2842 + return false; 1.2843 + } 1.2844 + 1.2845 + private boolean jj_3R_35() { 1.2846 + if (jj_3R_43()) return true; 1.2847 + if (jj_3R_44()) return true; 1.2848 + return false; 1.2849 + } 1.2850 + 1.2851 + private boolean jj_3R_34() { 1.2852 + if (jj_3R_42()) return true; 1.2853 + return false; 1.2854 + } 1.2855 + 1.2856 + private boolean jj_3R_33() { 1.2857 + if (jj_3R_41()) return true; 1.2858 + Token xsp; 1.2859 + xsp = jj_scanpos; 1.2860 + if (jj_scan_token(1)) { 1.2861 + jj_scanpos = xsp; 1.2862 + if (jj_scan_token(2)) { 1.2863 + jj_scanpos = xsp; 1.2864 + if (jj_scan_token(3)) { 1.2865 + jj_scanpos = xsp; 1.2866 + if (jj_scan_token(4)) return true; 1.2867 + } 1.2868 + } 1.2869 + } 1.2870 + return false; 1.2871 + } 1.2872 + 1.2873 + private boolean jj_3_1() { 1.2874 + if (jj_3R_28()) return true; 1.2875 + return false; 1.2876 + } 1.2877 + 1.2878 + private boolean jj_3R_32() { 1.2879 + if (jj_scan_token(PREFIXED_NAME)) return true; 1.2880 + if (jj_scan_token(1)) return true; 1.2881 + return false; 1.2882 + } 1.2883 + 1.2884 + private boolean jj_3R_28() { 1.2885 + Token xsp; 1.2886 + xsp = jj_scanpos; 1.2887 + if (jj_3R_32()) { 1.2888 + jj_scanpos = xsp; 1.2889 + if (jj_3R_33()) { 1.2890 + jj_scanpos = xsp; 1.2891 + if (jj_3R_34()) { 1.2892 + jj_scanpos = xsp; 1.2893 + if (jj_3R_35()) { 1.2894 + jj_scanpos = xsp; 1.2895 + if (jj_3R_36()) return true; 1.2896 + } 1.2897 + } 1.2898 + } 1.2899 + } 1.2900 + return false; 1.2901 + } 1.2902 + 1.2903 + private boolean jj_3R_59() { 1.2904 + if (jj_3R_43()) return true; 1.2905 + return false; 1.2906 + } 1.2907 + 1.2908 + private boolean jj_3_8() { 1.2909 + if (jj_3R_31()) return true; 1.2910 + return false; 1.2911 + } 1.2912 + 1.2913 + private boolean jj_3R_56() { 1.2914 + if (jj_scan_token(1)) return true; 1.2915 + return false; 1.2916 + } 1.2917 + 1.2918 + private boolean jj_3R_49() { 1.2919 + if (jj_3R_57()) return true; 1.2920 + if (jj_scan_token(2)) return true; 1.2921 + return false; 1.2922 + } 1.2923 + 1.2924 + private boolean jj_3R_40() { 1.2925 + if (jj_3R_49()) return true; 1.2926 + return false; 1.2927 + } 1.2928 + 1.2929 + private boolean jj_3_4() { 1.2930 + if (jj_3R_29()) return true; 1.2931 + return false; 1.2932 + } 1.2933 + 1.2934 + private boolean jj_3R_48() { 1.2935 + if (jj_3R_41()) return true; 1.2936 + if (jj_3R_56()) return true; 1.2937 + return false; 1.2938 + } 1.2939 + 1.2940 + private boolean jj_3_3() { 1.2941 + if (jj_3R_29()) return true; 1.2942 + return false; 1.2943 + } 1.2944 + 1.2945 + private boolean jj_3_6() { 1.2946 + if (jj_3R_29()) return true; 1.2947 + return false; 1.2948 + } 1.2949 + 1.2950 + private boolean jj_3R_62() { 1.2951 + Token xsp; 1.2952 + xsp = jj_scanpos; 1.2953 + if (jj_scan_token(26)) { 1.2954 + jj_scanpos = xsp; 1.2955 + if (jj_scan_token(27)) { 1.2956 + jj_scanpos = xsp; 1.2957 + if (jj_scan_token(13)) { 1.2958 + jj_scanpos = xsp; 1.2959 + if (jj_scan_token(31)) { 1.2960 + jj_scanpos = xsp; 1.2961 + if (jj_scan_token(32)) { 1.2962 + jj_scanpos = xsp; 1.2963 + if (jj_scan_token(10)) { 1.2964 + jj_scanpos = xsp; 1.2965 + if (jj_scan_token(17)) { 1.2966 + jj_scanpos = xsp; 1.2967 + if (jj_scan_token(18)) { 1.2968 + jj_scanpos = xsp; 1.2969 + if (jj_scan_token(34)) { 1.2970 + jj_scanpos = xsp; 1.2971 + if (jj_scan_token(33)) { 1.2972 + jj_scanpos = xsp; 1.2973 + if (jj_scan_token(19)) { 1.2974 + jj_scanpos = xsp; 1.2975 + if (jj_scan_token(5)) { 1.2976 + jj_scanpos = xsp; 1.2977 + if (jj_scan_token(7)) { 1.2978 + jj_scanpos = xsp; 1.2979 + if (jj_scan_token(14)) { 1.2980 + jj_scanpos = xsp; 1.2981 + if (jj_scan_token(15)) { 1.2982 + jj_scanpos = xsp; 1.2983 + if (jj_scan_token(35)) { 1.2984 + jj_scanpos = xsp; 1.2985 + if (jj_scan_token(36)) { 1.2986 + jj_scanpos = xsp; 1.2987 + if (jj_scan_token(16)) { 1.2988 + jj_scanpos = xsp; 1.2989 + if (jj_scan_token(6)) return true; 1.2990 + } 1.2991 + } 1.2992 + } 1.2993 + } 1.2994 + } 1.2995 + } 1.2996 + } 1.2997 + } 1.2998 + } 1.2999 + } 1.3000 + } 1.3001 + } 1.3002 + } 1.3003 + } 1.3004 + } 1.3005 + } 1.3006 + } 1.3007 + } 1.3008 + return false; 1.3009 + } 1.3010 + 1.3011 + private boolean jj_3R_61() { 1.3012 + if (jj_3R_62()) return true; 1.3013 + return false; 1.3014 + } 1.3015 + 1.3016 + private boolean jj_3_2() { 1.3017 + if (jj_3R_28()) return true; 1.3018 + return false; 1.3019 + } 1.3020 + 1.3021 + private boolean jj_3R_30() { 1.3022 + if (jj_scan_token(PREFIXED_NAME)) return true; 1.3023 + if (jj_scan_token(2)) return true; 1.3024 + return false; 1.3025 + } 1.3026 + 1.3027 + private boolean jj_3R_60() { 1.3028 + if (jj_3R_41()) return true; 1.3029 + return false; 1.3030 + } 1.3031 + 1.3032 + private boolean jj_3R_58() { 1.3033 + if (jj_3R_57()) return true; 1.3034 + return false; 1.3035 + } 1.3036 + 1.3037 + private boolean jj_3R_57() { 1.3038 + Token xsp; 1.3039 + xsp = jj_scanpos; 1.3040 + if (jj_3R_60()) { 1.3041 + jj_scanpos = xsp; 1.3042 + if (jj_3R_61()) return true; 1.3043 + } 1.3044 + return false; 1.3045 + } 1.3046 + 1.3047 + private boolean jj_3_5() { 1.3048 + if (jj_3R_29()) return true; 1.3049 + return false; 1.3050 + } 1.3051 + 1.3052 + private boolean jj_3R_31() { 1.3053 + Token xsp; 1.3054 + xsp = jj_scanpos; 1.3055 + if (jj_3R_39()) { 1.3056 + jj_scanpos = xsp; 1.3057 + if (jj_3R_40()) return true; 1.3058 + } 1.3059 + return false; 1.3060 + } 1.3061 + 1.3062 + private boolean jj_3R_39() { 1.3063 + if (jj_3R_30()) return true; 1.3064 + return false; 1.3065 + } 1.3066 + 1.3067 + private boolean jj_3_7() { 1.3068 + if (jj_3R_30()) return true; 1.3069 + return false; 1.3070 + } 1.3071 + 1.3072 + private boolean jj_3R_46() { 1.3073 + if (jj_3R_43()) return true; 1.3074 + return false; 1.3075 + } 1.3076 + 1.3077 + private boolean jj_3R_52() { 1.3078 + Token xsp; 1.3079 + xsp = jj_scanpos; 1.3080 + if (jj_scan_token(57)) { 1.3081 + jj_scanpos = xsp; 1.3082 + if (jj_3R_58()) { 1.3083 + jj_scanpos = xsp; 1.3084 + if (jj_scan_token(2)) { 1.3085 + jj_scanpos = xsp; 1.3086 + if (jj_scan_token(58)) { 1.3087 + jj_scanpos = xsp; 1.3088 + if (jj_scan_token(8)) { 1.3089 + jj_scanpos = xsp; 1.3090 + if (jj_3R_59()) return true; 1.3091 + } 1.3092 + } 1.3093 + } 1.3094 + } 1.3095 + } 1.3096 + return false; 1.3097 + } 1.3098 + 1.3099 + /** Generated Token Manager. */ 1.3100 + public CompactSyntaxTokenManager token_source; 1.3101 + JavaCharStream jj_input_stream; 1.3102 + /** Current token. */ 1.3103 + public Token token; 1.3104 + /** Next token. */ 1.3105 + public Token jj_nt; 1.3106 + private int jj_ntk; 1.3107 + private Token jj_scanpos, jj_lastpos; 1.3108 + private int jj_la; 1.3109 + private int jj_gen; 1.3110 + final private int[] jj_la1 = new int[71]; 1.3111 + static private int[] jj_la1_0; 1.3112 + static private int[] jj_la1_1; 1.3113 + static { 1.3114 + jj_la1_init_0(); 1.3115 + jj_la1_init_1(); 1.3116 + } 1.3117 + private static void jj_la1_init_0() { 1.3118 + jj_la1_0 = new int[] {0x9c0e0402,0x1e,0x2,0xe2,0x1c,0xe0,0xe0,0x0,0x0,0x0,0x8c0fe5e6,0x8c0fe5e6,0x402,0x16000,0x16000,0x8c0fe4e0,0x6000,0x8000,0x0,0x9c0e0400,0x100000,0x200000,0x400000,0x700000,0x700000,0x3800000,0x0,0x3800000,0x9e0fe4e0,0x0,0x100000,0x100000,0x9e0fe4e0,0x9c0fe4e0,0x2000000,0x40000000,0x40000000,0xe2,0xe0,0x20,0x1c,0x800,0x62,0x60,0x8000,0x40000000,0x40000000,0x800,0x0,0x0,0x0,0x8c0fe4e0,0x8c0fe4e0,0x8c0fe4e2,0x0,0x0,0x0,0x0,0x8c0fe4e0,0x2,0x8c0fe4e0,0x8c0fe4e0,0x0,0x8c0fe4e0,0x100,0x8c0fe4e0,0x100,0x100,0x100,0x100,0x8c0fe4e0,}; 1.3119 + } 1.3120 + private static void jj_la1_init_1() { 1.3121 + jj_la1_1 = new int[] {0x6c0091f,0x0,0x0,0x2c00900,0x0,0xc00000,0x0,0x900,0x200,0x900,0x6c0001f,0x6c0001f,0x900,0x0,0x0,0xc0001f,0x0,0x4000000,0x8000000,0x6c0001f,0x0,0x0,0x0,0x0,0x0,0x0,0x8000000,0x0,0x3c0001f,0x8000000,0x0,0x0,0x3c0001f,0x2c0001f,0x1000000,0x0,0x0,0xc00900,0xc00000,0xc00000,0x0,0x0,0xc00900,0xc00000,0x0,0x0,0x0,0x0,0x4000000,0x2000018,0xc00000,0xc0001f,0xc0001f,0xc0091f,0x900,0x200,0x900,0x900,0x2c0001f,0x0,0x2c0001f,0x2c0001f,0x2c00000,0x6c0001f,0x0,0x6c0001f,0x0,0x0,0x0,0x0,0x1f,}; 1.3122 + } 1.3123 + final private JJCalls[] jj_2_rtns = new JJCalls[8]; 1.3124 + private boolean jj_rescan = false; 1.3125 + private int jj_gc = 0; 1.3126 + 1.3127 + /** Constructor with InputStream. */ 1.3128 + public CompactSyntax(java.io.InputStream stream) { 1.3129 + this(stream, null); 1.3130 + } 1.3131 + /** Constructor with InputStream and supplied encoding */ 1.3132 + public CompactSyntax(java.io.InputStream stream, String encoding) { 1.3133 + try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } 1.3134 + token_source = new CompactSyntaxTokenManager(jj_input_stream); 1.3135 + token = new Token(); 1.3136 + jj_ntk = -1; 1.3137 + jj_gen = 0; 1.3138 + for (int i = 0; i < 71; i++) jj_la1[i] = -1; 1.3139 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1.3140 + } 1.3141 + 1.3142 + /** Reinitialise. */ 1.3143 + public void ReInit(java.io.InputStream stream) { 1.3144 + ReInit(stream, null); 1.3145 + } 1.3146 + /** Reinitialise. */ 1.3147 + public void ReInit(java.io.InputStream stream, String encoding) { 1.3148 + try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } 1.3149 + token_source.ReInit(jj_input_stream); 1.3150 + token = new Token(); 1.3151 + jj_ntk = -1; 1.3152 + jj_gen = 0; 1.3153 + for (int i = 0; i < 71; i++) jj_la1[i] = -1; 1.3154 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1.3155 + } 1.3156 + 1.3157 + /** Constructor. */ 1.3158 + public CompactSyntax(java.io.Reader stream) { 1.3159 + jj_input_stream = new JavaCharStream(stream, 1, 1); 1.3160 + token_source = new CompactSyntaxTokenManager(jj_input_stream); 1.3161 + token = new Token(); 1.3162 + jj_ntk = -1; 1.3163 + jj_gen = 0; 1.3164 + for (int i = 0; i < 71; i++) jj_la1[i] = -1; 1.3165 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1.3166 + } 1.3167 + 1.3168 + /** Reinitialise. */ 1.3169 + public void ReInit(java.io.Reader stream) { 1.3170 + jj_input_stream.ReInit(stream, 1, 1); 1.3171 + token_source.ReInit(jj_input_stream); 1.3172 + token = new Token(); 1.3173 + jj_ntk = -1; 1.3174 + jj_gen = 0; 1.3175 + for (int i = 0; i < 71; i++) jj_la1[i] = -1; 1.3176 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1.3177 + } 1.3178 + 1.3179 + /** Constructor with generated Token Manager. */ 1.3180 + public CompactSyntax(CompactSyntaxTokenManager tm) { 1.3181 + token_source = tm; 1.3182 + token = new Token(); 1.3183 + jj_ntk = -1; 1.3184 + jj_gen = 0; 1.3185 + for (int i = 0; i < 71; i++) jj_la1[i] = -1; 1.3186 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1.3187 + } 1.3188 + 1.3189 + /** Reinitialise. */ 1.3190 + public void ReInit(CompactSyntaxTokenManager tm) { 1.3191 + token_source = tm; 1.3192 + token = new Token(); 1.3193 + jj_ntk = -1; 1.3194 + jj_gen = 0; 1.3195 + for (int i = 0; i < 71; i++) jj_la1[i] = -1; 1.3196 + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1.3197 + } 1.3198 + 1.3199 + private Token jj_consume_token(int kind) throws ParseException { 1.3200 + Token oldToken; 1.3201 + if ((oldToken = token).next != null) token = token.next; 1.3202 + else token = token.next = token_source.getNextToken(); 1.3203 + jj_ntk = -1; 1.3204 + if (token.kind == kind) { 1.3205 + jj_gen++; 1.3206 + if (++jj_gc > 100) { 1.3207 + jj_gc = 0; 1.3208 + for (int i = 0; i < jj_2_rtns.length; i++) { 1.3209 + JJCalls c = jj_2_rtns[i]; 1.3210 + while (c != null) { 1.3211 + if (c.gen < jj_gen) c.first = null; 1.3212 + c = c.next; 1.3213 + } 1.3214 + } 1.3215 + } 1.3216 + return token; 1.3217 + } 1.3218 + token = oldToken; 1.3219 + jj_kind = kind; 1.3220 + throw generateParseException(); 1.3221 + } 1.3222 + 1.3223 + static private final class LookaheadSuccess extends java.lang.Error { } 1.3224 + final private LookaheadSuccess jj_ls = new LookaheadSuccess(); 1.3225 + private boolean jj_scan_token(int kind) { 1.3226 + if (jj_scanpos == jj_lastpos) { 1.3227 + jj_la--; 1.3228 + if (jj_scanpos.next == null) { 1.3229 + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); 1.3230 + } else { 1.3231 + jj_lastpos = jj_scanpos = jj_scanpos.next; 1.3232 + } 1.3233 + } else { 1.3234 + jj_scanpos = jj_scanpos.next; 1.3235 + } 1.3236 + if (jj_rescan) { 1.3237 + int i = 0; Token tok = token; 1.3238 + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } 1.3239 + if (tok != null) jj_add_error_token(kind, i); 1.3240 + } 1.3241 + if (jj_scanpos.kind != kind) return true; 1.3242 + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; 1.3243 + return false; 1.3244 + } 1.3245 + 1.3246 + 1.3247 +/** Get the next Token. */ 1.3248 + final public Token getNextToken() { 1.3249 + if (token.next != null) token = token.next; 1.3250 + else token = token.next = token_source.getNextToken(); 1.3251 + jj_ntk = -1; 1.3252 + jj_gen++; 1.3253 + return token; 1.3254 + } 1.3255 + 1.3256 +/** Get the specific Token. */ 1.3257 + final public Token getToken(int index) { 1.3258 + Token t = token; 1.3259 + for (int i = 0; i < index; i++) { 1.3260 + if (t.next != null) t = t.next; 1.3261 + else t = t.next = token_source.getNextToken(); 1.3262 + } 1.3263 + return t; 1.3264 + } 1.3265 + 1.3266 + private int jj_ntk() { 1.3267 + if ((jj_nt=token.next) == null) 1.3268 + return (jj_ntk = (token.next=token_source.getNextToken()).kind); 1.3269 + else 1.3270 + return (jj_ntk = jj_nt.kind); 1.3271 + } 1.3272 + 1.3273 + private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); 1.3274 + private int[] jj_expentry; 1.3275 + private int jj_kind = -1; 1.3276 + private int[] jj_lasttokens = new int[100]; 1.3277 + private int jj_endpos; 1.3278 + 1.3279 + private void jj_add_error_token(int kind, int pos) { 1.3280 + if (pos >= 100) return; 1.3281 + if (pos == jj_endpos + 1) { 1.3282 + jj_lasttokens[jj_endpos++] = kind; 1.3283 + } else if (jj_endpos != 0) { 1.3284 + jj_expentry = new int[jj_endpos]; 1.3285 + for (int i = 0; i < jj_endpos; i++) { 1.3286 + jj_expentry[i] = jj_lasttokens[i]; 1.3287 + } 1.3288 + jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) { 1.3289 + int[] oldentry = (int[])(it.next()); 1.3290 + if (oldentry.length == jj_expentry.length) { 1.3291 + for (int i = 0; i < jj_expentry.length; i++) { 1.3292 + if (oldentry[i] != jj_expentry[i]) { 1.3293 + continue jj_entries_loop; 1.3294 + } 1.3295 + } 1.3296 + jj_expentries.add(jj_expentry); 1.3297 + break jj_entries_loop; 1.3298 + } 1.3299 + } 1.3300 + if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; 1.3301 + } 1.3302 + } 1.3303 + 1.3304 + /** Generate ParseException. */ 1.3305 + public ParseException generateParseException() { 1.3306 + jj_expentries.clear(); 1.3307 + boolean[] la1tokens = new boolean[61]; 1.3308 + if (jj_kind >= 0) { 1.3309 + la1tokens[jj_kind] = true; 1.3310 + jj_kind = -1; 1.3311 + } 1.3312 + for (int i = 0; i < 71; i++) { 1.3313 + if (jj_la1[i] == jj_gen) { 1.3314 + for (int j = 0; j < 32; j++) { 1.3315 + if ((jj_la1_0[i] & (1<<j)) != 0) { 1.3316 + la1tokens[j] = true; 1.3317 + } 1.3318 + if ((jj_la1_1[i] & (1<<j)) != 0) { 1.3319 + la1tokens[32+j] = true; 1.3320 + } 1.3321 + } 1.3322 + } 1.3323 + } 1.3324 + for (int i = 0; i < 61; i++) { 1.3325 + if (la1tokens[i]) { 1.3326 + jj_expentry = new int[1]; 1.3327 + jj_expentry[0] = i; 1.3328 + jj_expentries.add(jj_expentry); 1.3329 + } 1.3330 + } 1.3331 + jj_endpos = 0; 1.3332 + jj_rescan_token(); 1.3333 + jj_add_error_token(0, 0); 1.3334 + int[][] exptokseq = new int[jj_expentries.size()][]; 1.3335 + for (int i = 0; i < jj_expentries.size(); i++) { 1.3336 + exptokseq[i] = jj_expentries.get(i); 1.3337 + } 1.3338 + return new ParseException(token, exptokseq, tokenImage); 1.3339 + } 1.3340 + 1.3341 + /** Enable tracing. */ 1.3342 + final public void enable_tracing() { 1.3343 + } 1.3344 + 1.3345 + /** Disable tracing. */ 1.3346 + final public void disable_tracing() { 1.3347 + } 1.3348 + 1.3349 + private void jj_rescan_token() { 1.3350 + jj_rescan = true; 1.3351 + for (int i = 0; i < 8; i++) { 1.3352 + try { 1.3353 + JJCalls p = jj_2_rtns[i]; 1.3354 + do { 1.3355 + if (p.gen > jj_gen) { 1.3356 + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; 1.3357 + switch (i) { 1.3358 + case 0: jj_3_1(); break; 1.3359 + case 1: jj_3_2(); break; 1.3360 + case 2: jj_3_3(); break; 1.3361 + case 3: jj_3_4(); break; 1.3362 + case 4: jj_3_5(); break; 1.3363 + case 5: jj_3_6(); break; 1.3364 + case 6: jj_3_7(); break; 1.3365 + case 7: jj_3_8(); break; 1.3366 + } 1.3367 + } 1.3368 + p = p.next; 1.3369 + } while (p != null); 1.3370 + } catch(LookaheadSuccess ls) { } 1.3371 + } 1.3372 + jj_rescan = false; 1.3373 + } 1.3374 + 1.3375 + private void jj_save(int index, int xla) { 1.3376 + JJCalls p = jj_2_rtns[index]; 1.3377 + while (p.gen > jj_gen) { 1.3378 + if (p.next == null) { p = p.next = new JJCalls(); break; } 1.3379 + p = p.next; 1.3380 + } 1.3381 + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; 1.3382 + } 1.3383 + 1.3384 + static final class JJCalls { 1.3385 + int gen; 1.3386 + Token first; 1.3387 + int arg; 1.3388 + JJCalls next; 1.3389 + } 1.3390 + 1.3391 +}