laser.regularlanguage.util
Class REtoDFAInfoPrinter<L extends LabelInterface>

java.lang.Object
  extended by laser.regularlanguage.regularexpression.AbstractREVisitor<L>
      extended by laser.regularlanguage.util.AbstractREtoDFAVisitor<L>
          extended by laser.regularlanguage.util.REtoDFAInfoPrinter<L>
Type Parameters:
L - The type of labels used by the REs and DFAs.
All Implemented Interfaces:
REVisitor<L>

public class REtoDFAInfoPrinter<L extends LabelInterface>
extends AbstractREtoDFAVisitor<L>

The REtoDFAInfoPrinter class for each TreeNode within the RE parse tree prints out its associated REToDFAInfo Object.

Author:
Heather M. Conboy (laser-software@cs.umass.edu)

Field Summary
 
Fields inherited from class laser.regularlanguage.regularexpression.AbstractREVisitor
result
 
Constructor Summary
REtoDFAInfoPrinter(TreeNode<L> rootNode, java.util.Map<TreeNode<L>,REtoDFAInfo> nodeToInfo)
          Creates a new REtoDFAInfoPrinter.
 
Method Summary
 void caseChoiceNode(ChoiceNode<L> node, java.lang.Object context)
          Allows this Visitor to process the given ChoiceNode.
 void caseConcatenationNode(ConcatenationNode<L> node, java.lang.Object context)
          Allows this Visitor to process the given ConcatenationNode.
 void caseEpsilonNode(EpsilonNode<L> node, java.lang.Object context)
          Allows this Visitor to process the given EpsilonNode.
 void caseKleeneStarNode(KleeneStarNode<L> node, java.lang.Object context)
          Allows this Visitor to process the given KleeneStarNode.
 void caseLabelNode(LabelNode<L> node, java.lang.Object context)
          Allows this Visitor to process the given LabelNode.
 void caseMarkerNode(MarkerNode<L> node, java.lang.Object context)
          Allows this Visitor to process the given MarkerNode.
 java.lang.String print()
          Produces an output of a RE parse tree that is indented at each tree level.
 java.lang.String print(TreeNode<L> node, java.lang.String prefix)
          Produces an output of a TreeNode's REToDFAInfo Object that is indented at each tree level.
 
Methods inherited from class laser.regularlanguage.regularexpression.AbstractREVisitor
caseClassSetNode, caseDotNode, caseEmptyNode, caseExponentNode, caseKleenePlusNode, caseNotClassSetNode, caseOptionNode, defaultCase, getResult, setResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

REtoDFAInfoPrinter

public REtoDFAInfoPrinter(TreeNode<L> rootNode,
                          java.util.Map<TreeNode<L>,REtoDFAInfo> nodeToInfo)
Creates a new REtoDFAInfoPrinter.

Parameters:
rootNode - The root TreeNode of the RE parse tree
nodeToInfo - The mapping from TreeNodes to REToDFAInfo Objects
Method Detail

print

public java.lang.String print(TreeNode<L> node,
                              java.lang.String prefix)
Produces an output of a TreeNode's REToDFAInfo Object that is indented at each tree level.

Parameters:
node - The TreeNode of interest
prefix - the String to be appended before everything printed for this level. Should be a String of spaces
Returns:
a somewhat nicely formatted version of this TreeNode's REToDFAInfo Object

print

public java.lang.String print()
Produces an output of a RE parse tree that is indented at each tree level.

Returns:
a somewhat nicely formatted version of this RE parse tree

caseChoiceNode

public void caseChoiceNode(ChoiceNode<L> node,
                           java.lang.Object context)
Allows this Visitor to process the given ChoiceNode.

Specified by:
caseChoiceNode in interface REVisitor<L extends LabelInterface>
Overrides:
caseChoiceNode in class AbstractREVisitor<L extends LabelInterface>
Parameters:
node - The ChoiceNode to be processed
context - The calling context

caseConcatenationNode

public void caseConcatenationNode(ConcatenationNode<L> node,
                                  java.lang.Object context)
Allows this Visitor to process the given ConcatenationNode.

Specified by:
caseConcatenationNode in interface REVisitor<L extends LabelInterface>
Overrides:
caseConcatenationNode in class AbstractREVisitor<L extends LabelInterface>
Parameters:
node - The ConcatenationNode to be processed
context - The calling context

caseEpsilonNode

public void caseEpsilonNode(EpsilonNode<L> node,
                            java.lang.Object context)
Allows this Visitor to process the given EpsilonNode.

Specified by:
caseEpsilonNode in interface REVisitor<L extends LabelInterface>
Overrides:
caseEpsilonNode in class AbstractREVisitor<L extends LabelInterface>
Parameters:
node - The EpsilonNode to be processed
context - The calling context

caseKleeneStarNode

public void caseKleeneStarNode(KleeneStarNode<L> node,
                               java.lang.Object context)
Allows this Visitor to process the given KleeneStarNode.

Specified by:
caseKleeneStarNode in interface REVisitor<L extends LabelInterface>
Overrides:
caseKleeneStarNode in class AbstractREVisitor<L extends LabelInterface>
Parameters:
node - The KleeneStarNode to be processed
context - The calling context

caseLabelNode

public void caseLabelNode(LabelNode<L> node,
                          java.lang.Object context)
Allows this Visitor to process the given LabelNode.

Specified by:
caseLabelNode in interface REVisitor<L extends LabelInterface>
Overrides:
caseLabelNode in class AbstractREVisitor<L extends LabelInterface>
Parameters:
node - The LabelNode to be processed
context - The calling context

caseMarkerNode

public void caseMarkerNode(MarkerNode<L> node,
                           java.lang.Object context)
Allows this Visitor to process the given MarkerNode.

Overrides:
caseMarkerNode in class AbstractREtoDFAVisitor<L extends LabelInterface>
Parameters:
node - The MarkerNode to be processed
context - The calling context