public final class ASTUtil
extends java.lang.Object
Constructor and Description |
---|
ASTUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
canonicalText(AST exp)
get canonical text of expression (variable names replaced by numbers).
|
static java.lang.String |
getBaseName(java.lang.String name)
Get base name from name.
|
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 int |
getVarNumber()
get current variable number for printing
|
static int |
incVarNumber()
increase the current variable number for printing by one
|
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 void |
setVarNumber(int varNumber)
set the current variable number for printing
|
static Expression |
toConjunction(Expression[] formulas)
Construct conjunction of sequence of formulas.
|
static Declaration[] |
toDeclarationArray(java.util.Vector<Declaration> v)
converts vector v of Declaration objects to Declaration array
|
static Expression |
toDisjunction(Expression[] formulas)
Construct disjunction of sequence of formulas.
|
static Expression[] |
toExpressionArray(java.util.Vector<Expression> v)
converts vector v of Expression objects to Expression array
|
static Reference[] |
toReferenceArray(java.util.Vector<Reference> v)
converts vector v of Reference objects toarray
|
static Selector[] |
toSelectorArray(java.util.Vector<Selector> v)
converts vector v of Selector objects to Selector array
|
static java.lang.String[] |
toStringArray(java.util.Vector<java.lang.String> v)
converts vector v of String objects to String array
|
static Type[] |
toTypeArray(java.util.Vector<Type> v)
converts vector v of Type objects to Type array
|
static TypeDeclaration[] |
toTypeDeclarationArray(java.util.Vector<TypeDeclaration> v)
converts vector v of TypeDeclaration objects to TypeDeclaration array
|
static TypedIdentifier[] |
toTypedIdentifierArray(java.util.Vector<TypedIdentifier> v)
converts vector v of TypedIdentifer objects to TypedIdentifier array
|
static ValueDeclaration[] |
toValueDeclarationArray(java.util.Vector<ValueDeclaration> v)
converts vector v of ValueDeclaration objects to ValueDeclaration array
|
static ValuedIdentifier[] |
toValuedIdentifierArray(java.util.Vector<ValuedIdentifier> v)
converts vector v of ValuedIdentifer objects to ValuedIdentifier array
|
public static void setPrintParens(boolean flag)
flag
- true iff enclosing parenthesis are to be printedpublic static boolean getPrintParens()
public static void setPrintUnique(boolean flag)
flag
- true iff unique name is to be printedpublic static boolean getPrintUnique()
public static void setPrintVarNumber(boolean flag)
flag
- true iff variable number is to be printedpublic static boolean getPrintVarNumber()
public static void setVarNumber(int varNumber)
varNumber
- the variable numberpublic static int incVarNumber()
public static int getVarNumber()
public static java.lang.String[] toStringArray(java.util.Vector<java.lang.String> v)
v
- a vector holding String objectspublic static Reference[] toReferenceArray(java.util.Vector<Reference> v)
v
- a vector holding Reference objectspublic static Declaration[] toDeclarationArray(java.util.Vector<Declaration> v)
v
- a vector holding Declaration objectspublic static ValueDeclaration[] toValueDeclarationArray(java.util.Vector<ValueDeclaration> v)
v
- a vector holding ValueDeclaration objectspublic static TypeDeclaration[] toTypeDeclarationArray(java.util.Vector<TypeDeclaration> v)
v
- a vector holding TypeDeclaration objectspublic static Type[] toTypeArray(java.util.Vector<Type> v)
v
- a vector holding AST objectspublic static Expression[] toExpressionArray(java.util.Vector<Expression> v)
v
- a vector holding Expression objectspublic static Selector[] toSelectorArray(java.util.Vector<Selector> v)
v
- a vector holding Selector objectspublic static TypedIdentifier[] toTypedIdentifierArray(java.util.Vector<TypedIdentifier> v)
v
- a vector holding TypedIdentifier objectspublic static ValuedIdentifier[] toValuedIdentifierArray(java.util.Vector<ValuedIdentifier> v)
v
- a vector holding ValuedIdentifier objectspublic static java.lang.String getUniqueName(java.lang.String name)
name
- of an identifierpublic static java.lang.String getBaseName(java.lang.String name)
name
- a name (possible unique as returned by getUniqueName()).public static java.lang.String canonicalText(AST exp)
exp
- the expression.public static Expression toConjunction(Expression[] formulas)
formulas
- a sequence of formulas.public static Expression toDisjunction(Expression[] formulas)
formulas
- a sequence of formulas.