xtc.parser
Class PrefixFolder

java.lang.Object
  extended by xtc.tree.Visitor
      extended by xtc.parser.GrammarVisitor
          extended by xtc.parser.PrefixFolder

public class PrefixFolder
extends GrammarVisitor

Visitor to combine common prefixes into a single sequence with an embedded choice. Note that the different alternatives in an ordered choice must have been normalized into sequences.

Version:
$Revision: 1.18 $
Author:
Robert Grimm

Field Summary
 
Fields inherited from class xtc.parser.GrammarVisitor
analyzer, isBound, isLastElement, isPredicate, isRepeatedOnce, isTopLevel, isVoided, needsSequence, runtime, transformInPlace
 
Constructor Summary
PrefixFolder(Runtime runtime, Analyzer analyzer)
          Create a new prefix folder.
 
Method Summary
 Element visit(OrderedChoice c)
          Visit the specified ordered choice.
 Element visit(Predicate p)
          Visit the specified predicate.
 
Methods inherited from class xtc.parser.GrammarVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class xtc.tree.Visitor
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixFolder

public PrefixFolder(Runtime runtime,
                    Analyzer analyzer)
Create a new prefix folder.

Parameters:
runtime - The runtime.
analyzer - The analyzer utility.
Method Detail

visit

public Element visit(OrderedChoice c)
Visit the specified ordered choice.

Overrides:
visit in class GrammarVisitor

visit

public Element visit(Predicate p)
Visit the specified predicate.

Overrides:
visit in class GrammarVisitor


Copyright © 2012. All Rights Reserved.