xtc.parser
Class ProductionOverride

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.parser.Production
          extended by xtc.parser.PartialProduction
              extended by xtc.parser.ProductionOverride
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable

public class ProductionOverride
extends PartialProduction

A production override. This class represents a modification that replaces a production's alternatives. It can also specify new attributes for a production. Either the attributes or the choice may be null, in which case the original production's attributes or choice, respectively, remain unmodified. If the choice is not null, the isComplete flag specifies whether the choice replaces the original production's choice or only specific alternatives.

Version:
$Revision: 1.7 $
Author:
Robert Grimm

Field Summary
 boolean isComplete
          The flag for whether the choice overrides the entire production or only specific alternatives.
 
Fields inherited from class xtc.parser.Production
attributes, choice, dType, name, qName, type
 
Constructor Summary
ProductionOverride(java.util.List<Attribute> attributes, java.lang.String dType, NonTerminal name)
          Create a new production override.
ProductionOverride(java.lang.String dType, NonTerminal name, OrderedChoice choice, boolean isComplete)
          Create a new production override.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean isOverride()
          Determine whether this production is a production override.
 
Methods inherited from class xtc.parser.PartialProduction
isPartial
 
Methods inherited from class xtc.parser.Production
hasAttribute, hashCode, isAddition, isFull, isMemoized, isRemoval
 
Methods inherited from class xtc.tree.Node
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, getTokenText, hasLocation, hasName, hasProperty, hasTraversal, hasVariable, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, properties, remove, removeProperty, set, setLocation, setLocation, setProperty, size, strip, toAnnotation, toList, toString, toToken, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

isComplete

public boolean isComplete
The flag for whether the choice overrides the entire production or only specific alternatives.

Constructor Detail

ProductionOverride

public ProductionOverride(java.util.List<Attribute> attributes,
                          java.lang.String dType,
                          NonTerminal name)
Create a new production override.

Parameters:
attributes - The attributes.
dType - The declared type.
name - The name.

ProductionOverride

public ProductionOverride(java.lang.String dType,
                          NonTerminal name,
                          OrderedChoice choice,
                          boolean isComplete)
Create a new production override.

Parameters:
dType - The declared type.
name - The name.
choice - The choice.
isComplete - The completeness flag.
Method Detail

isOverride

public boolean isOverride()
Description copied from class: Production
Determine whether this production is a production override.

Overrides:
isOverride in class Production
Returns:
true if this production is a production override.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2012. All Rights Reserved.