org.prorefactor.refactor.source
Class Expansion

java.lang.Object
  extended by org.prorefactor.refactor.source.Expansion
All Implemented Interfaces:
TETNode
Direct Known Subclasses:
ConditionalExpansion, IncludeExpansion, MacroExpansion

public abstract class Expansion
extends java.lang.Object
implements TETNode

An expansion is just a bunch of Token objects. Whether those came from a .p/.i, a macro expansion, or a branch of an &IF block, depends on the Expansion type: IncludeExpansion, MacroExpansion, ConditionalExpansion.

For any given curly expansion, there may be more than one way to expand it, depending on if its declaration(s) are found within conditional compile branches (&IF). Usually there's just one.


Method Summary
 Expansion[] getDerivation()
          Get the array of Expansion objects which were used for finding the text for nested tokens within the curly ref that this expansion is for.
 Token getFirstToken()
          The first token in the chain of tokens which resulted from this expansion.
 boolean isParsed()
          Has this expansion (possibly an alternative branch) been parsed? (i.e.
 boolean isPrimary()
          When there's alternative expansions, we want to know whether this is the branch used by the configuration we got when we did parser.parse().
 void setParsed(boolean isParsed)
           
 void setPrimary(boolean isPrimary)
           
 java.lang.String toString()
          XML node text for the Expansion.
abstract  java.lang.String toStringSub()
          Use this method to display the subclass's attributes in XML subnode text (will be subnodes of an node).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.prorefactor.refactor.source.TETNode
nearestEnclosingFile
 

Method Detail

getDerivation

public Expansion[] getDerivation()
Get the array of Expansion objects which were used for finding the text for nested tokens within the curly ref that this expansion is for. Null if no nested tokens.


getFirstToken

public Token getFirstToken()
The first token in the chain of tokens which resulted from this expansion.


isParsed

public boolean isParsed()
Has this expansion (possibly an alternative branch) been parsed? (i.e. Have its nodes been mapped to an AST?)


isPrimary

public boolean isPrimary()
When there's alternative expansions, we want to know whether this is the branch used by the configuration we got when we did parser.parse().


setParsed

public void setParsed(boolean isParsed)
See Also:
isParsed()

setPrimary

public void setPrimary(boolean isPrimary)
See Also:
isPrimary()

toString

public java.lang.String toString()
XML node text for the Expansion.

Overrides:
toString in class java.lang.Object
See Also:
toStringSub()

toStringSub

public abstract java.lang.String toStringSub()
Use this method to display the subclass's attributes in XML subnode text (will be subnodes of an node).



Copyright © 2008 Joanju Software. All Rights Reserved.