xtc.tree
Class ParseTreeStripper

java.lang.Object
  extended by xtc.tree.Visitor
      extended by xtc.tree.ParseTreeStripper

public class ParseTreeStripper
extends Visitor

Visitor to strip parse trees. This visitor eliminates any formatting and tokens, replacing the former with the annotated node and the latter with the text.

Version:
$Revision: 1.2 $
Author:
Robert Grimm

Constructor Summary
ParseTreeStripper()
          Create a new parse tree stripper.
 
Method Summary
 Annotation visit(Annotation n)
          Visit the specified annotation.
 java.lang.Object visit(Formatting f)
          Visit the specified formatting.
 GNode visit(GNode n)
          Visit the specified generic node.
 java.lang.String visit(Token t)
          Visit the specified token.
 
Methods inherited from class xtc.tree.Visitor
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseTreeStripper

public ParseTreeStripper()
Create a new parse tree stripper.

Method Detail

visit

public GNode visit(GNode n)
Visit the specified generic node.


visit

public Annotation visit(Annotation n)
Visit the specified annotation.

Overrides:
visit in class Visitor
Parameters:
n - The annotation.
Returns:
The result of applying this visitor on the referenced node.

visit

public java.lang.Object visit(Formatting f)
Visit the specified formatting.


visit

public java.lang.String visit(Token t)
Visit the specified token.



Copyright © 2012. All Rights Reserved.