|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.uzh.ifi.attempto.chartparser.Rule
public class Rule
This class represents a grammar rule. A rule consists of a nonterminal category as its head and a sequence of categories as its body. Furthermore, a rule can be accessible for anaphoric references or not. If a rule is not accessible then this means that no category of the body and no subcategory of those categories is accessible for references by any category outside of the body.
Constructor Summary | |
---|---|
Rule(java.util.List<Category> categories)
Creates a new rule that is accessible. |
|
Rule(java.util.List<Category> categories,
boolean accessible)
Creates a new rule. |
|
Rule(Nonterminal head,
boolean accessible,
Category... body)
Creates a new rule. |
|
Rule(Nonterminal head,
Category... body)
Creates a new rule that is accessible. |
Method Summary | |
---|---|
Rule |
deepCopy()
Creates a deep copy of this rule. |
Category[] |
getBody()
Returns the body category sequence of this rule. |
Category |
getFirst()
Returns the first category of the body. |
Nonterminal |
getHead()
Returns the head category of this rule. |
boolean |
hasEmptyBody()
Returns true if the body is empty (i.e. |
boolean |
isAccessible()
Returns true if the rule is accessible. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Rule(Nonterminal head, boolean accessible, Category... body)
head
- The head category.accessible
- Defines whether the rule is accessible or not.body
- The body category sequence.public Rule(Nonterminal head, Category... body)
head
- The head category.body
- The body category sequence.public Rule(java.util.List<Category> categories, boolean accessible)
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.accessible
- Defines whether the rule is accessible or not.public Rule(java.util.List<Category> categories)
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.Method Detail |
---|
public Nonterminal getHead()
public Category[] getBody()
public boolean hasEmptyBody()
public Category getFirst()
public boolean isAccessible()
public Rule 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 |