ch.uzh.ifi.attempto.chartparser
Class Restriction

java.lang.Object
  extended by ch.uzh.ifi.attempto.chartparser.Restriction

public class Restriction
extends java.lang.Object

This class describes a restriction for the next token of a given token sequence. It contains of a category and of a number of exceptions which are again categories. In order to fulfill the restriction, the category of a token must be subsumed by the category of the restriction while not being subsumed by any of the exceptions. The exceptions come from negative backwards references in the grammar.

Author:
Tobias Kuhn

Method Summary
 Terminal getCategory()
          Returns the category of this restriction.
 java.util.List<Terminal> getExceptions()
          Returns the list of exceptions of this restriction.
 boolean isFulfilledBy(Terminal t)
          Returns true if the given category fulfills this restriction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCategory

public Terminal getCategory()
Returns the category of this restriction.

Returns:
The category.

getExceptions

public java.util.List<Terminal> getExceptions()
Returns the list of exceptions of this restriction.

Returns:
The list of exceptions.

isFulfilledBy

public boolean isFulfilledBy(Terminal t)
Returns true if the given category fulfills this restriction.

Parameters:
t - The category to be tested.
Returns:
true if the category fulfills this restriction.


Copyright 2008-2009, Attempto Group, University of Zurich (see http://attempto.ifi.uzh.ch)