xtc.parser
Class Production

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

public abstract class Production
extends Node

The superclass of full and partial productions.

Version:
$Revision: 1.36 $
Author:
Robert Grimm

Field Summary
 java.util.List<Attribute> attributes
          The optional attribute list.
 OrderedChoice choice
          The ordered choice.
 java.lang.String dType
          The production's declared type as a string.
 NonTerminal name
          The name.
 NonTerminal qName
          The fully qualified name.
 Type type
          The production's actual type, which must be filled in after parsing a module.
 
Constructor Summary
Production(java.util.List<Attribute> attributes, java.lang.String dType, NonTerminal name, NonTerminal qName, OrderedChoice choice)
          Create a new production.
Production(java.util.List<Attribute> attributes, Type type, NonTerminal name, NonTerminal qName, OrderedChoice choice)
          Create a new production.
 
Method Summary
 boolean hasAttribute(Attribute att)
          Determine whether this production has the specified attribute.
 int hashCode()
           
 boolean isAddition()
          Determine whether this production is an alternative addition.
 boolean isFull()
          Determine whether this production is a full production.
 boolean isMemoized()
          Determine whether this production is memoized.
 boolean isOverride()
          Determine whether this production is a production override.
 boolean isPartial()
          Determine whether this production is a partial production.
 boolean isRemoval()
          Determine whether this production is an alternative removal.
 
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, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

attributes

public java.util.List<Attribute> attributes
The optional attribute list.

Note that while a production's attributes are represented as an ordered list, they should be treated as a set.


dType

public java.lang.String dType
The production's declared type as a string.


type

public Type type
The production's actual type, which must be filled in after parsing a module.


name

public NonTerminal name
The name. A production's name does not have any qualification when the production is parsed. However, after uniquely renaming all productions to avoid name conflicts in the generated parser, this name may have a qualifier.

See Also:
Analyzer.uniquify()

qName

public NonTerminal qName
The fully qualified name.


choice

public OrderedChoice choice
The ordered choice.

Constructor Detail

Production

public Production(java.util.List<Attribute> attributes,
                  java.lang.String dType,
                  NonTerminal name,
                  NonTerminal qName,
                  OrderedChoice choice)
Create a new production.

Parameters:
attributes - The attributes.
dType - The declared type.
name - The name.
qName - The fully qualified name.
choice - The choice.

Production

public Production(java.util.List<Attribute> attributes,
                  Type type,
                  NonTerminal name,
                  NonTerminal qName,
                  OrderedChoice choice)
Create a new production.

Parameters:
attributes - The attributes.
type - The actual type.
name - The name.
qName - The fully qualified name.
choice - The choice.
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isFull

public boolean isFull()
Determine whether this production is a full production.

Returns:
true if this production is full.

isPartial

public boolean isPartial()
Determine whether this production is a partial production.

Returns:
true if this production is partial.

isAddition

public boolean isAddition()
Determine whether this production is an alternative addition.

Returns:
true if this production is an alternative addition.

isRemoval

public boolean isRemoval()
Determine whether this production is an alternative removal.

Returns:
true if this production is an alternative removal.

isOverride

public boolean isOverride()
Determine whether this production is a production override.

Returns:
true if this production is a production override.

hasAttribute

public boolean hasAttribute(Attribute att)
Determine whether this production has the specified attribute.

Parameters:
att - The attribute.
Returns:
true if this production has the specified attribute.

isMemoized

public boolean isMemoized()
Determine whether this production is memoized. This method is semantically equivalent to:
 hasAttribute(Constants.ATT_MEMOIZED) ||
 ((! hasAttribute(Constants.ATT_TRANSIENT)) &&
  (! hasAttribute(Constants.ATT_INLINE)))
 

Returns:
true if this production is memoized.


Copyright © 2012. All Rights Reserved.