Interface GrammarSection<P extends ParsedPattern,E extends ParsedElementAnnotation,L extends Location,A extends Annotations<E,L,CL>,CL extends CommentList<L>>
- All Known Subinterfaces:
Div<P,
,E, L, A, CL> Grammar<P,
,E, L, A, CL> Include<P,
,E, L, A, CL> IncludedGrammar<P,
,E, L, A, CL> Scope<P,
E, L, A, CL>
- All Known Implementing Classes:
DivHost
,GrammarHost
,GrammarSectionHost
,IncludeHost
,ScopeHost
public interface GrammarSection<P extends ParsedPattern,E extends ParsedElementAnnotation,L extends Location,A extends Annotations<E,L,CL>,CL extends CommentList<L>>
The container that can have <define> elements.
Div
, Grammar
, Include
, or IncludedGrammar
.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final GrammarSection.Combine
static final GrammarSection.Combine
static final String
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when a pattern is defined.makeDiv()
Called when <div> is found.Returns null if already in an include.void
topLevelAnnotation
(E ea) Called when an annotation is found.void
topLevelComment
(CL comments) Called when a comment is found.
-
Field Details
-
COMBINE_CHOICE
-
COMBINE_INTERLEAVE
-
START
- See Also:
-
-
Method Details
-
define
void define(String name, GrammarSection.Combine combine, P pattern, L loc, A anno) throws BuildException Called when a pattern is defined.- Parameters:
name
- Name of the pattern. For the definition by a <start/> element, this parameter is the same asSTART
. to test if it's a named pattern definition or the start pattern definition.combine
- null orCOMBINE_CHOICE
orCOMBINE_INTERLEAVE
depending on the value of the combine attribute.pattern
- The pattern to be defined.- Throws:
BuildException
-
topLevelAnnotation
Called when an annotation is found.- Throws:
BuildException
-
topLevelComment
Called when a comment is found.- Throws:
BuildException
-
makeDiv
Called when <div> is found.- Returns:
- the returned
Div
object will receive callbacks for structures inside the <div> element.
-
makeInclude
Returns null if already in an include.
-