fmrisc.AST
Class ASTUtil

java.lang.Object
  extended byfmrisc.AST.ASTUtil

public final class ASTUtil
extends java.lang.Object

Collect state related to handling of abstract syntax trees.


Constructor Summary
ASTUtil()
           
 
Method Summary
static boolean getPrintCVCL()
          show whether CVCL syntax is used
static boolean getPrintOldCVCL()
          show whether old CVCL syntax is used
static boolean getPrintParens()
          show whether every (sub)expression is to be printed with enclosing parentheses
static boolean getPrintUnique()
          show whether every identifier is printed with its unique name
static boolean getPrintVarNumber()
          show whether every local variable is printed with its variable number
static java.lang.String getUniqueName(java.lang.String name)
          create unique identifier name from given name
static void setPrintCVCL(boolean flag)
          signal whether CVCL syntax is used
static void setPrintOldCVCL(boolean flag)
          signal whether old CVCL syntax is used
static void setPrintParens(boolean flag)
          signal whether every (sub)expression is to be printed with enclosing parentheses
static void setPrintUnique(boolean flag)
          signal whether every identifier is printed with its unique name
static void setPrintVarNumber(boolean flag)
          signal whether every identifier is printed with its variable number
static Declaration[] toDeclarationArray(java.util.Vector v)
          converts vector v of Declaration objects to Declaration array
static Expression[] toExpressionArray(java.util.Vector v)
          converts vector v of Expression objects to Expression array
static Selector[] toSelectorArray(java.util.Vector v)
          converts vector v of Selector objects to Selector array
static Type[] toTypeArray(java.util.Vector v)
          converts vector v of Type objects to Type array
static TypedIdentifier[] toTypedIdentifierArray(java.util.Vector v)
          converts vector v of TypedIdentifer objects to TypedIdentifier array
static ValueDeclaration[] toValueDeclarationArray(java.util.Vector v)
          converts vector v of ValueDeclaration objects to Declaration array
static ValuedIdentifier[] toValuedIdentifierArray(java.util.Vector v)
          converts vector v of ValuedIdentifer objects to ValuedIdentifier array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTUtil

public ASTUtil()
Method Detail

setPrintParens

public static void setPrintParens(boolean flag)
signal whether every (sub)expression is to be printed with enclosing parentheses

Parameters:
flag - true iff enclosing parenthesis are to be printed

getPrintParens

public static boolean getPrintParens()
show whether every (sub)expression is to be printed with enclosing parentheses

Returns:
true iff enclosing parenthesis are to be printed

setPrintUnique

public static void setPrintUnique(boolean flag)
signal whether every identifier is printed with its unique name

Parameters:
flag - true iff unique name is to be printed

getPrintUnique

public static boolean getPrintUnique()
show whether every identifier is printed with its unique name

Returns:
true iff unique name is printed

setPrintVarNumber

public static void setPrintVarNumber(boolean flag)
signal whether every identifier is printed with its variable number

Parameters:
flag - true iff variable number is to be printed

getPrintVarNumber

public static boolean getPrintVarNumber()
show whether every local variable is printed with its variable number

Returns:
true iff variable number is printed

setPrintCVCL

public static void setPrintCVCL(boolean flag)
signal whether CVCL syntax is used

Parameters:
flag - true iff CVCL syntax is used

getPrintCVCL

public static boolean getPrintCVCL()
show whether CVCL syntax is used

Returns:
true iff CVCL syntax is used

setPrintOldCVCL

public static void setPrintOldCVCL(boolean flag)
signal whether old CVCL syntax is used

Parameters:
flag - true iff old syntax is used

getPrintOldCVCL

public static boolean getPrintOldCVCL()
show whether old CVCL syntax is used

Returns:
true iff old syntax is used

toDeclarationArray

public static Declaration[] toDeclarationArray(java.util.Vector v)
converts vector v of Declaration objects to Declaration array

Parameters:
v - a vector holding Declaration objects
Returns:
an array holding these objects

toValueDeclarationArray

public static ValueDeclaration[] toValueDeclarationArray(java.util.Vector v)
converts vector v of ValueDeclaration objects to Declaration array

Parameters:
v - a vector holding Declaration objects
Returns:
an array holding these objects

toTypeArray

public static Type[] toTypeArray(java.util.Vector v)
converts vector v of Type objects to Type array

Parameters:
v - a vector holding AST objects
Returns:
an array holding these objects

toExpressionArray

public static Expression[] toExpressionArray(java.util.Vector v)
converts vector v of Expression objects to Expression array

Parameters:
v - a vector holding Expression objects
Returns:
an array holding these objects

toSelectorArray

public static Selector[] toSelectorArray(java.util.Vector v)
converts vector v of Selector objects to Selector array

Parameters:
v - a vector holding Selector objects
Returns:
an array holding these objects

toTypedIdentifierArray

public static TypedIdentifier[] toTypedIdentifierArray(java.util.Vector v)
converts vector v of TypedIdentifer objects to TypedIdentifier array

Parameters:
v - a vector holding TypedIdentifier objects
Returns:
an array holding these objects

toValuedIdentifierArray

public static ValuedIdentifier[] toValuedIdentifierArray(java.util.Vector v)
converts vector v of ValuedIdentifer objects to ValuedIdentifier array

Parameters:
v - a vector holding ValuedIdentifier objects
Returns:
an array holding these objects

getUniqueName

public static java.lang.String getUniqueName(java.lang.String name)
create unique identifier name from given name

Parameters:
name - of an identifier
Returns:
a unique version of name not in use anywhere else