Java源码示例:com.sun.xml.internal.rngom.ast.builder.Annotations
示例1
public ParsedPattern makeChoice(List patterns,
Location _loc, Annotations _anno) throws BuildException {
List<ParsedPattern> lp = new ArrayList<ParsedPattern>();
List<ParsedPattern> rp = new ArrayList<ParsedPattern>();
for( int i=0; i<patterns.size(); i++ ) {
lp.add( ((ParsedPatternHost)patterns.get(i)).lhs);
rp.add( ((ParsedPatternHost)patterns.get(i)).rhs);
}
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
return new ParsedPatternHost(
lhs.makeChoice(lp, loc.lhs, anno.lhs),
rhs.makeChoice(rp, loc.rhs, anno.rhs));
}
示例2
final public ParsedNameClass NsNameExceptClass(int context, Annotations a, Annotations[] pa) throws ParseException {
LocatedString ns;
ParsedNameClass nc;
ns = NsName();
checkNsName(context, ns);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 30:
nc = ExceptNameClass(context | IN_NS_NAME);
nc = ncb.makeNsName(ns.getString(), nc, ns.getLocation(), a);
nc = AnnotateAfter(nc);
break;
default:
jj_la1[35] = jj_gen;
nc = ncb.makeNsName(ns.getString(), ns.getLocation(), a);
nc = AnnotateAfter(nc);
nc = NameClassAlternatives(context, nc, pa);
}
{if (true) return nc;}
throw new Error("Missing return statement in function");
}
示例3
public Annotations makeAnnotations(CommentList _comments, Context context) {
CommentListHost comments = (CommentListHost) _comments;
Annotations l = lhs.makeAnnotations((comments!=null)?comments.lhs:null, context);
Annotations r = rhs.makeAnnotations((comments!=null)?comments.rhs:null, context);
if(l==null || r==null)
throw new IllegalArgumentException("annotations cannot be null");
return new AnnotationsHost(l,r);
}
示例4
public ParsedNameClass makeName(String ns, String localName, String prefix, Location _loc, Annotations _anno) {
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
return new ParsedNameClassHost(
lhs.makeName( ns, localName, prefix, loc.lhs, anno.lhs ),
rhs.makeName( ns, localName, prefix, loc.rhs, anno.rhs ) );
}
示例5
public void endInclude(Parseable current, String uri, String ns, Location _loc, Annotations _anno) throws BuildException, IllegalSchemaException {
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
lhs.endInclude( current, uri, ns, loc.lhs, anno.lhs );
rhs.endInclude( current, uri, ns, loc.rhs, anno.rhs );
}
示例6
public ParsedPattern annotate(ParsedPattern _p, Annotations _anno)
throws BuildException {
ParsedPatternHost p = (ParsedPatternHost) _p;
AnnotationsHost a = cast(_anno);
return new ParsedPatternHost(
lhs.annotate(p.lhs, a.lhs),
rhs.annotate(p.lhs, a.lhs) );
}
示例7
public ParsedPattern makeMixed(ParsedPattern _p, Location _loc,
Annotations _anno) throws BuildException {
ParsedPatternHost p = (ParsedPatternHost) _p;
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
return new ParsedPatternHost(
lhs.makeMixed(p.lhs, loc.lhs, anno.lhs),
rhs.makeMixed(p.rhs, loc.rhs, anno.rhs));
}
示例8
final public ParsedPattern AttributeExpr(Scope scope, Annotations a) throws ParseException {
Token t;
ParsedNameClass nc;
ParsedPattern p;
t = jj_consume_token(27);
nc = NameClass(IN_ATTRIBUTE, null);
jj_consume_token(11);
p = Expr(false, scope, null, null);
p = afterComments(p);
jj_consume_token(12);
{if (true) return sb.makeAttribute(nc, p, makeLocation(t), a);}
throw new Error("Missing return statement in function");
}
示例9
public ParsedPattern makeMixed(ParsedPattern _p, Location _loc,
Annotations _anno) throws BuildException {
ParsedPatternHost p = (ParsedPatternHost) _p;
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
return new ParsedPatternHost(
lhs.makeMixed(p.lhs, loc.lhs, anno.lhs),
rhs.makeMixed(p.rhs, loc.rhs, anno.rhs));
}
示例10
public ParsedPattern annotate(ParsedPattern _p, Annotations _anno)
throws BuildException {
ParsedPatternHost p = (ParsedPatternHost) _p;
AnnotationsHost a = cast(_anno);
return new ParsedPatternHost(
lhs.annotate(p.lhs, a.lhs),
rhs.annotate(p.lhs, a.lhs) );
}
示例11
final public void AnnotationAttribute(Annotations a) throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PREFIXED_NAME:
PrefixedAnnotationAttribute(a, true);
break;
case 5:
case 6:
case 7:
case 10:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 26:
case 27:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
case IDENTIFIER:
case ESCAPED_IDENTIFIER:
UnprefixedAnnotationAttribute(a);
break;
default:
jj_la1[60] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
示例12
final public ParsedNameClass PrimaryNameClass(int context, Annotations a) throws ParseException {
ParsedNameClass nc;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 5:
case 6:
case 7:
case 10:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 26:
case 27:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
case IDENTIFIER:
case ESCAPED_IDENTIFIER:
nc = UnprefixedNameClass(context, a);
break;
case PREFIXED_NAME:
nc = PrefixedNameClass(a);
break;
case 28:
nc = ParenNameClass(context, a);
break;
default:
jj_la1[33] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return nc;}
throw new Error("Missing return statement in function");
}
示例13
final public void UnprefixedAnnotationAttribute(Annotations a) throws ParseException {
LocatedString name;
String value;
name = UnprefixedName();
jj_consume_token(2);
value = Literal();
if (name.getString().equals("xmlns"))
error("xmlns_annotation_attribute", name.getToken());
else
addAttribute(a, "", name.getString(), null, value, name.getToken());
}
示例14
public ParsedPattern makeGroup(List patterns, Location loc, Annotations anno)
throws BuildException {
if (patterns.isEmpty()) {
throw new IllegalArgumentException();
}
Pattern result = (Pattern) patterns.get(0);
for (int i = 1; i < patterns.size(); i++) {
result = pb.makeGroup(result, (Pattern) patterns.get(i));
}
return result;
}
示例15
public ParsedPattern makeParentRef(String name, Location loc, Annotations anno) throws BuildException {
// TODO: do this check by the caller
if (parent == null) {
sb.error("parent_ref_outside_grammar", (Locator) loc);
return sb.makeErrorPattern();
}
return parent.makeRef(name, loc, anno);
}
示例16
public ParsedPattern makeEmpty(Location _loc, Annotations _anno) {
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
return new ParsedPatternHost(
lhs.makeEmpty(loc.lhs, anno.lhs),
rhs.makeEmpty(loc.rhs, anno.rhs));
}
示例17
public ParsedPattern makeGroup(List patterns, Location loc, Annotations anno)
throws BuildException {
if (patterns.isEmpty()) {
throw new IllegalArgumentException();
}
Pattern result = (Pattern) patterns.get(0);
for (int i = 1; i < patterns.size(); i++) {
result = pb.makeGroup(result, (Pattern) patterns.get(i));
}
return result;
}
示例18
final public ParsedPattern Except(Scope scope, Token[] except) throws ParseException {
Annotations a;
ParsedPattern p;
Token t;
Token[] innerExcept = new Token[1];
t = jj_consume_token(30);
a = Annotations();
p = PrimaryExpr(false, scope, a, innerExcept);
checkExcept(innerExcept);
except[0] = t;
{if (true) return p;}
throw new Error("Missing return statement in function");
}
示例19
public ParsedPattern makeValue(String datatypeLibrary, String type,
String value, Context c, String ns, Location _loc, Annotations _anno)
throws BuildException {
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
return new ParsedPatternHost(
lhs.makeValue(datatypeLibrary,type,value,c,ns,loc.lhs,anno.lhs),
rhs.makeValue(datatypeLibrary,type,value,c,ns,loc.rhs,anno.rhs));
}
示例20
final public void Param(DataPatternBuilder dpb) throws ParseException {
LocatedString name;
Annotations a;
String value;
a = Annotations();
name = UnprefixedName();
jj_consume_token(2);
a = addCommentsToLeadingAnnotations(a);
value = Literal();
dpb.addParam(name.getString(), value, getContext(), defaultNamespace, name.getLocation(), a);
}
示例21
public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno)
throws BuildException {
try {
return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc);
} catch (DatatypeException e) {
String detail = e.getMessage();
if (detail != null) {
error("invalid_params_detail", detail, (Locator) loc);
} else {
error("invalid_params", (Locator) loc);
}
return pb.makeError();
}
}
示例22
private ParsedNameClass expandName(String name, String ns, Annotations anno) throws SAXException {
int ic = name.indexOf(':');
if (ic == -1) {
return nameClassBuilder.makeName(ns, checkNCName(name), null, null, anno);
}
String prefix = checkNCName(name.substring(0, ic));
String localName = checkNCName(name.substring(ic + 1));
for (PrefixMapping tem = context.prefixMapping; tem != null; tem = tem.next) {
if (tem.prefix.equals(prefix)) {
return nameClassBuilder.makeName(tem.uri, localName, prefix, null, anno);
}
}
error("undefined_prefix", prefix);
return nameClassBuilder.makeName("", localName, null, null, anno);
}
示例23
private Annotations addCommentsToChildAnnotations(Annotations a) {
CommentList comments = getComments();
if (comments == null)
return a;
if (a == null)
a = sb.makeAnnotations(null, getContext());
a.addComment(comments);
return a;
}
示例24
public ParsedNameClass makeNsName(String ns, ParsedNameClass _except, Location _loc, Annotations _anno) {
ParsedNameClassHost except = (ParsedNameClassHost) _except;
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
return new ParsedNameClassHost(
lhs.makeNsName( ns, except.lhs, loc.lhs, anno.lhs ),
rhs.makeNsName( ns, except.rhs, loc.rhs, anno.rhs ) );
}
示例25
public ParsedPattern makeChoice(List patterns, Location loc, Annotations anno)
throws BuildException {
if (patterns.isEmpty()) {
throw new IllegalArgumentException();
}
Pattern result = (Pattern) patterns.get(0);
for (int i = 1; i < patterns.size(); i++) {
result = pb.makeChoice(result, (Pattern) patterns.get(i));
}
return result;
}
示例26
public ParsedPattern endGrammar(Location _loc, Annotations _anno) throws BuildException {
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
return new ParsedPatternHost(
lhs.endGrammar(loc.lhs, anno.lhs),
rhs.endGrammar(loc.rhs, anno.rhs));
}
示例27
final public ParsedPattern MixedExpr(Scope scope, Annotations a) throws ParseException {
Token t;
ParsedPattern p;
t = jj_consume_token(32);
jj_consume_token(11);
p = Expr(false, scope, null, null);
p = afterComments(p);
jj_consume_token(12);
{if (true) return sb.makeMixed(p, makeLocation(t), a);}
throw new Error("Missing return statement in function");
}
示例28
public void endDiv(Location _loc, Annotations _anno) throws BuildException {
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
lhs.endDiv( loc.lhs, anno.lhs );
rhs.endDiv( loc.rhs, anno.rhs );
}
示例29
final public void IncludeComponent(GrammarSection section, Scope scope) throws ParseException {
ParsedElementAnnotation e;
Annotations a;
a = Annotations();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 5:
case IDENTIFIER:
case ESCAPED_IDENTIFIER:
Definition(section, scope, a);
break;
case 6:
IncludeDiv(section, scope, a);
break;
default:
jj_la1[43] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
label_17:
while (true) {
if (jj_2_6(2)) {
;
} else {
break label_17;
}
e = AnnotationElementNotKeyword();
section.topLevelAnnotation(e);
}
}
示例30
public ParsedPattern makePattern(ParsedPattern _except, Location _loc, Annotations _anno) throws BuildException {
ParsedPatternHost except = (ParsedPatternHost) _except;
LocationHost loc = cast(_loc);
AnnotationsHost anno = cast(_anno);
return new ParsedPatternHost(
lhs.makePattern(except.lhs, loc.lhs, anno.lhs),
rhs.makePattern(except.rhs, loc.rhs, anno.rhs));
}