|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fmrisc.Syntax.ASTUtil
public final class ASTUtil
Collect state related to handling of abstract syntax trees.
Constructor Summary | |
---|---|
ASTUtil()
|
Method Summary | |
---|---|
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 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 v)
converts vector v of Expression objects to Expression array |
static Reference[] |
toReferenceArray(java.util.Vector v)
converts vector v of Reference objects toarray |
static Selector[] |
toSelectorArray(java.util.Vector v)
converts vector v of Selector objects to Selector array |
static java.lang.String[] |
toStringArray(java.util.Vector v)
converts vector v of String objects to String array |
static Type[] |
toTypeArray(java.util.Vector v)
converts vector v of Type objects to Type array |
static TypeDeclaration[] |
toTypeDeclarationArray(java.util.Vector v)
converts vector v of TypeDeclaration objects to TypeDeclaration 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 ValueDeclaration 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 |
---|
public ASTUtil()
Method Detail |
---|
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 v)
v
- a vector holding String objects
public static Reference[] toReferenceArray(java.util.Vector v)
v
- a vector holding Reference objects
public static Declaration[] toDeclarationArray(java.util.Vector v)
v
- a vector holding Declaration objects
public static ValueDeclaration[] toValueDeclarationArray(java.util.Vector v)
v
- a vector holding ValueDeclaration objects
public static TypeDeclaration[] toTypeDeclarationArray(java.util.Vector v)
v
- a vector holding TypeDeclaration objects
public static Type[] toTypeArray(java.util.Vector v)
v
- a vector holding AST objects
public static Expression[] toExpressionArray(java.util.Vector v)
v
- a vector holding Expression objects
public static Selector[] toSelectorArray(java.util.Vector v)
v
- a vector holding Selector objects
public static TypedIdentifier[] toTypedIdentifierArray(java.util.Vector v)
v
- a vector holding TypedIdentifier objects
public static ValuedIdentifier[] toValuedIdentifierArray(java.util.Vector v)
v
- a vector holding ValuedIdentifier objects
public static java.lang.String getUniqueName(java.lang.String name)
name
- of an identifier
public 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)
public static Expression toConjunction(Expression[] formulas)
formulas
- a sequence of formulas.
public static Expression toDisjunction(Expression[] formulas)
formulas
- a sequence of formulas.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |