net.sourceforge.chaperon.model.extended
Class Definition

java.lang.Object
  extended by net.sourceforge.chaperon.model.extended.Pattern
      extended by net.sourceforge.chaperon.model.extended.PatternList
          extended by net.sourceforge.chaperon.model.extended.Definition
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Definition
extends PatternList

This class presents a definition of a grammar

Version:
CVS $Id: Definition.java,v 1.2 2003/12/14 09:44:21 benedikta Exp $
Author:
Stephan Michels
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.chaperon.model.extended.Pattern
index
 
Constructor Summary
Definition()
          Create an empty definition.
Definition(java.lang.String symbol)
          Create a definition.
 
Method Summary
 java.lang.Object clone()
          Create a clone this pattern.
 boolean equals(java.lang.Object o)
          Compares the definition with another definition.
 java.lang.String getLocation()
          Returns the location from the input source.
 java.lang.String getSymbol()
          Return the symbol from this definition
 void setLocation(java.lang.String location)
          Set the location from the input source.
 void setSymbol(java.lang.String symbol)
          Set the symbol for this definition
 java.lang.String toString(PatternSet previous, PatternSet next)
          Return a string representation of the definition.
 Violations validate()
          Validates the definition.
 
Methods inherited from class net.sourceforge.chaperon.model.extended.PatternList
addPattern, contains, contains, getAllPattern, getFirstSet, getLastSet, getLimits, getPattern, getPattern, getPatternAsArray, getPatternCount, isNullable, toString, update
 
Methods inherited from class net.sourceforge.chaperon.model.extended.Pattern
addAscendingSuccessor, addDescendingSuccessor, addSuccessor, getAncestors, getAscendingAncestors, getAscendingSuccessors, getDefinition, getDescendingAncestors, getDescendingSuccessors, getSuccessors, hasAncestor, hasAscendingAncestor, hasAscendingSuccessor, hasDescendingAncestor, hasDescendingSuccessor, hasSuccessor, setDefinition
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Definition

public Definition()
Create an empty definition.


Definition

public Definition(java.lang.String symbol)
Create a definition.

Parameters:
ntsymbol - The symbol of this definition.
Method Detail

setSymbol

public void setSymbol(java.lang.String symbol)
Set the symbol for this definition

Parameters:
ntsymbol - Non terminal symbol

getSymbol

public java.lang.String getSymbol()
Return the symbol from this definition

Overrides:
getSymbol in class PatternList
Returns:
Nonterminal symbol

setLocation

public void setLocation(java.lang.String location)
Set the location from the input source.

Overrides:
setLocation in class Pattern
Parameters:
location - Location in the input source.

getLocation

public java.lang.String getLocation()
Returns the location from the input source.

Overrides:
getLocation in class Pattern
Returns:
Location in the input source.

validate

public Violations validate()
Validates the definition.

Specified by:
validate in class Pattern
Returns:
Return a list of violations, if this object isn't valid.

equals

public boolean equals(java.lang.Object o)
Compares the definition with another definition.

Overrides:
equals in class java.lang.Object
Parameters:
o - Other object.
Returns:
True, if the definition are equal.

toString

public java.lang.String toString(PatternSet previous,
                                 PatternSet next)
Return a string representation of the definition.

Overrides:
toString in class PatternList
Returns:
String representation of the definition.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: Pattern
Create a clone this pattern.

Specified by:
clone in class Pattern
Returns:
Throws:
java.lang.CloneNotSupportedException


Copyright ? 2003 Chaperon project. All Rights Reserved.