static class SchemaBuilderImpl.GrammarImpl extends java.lang.Object implements Grammar, Div, IncludedGrammar
| Modifier and Type | Field and Description |
|---|---|
private java.util.Hashtable |
defines |
private Scope |
parent |
private SchemaBuilderImpl |
sb |
private RefPattern |
startRef |
| Modifier | Constructor and Description |
|---|---|
protected |
GrammarImpl(SchemaBuilderImpl sb,
SchemaBuilderImpl.GrammarImpl g) |
private |
GrammarImpl(SchemaBuilderImpl sb,
Scope parent) |
| Modifier and Type | Method and Description |
|---|---|
private void |
define(RefPattern rp,
GrammarSection.Combine combine,
ParsedPattern pattern,
Location loc) |
void |
define(java.lang.String name,
GrammarSection.Combine combine,
ParsedPattern pattern,
Location loc,
Annotations anno)
Called when a pattern is defined.
|
void |
endDiv(Location loc,
Annotations anno) |
ParsedPattern |
endGrammar(Location loc,
Annotations anno) |
ParsedPattern |
endIncludedGrammar(Location loc,
Annotations anno) |
private RefPattern |
lookup(java.lang.String name) |
private RefPattern |
lookup1(java.lang.String name) |
Div |
makeDiv()
Called when <div> is found.
|
Include |
makeInclude()
Returns null if already in an include.
|
ParsedPattern |
makeParentRef(java.lang.String name,
Location loc,
Annotations anno) |
ParsedPattern |
makeRef(java.lang.String name,
Location loc,
Annotations anno) |
void |
topLevelAnnotation(ParsedElementAnnotation ea)
Called when an annotation is found.
|
void |
topLevelComment(CommentList comments)
Called when a comment is found.
|
private final SchemaBuilderImpl sb
private final java.util.Hashtable defines
private final RefPattern startRef
private final Scope parent
private GrammarImpl(SchemaBuilderImpl sb, Scope parent)
protected GrammarImpl(SchemaBuilderImpl sb, SchemaBuilderImpl.GrammarImpl g)
public ParsedPattern endGrammar(Location loc, Annotations anno) throws BuildException
endGrammar in interface GrammarBuildExceptionpublic void endDiv(Location loc, Annotations anno) throws BuildException
endDiv in interface DivBuildExceptionpublic ParsedPattern endIncludedGrammar(Location loc, Annotations anno) throws BuildException
endIncludedGrammar in interface IncludedGrammarParseable.parseInclude(String, SchemaBuilder, IncludedGrammar, String)
to return the result from IncludedGrammar nicely.
The value returned from this method will be returned from the abovementioned method.
BuildExceptionpublic void define(java.lang.String name,
GrammarSection.Combine combine,
ParsedPattern pattern,
Location loc,
Annotations anno)
throws BuildException
GrammarSectiondefine in interface GrammarSectionname - Name of the pattern. For the definition by a <start/> element,
this parameter is the same as GrammarSection.START.
to test if it's a named pattern definition or the start pattern definition.combine - null or GrammarSection.COMBINE_CHOICE or GrammarSection.COMBINE_INTERLEAVE depending
on the value of the combine attribute.pattern - The pattern to be defined.BuildExceptionprivate void define(RefPattern rp, GrammarSection.Combine combine, ParsedPattern pattern, Location loc) throws BuildException
BuildExceptionpublic void topLevelAnnotation(ParsedElementAnnotation ea) throws BuildException
GrammarSectiontopLevelAnnotation in interface GrammarSectionBuildExceptionpublic void topLevelComment(CommentList comments) throws BuildException
GrammarSectiontopLevelComment in interface GrammarSectionBuildExceptionprivate RefPattern lookup(java.lang.String name)
private RefPattern lookup1(java.lang.String name)
public ParsedPattern makeRef(java.lang.String name, Location loc, Annotations anno) throws BuildException
makeRef in interface ScopeBuildExceptionpublic ParsedPattern makeParentRef(java.lang.String name, Location loc, Annotations anno) throws BuildException
makeParentRef in interface ScopeBuildExceptionpublic Div makeDiv()
GrammarSectionmakeDiv in interface GrammarSectionDiv object will receive callbacks for structures
inside the <div> element.public Include makeInclude()
GrammarSectionmakeInclude in interface GrammarSection