|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.uzh.ifi.attempto.chartparser.GrammarRule
public class GrammarRule
This class represents a grammar rule. A grammar rule consists of a nonterminal category (called "head") and a sequence of categories (called "body"). Furthermore, a grammar rule can be scope-closing, which means that all scopes opened by its children are closed at the position after the last child category.
Constructor Summary | |
---|---|
GrammarRule(Annotation annotation,
java.util.List<Category> categories,
boolean scopeclosing)
Creates a new grammar rule. |
|
GrammarRule(Annotation annotation,
Nonterminal head,
boolean scopeclosing,
Category... body)
Creates a new grammar rule. |
|
GrammarRule(Nonterminal head,
boolean scopeclosing,
Category... body)
Creates a new grammar rule. |
|
GrammarRule(Nonterminal head,
Category... body)
Creates a new grammar rule that is not scope-closing. |
Method Summary | |
---|---|
GrammarRule |
deepCopy()
Creates a deep copy of this rule. |
Annotation |
getAnnotation()
Returns the annotation object of this rule. |
Category[] |
getBody()
Returns the body category sequence of this grammar rule. |
Category |
getFirst()
Returns the first category of the body. |
Nonterminal |
getHead()
Returns the head category of this grammar rule. |
boolean |
hasEmptyBody()
Returns true if the body is empty. |
boolean |
isScopeClosing()
Returns true if the rule is scope-closing. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GrammarRule(Annotation annotation, Nonterminal head, boolean scopeclosing, Category... body)
annotation
- The annotation object.head
- The head category.scopeclosing
- Defines whether the rule is scope-closing or not.body
- The category sequence of the body.public GrammarRule(Nonterminal head, boolean scopeclosing, Category... body)
head
- The head category.scopeclosing
- Defines whether the rule is scope-closing or not.body
- The category sequence of the body.public GrammarRule(Nonterminal head, Category... body)
head
- The head category.body
- The body category sequence.public GrammarRule(Annotation annotation, java.util.List<Category> categories, boolean scopeclosing)
annotation
- The annotation object.categories
- The first category of this list stands for the head category (it has to be
a Nonterminal object). The rest stands for the body categories.scopeclosing
- Defines whether the rule is scope-closing or not.Method Detail |
---|
public Nonterminal getHead()
public Category[] getBody()
public boolean hasEmptyBody()
public Category getFirst()
public boolean isScopeClosing()
public Annotation getAnnotation()
public GrammarRule deepCopy()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |