org.prorefactor.refactor.source
Class Processor

java.lang.Object
  extended by org.prorefactor.refactor.source.Processor

public class Processor
extends java.lang.Object

This is a "pseudo processor", inspired by the C refactoring work done by Ralph Johnson and Alejandra Garrido.

It generates a complex tree of tokens, complete with all possible branches and expansions for all possible compile-time configurations.

We call our tree a Token Expansion Tree (TET). The model for the tree is made up of Token objects and Expansion objects.


Constructor Summary
Processor(java.io.File file, SourceFilePool sourceFilePool)
           
 
Method Summary
 java.util.List calculateTokenContents(Token token)
          For a Token, return a list of TokenContent objects.
 IncludeExpansion generateTree(CompileUnit compileUnit)
          Generate the Token Expansion Tree, returns the top node, which is an IncludeExpansion object.
static java.lang.String stripComments(java.lang.String orig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Processor

public Processor(java.io.File file,
                 SourceFilePool sourceFilePool)
Method Detail

calculateTokenContents

public java.util.List calculateTokenContents(Token token)
For a Token, return a list of TokenContent objects. Will return only one, unless the token has multiple possible values due to nested tokens and conditional compilation.


generateTree

public IncludeExpansion generateTree(CompileUnit compileUnit)
                              throws java.io.IOException,
                                     RefactorException
Generate the Token Expansion Tree, returns the top node, which is an IncludeExpansion object.

Throws:
java.io.IOException
RefactorException

stripComments

public static java.lang.String stripComments(java.lang.String orig)


Copyright © 2008 Joanju Software. All Rights Reserved.