01: package org.kohsuke.rngom.parse.host;
02:
03: import org.kohsuke.rngom.ast.builder.Annotations;
04: import org.kohsuke.rngom.ast.builder.BuildException;
05: import org.kohsuke.rngom.ast.builder.Scope;
06: import org.kohsuke.rngom.ast.om.Location;
07: import org.kohsuke.rngom.ast.om.ParsedPattern;
08:
09: /**
10: *
11: * @author
12: * Kohsuke Kawaguchi (kk@kohsuke.org)
13: */
14: public class ScopeHost extends GrammarSectionHost implements Scope {
15: protected final Scope lhs;
16: protected final Scope rhs;
17:
18: protected ScopeHost(Scope lhs, Scope rhs) {
19: super (lhs, rhs);
20: this .lhs = lhs;
21: this .rhs = rhs;
22: }
23:
24: public ParsedPattern makeParentRef(String name, Location _loc,
25: Annotations _anno) throws BuildException {
26: LocationHost loc = cast(_loc);
27: AnnotationsHost anno = cast(_anno);
28:
29: return new ParsedPatternHost(lhs.makeParentRef(name, loc.lhs,
30: anno.lhs), rhs.makeParentRef(name, loc.rhs, anno.rhs));
31: }
32:
33: public ParsedPattern makeRef(String name, Location _loc,
34: Annotations _anno) throws BuildException {
35: LocationHost loc = cast(_loc);
36: AnnotationsHost anno = cast(_anno);
37:
38: return new ParsedPatternHost(lhs.makeRef(name, loc.lhs,
39: anno.lhs), rhs.makeRef(name, loc.rhs, anno.rhs));
40: }
41: }
|