tom.engine.adt.tomdeclaration.types.declaration
Class MakeDecl

java.lang.Object
  extended by tom.engine.adt.tomdeclaration.TomDeclarationAbstractType
      extended by tom.engine.adt.tomdeclaration.types.Declaration
          extended by tom.engine.adt.tomdeclaration.types.declaration.MakeDecl
All Implemented Interfaces:
Comparable, shared.SharedObject, shared.SharedObjectWithID, Visitable

public final class MakeDecl
extends Declaration
implements Visitable


Field Summary
 
Fields inherited from class tom.engine.adt.tomdeclaration.types.Declaration
idConv
 
Fields inherited from class tom.engine.adt.tomdeclaration.TomDeclarationAbstractType
atermFactory, factory
 
Method Summary
 int compareTo(Object o)
          Compares two terms.
 int compareToLPO(Object o)
          Compares two terms.
 shared.SharedObject duplicate()
          Copy the object and returns the copy
 boolean equivalent(shared.SharedObject obj)
          Checks if a SharedObject is equivalent to the current object
static Declaration fromTerm(aterm.ATerm trm, ATermConverter atConv)
          Apply a conversion on the ATerm contained in the String and returns a tom.engine.adt.tomdeclaration.types.Declaration from it
 BQTermList getArgs()
          Returns the attribute tom.engine.adt.code.types.BQTermList
 TomName getAstName()
          Returns the attribute tom.engine.adt.tomname.types.TomName
 TomType getAstType()
          Returns the attribute tom.engine.adt.tomtype.types.TomType
 Visitable getChildAt(int index)
          Returns the child at the specified index
 int getChildCount()
          Returns the number of childs of the term
 Visitable[] getChildren()
          Returns the whole children of the term
 Instruction getInstr()
          Returns the attribute tom.engine.adt.tominstruction.types.Instruction
 Option getOrgTrack()
          Returns the attribute tom.engine.adt.tomoption.types.Option
 int hashCode()
          Returns hashCode
protected  int hashFunction()
          Compute a hashcode for this term.
 boolean isMakeDecl()
          Returns true if the term is rooted by the symbol MakeDecl
static MakeDecl make(TomName _AstName, TomType _AstType, BQTermList _Args, Instruction _Instr, Option _OrgTrack)
          Constructor that builds a term rooted by MakeDecl
 Declaration setArgs(BQTermList set_arg)
          Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration
 Declaration setAstName(TomName set_arg)
          Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration
 Declaration setAstType(TomType set_arg)
          Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration
 Visitable setChildAt(int index, Visitable v)
          Set the child at the specified index
 Visitable setChildren(Visitable[] childs)
          Set children to the term
 Declaration setInstr(Instruction set_arg)
          Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration
 Declaration setOrgTrack(Option set_arg)
          Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration
 String symbolName()
          Returns the name of the symbol
 aterm.ATerm toATerm()
          Returns an ATerm representation of this term.
 void toStringBuilder(StringBuilder buffer)
          Appends a string representation of this term to the buffer given as argument.
 
Methods inherited from class tom.engine.adt.tomdeclaration.types.Declaration
fromStream, fromStream, fromString, fromString, fromTerm, getArgumentList, getCodomain, getDeclaration, getDeclarations, getDeclList, getExpr, getExtendsTerm, getExtendsType, getIndex, getInstruction, getOpname, getSlotName, getSName, getSuperTerm, getTermArg, getTermArg1, getTermArg2, getThrowsType, getVarElt, getVariable, getVarList, getVarSize, getVisitList, isAbstractDecl, isACSymbolDecl, isArraySymbolDecl, isClass, isEmptyDeclaration, isEqualTermDecl, isFunctionDef, isGetElementDecl, isGetHeadDecl, isGetImplementationDecl, isGetSizeDecl, isGetSlotDecl, isGetTailDecl, isIntrospectorClass, isIsEmptyDecl, isIsFsymDecl, isIsSortDecl, isListSymbolDecl, isMakeAddArray, isMakeAddList, isMakeEmptyArray, isMakeEmptyList, isMethodDef, isStrategy, isSymbolDecl, isTypeTermDecl, length, reverse, setArgumentList, setCodomain, setDeclaration, setDeclarations, setDeclList, setExpr, setExtendsTerm, setExtendsType, setIndex, setInstruction, setOpname, setSlotName, setSName, setSuperTerm, setTermArg, setTermArg1, setTermArg2, setThrowsType, setVarElt, setVariable, setVarList, setVarSize, setVisitList
 
Methods inherited from class tom.engine.adt.tomdeclaration.TomDeclarationAbstractType
convertATermToBoolean, convertATermToChar, convertATermToDouble, convertATermToFloat, convertATermToInt, convertATermToLong, convertATermToString, getUniqueIdentifier, setUniqueIdentifier, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

make

public static MakeDecl make(TomName _AstName,
                            TomType _AstType,
                            BQTermList _Args,
                            Instruction _Instr,
                            Option _OrgTrack)
Constructor that builds a term rooted by MakeDecl

Returns:
a term rooted by MakeDecl

symbolName

public String symbolName()
Returns the name of the symbol

Specified by:
symbolName in class TomDeclarationAbstractType
Returns:
the name of the symbol

duplicate

public shared.SharedObject duplicate()
Copy the object and returns the copy

Specified by:
duplicate in interface shared.SharedObject
Returns:
a clone of the SharedObject

toStringBuilder

public void toStringBuilder(StringBuilder buffer)
Appends a string representation of this term to the buffer given as argument.

Specified by:
toStringBuilder in class TomDeclarationAbstractType
Parameters:
buffer - the buffer to which a string represention of this term is appended.

compareToLPO

public int compareToLPO(Object o)
Compares two terms. This functions implements a total lexicographic path ordering.

Specified by:
compareToLPO in class TomDeclarationAbstractType
Parameters:
o - object to which this term is compared
Returns:
a negative integer, zero, or a positive integer as this term is less than, equal to, or greater than the argument
Throws:
ClassCastException - in case of invalid arguments
RuntimeException - if unable to compare childs

compareTo

public int compareTo(Object o)
Compares two terms. This functions implements a total order.

Specified by:
compareTo in interface Comparable
Specified by:
compareTo in class TomDeclarationAbstractType
Parameters:
o - object to which this term is compared
Returns:
a negative integer, zero, or a positive integer as this term is less than, equal to, or greater than the argument
Throws:
ClassCastException - in case of invalid arguments
RuntimeException - if unable to compare childs

hashCode

public final int hashCode()
Returns hashCode

Specified by:
hashCode in interface shared.SharedObject
Overrides:
hashCode in class Object
Returns:
hashCode

equivalent

public final boolean equivalent(shared.SharedObject obj)
Checks if a SharedObject is equivalent to the current object

Specified by:
equivalent in interface shared.SharedObject
Parameters:
obj - SharedObject to test
Returns:
true if obj is a MakeDecl and its members are equal, else false

isMakeDecl

public boolean isMakeDecl()
Returns true if the term is rooted by the symbol MakeDecl

Overrides:
isMakeDecl in class Declaration
Returns:
true, because this is rooted by MakeDecl

getAstName

public TomName getAstName()
Returns the attribute tom.engine.adt.tomname.types.TomName

Overrides:
getAstName in class Declaration
Returns:
the attribute tom.engine.adt.tomname.types.TomName

setAstName

public Declaration setAstName(TomName set_arg)
Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration

Overrides:
setAstName in class Declaration
Parameters:
set_arg - the argument to set
Returns:
the attribute tom.engine.adt.tomname.types.TomName which just has been set

getAstType

public TomType getAstType()
Returns the attribute tom.engine.adt.tomtype.types.TomType

Overrides:
getAstType in class Declaration
Returns:
the attribute tom.engine.adt.tomtype.types.TomType

setAstType

public Declaration setAstType(TomType set_arg)
Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration

Overrides:
setAstType in class Declaration
Parameters:
set_arg - the argument to set
Returns:
the attribute tom.engine.adt.tomtype.types.TomType which just has been set

getArgs

public BQTermList getArgs()
Returns the attribute tom.engine.adt.code.types.BQTermList

Overrides:
getArgs in class Declaration
Returns:
the attribute tom.engine.adt.code.types.BQTermList

setArgs

public Declaration setArgs(BQTermList set_arg)
Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration

Overrides:
setArgs in class Declaration
Parameters:
set_arg - the argument to set
Returns:
the attribute tom.engine.adt.code.types.BQTermList which just has been set

getInstr

public Instruction getInstr()
Returns the attribute tom.engine.adt.tominstruction.types.Instruction

Overrides:
getInstr in class Declaration
Returns:
the attribute tom.engine.adt.tominstruction.types.Instruction

setInstr

public Declaration setInstr(Instruction set_arg)
Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration

Overrides:
setInstr in class Declaration
Parameters:
set_arg - the argument to set
Returns:
the attribute tom.engine.adt.tominstruction.types.Instruction which just has been set

getOrgTrack

public Option getOrgTrack()
Returns the attribute tom.engine.adt.tomoption.types.Option

Overrides:
getOrgTrack in class Declaration
Returns:
the attribute tom.engine.adt.tomoption.types.Option

setOrgTrack

public Declaration setOrgTrack(Option set_arg)
Sets and returns the attribute tom.engine.adt.tomdeclaration.types.Declaration

Overrides:
setOrgTrack in class Declaration
Parameters:
set_arg - the argument to set
Returns:
the attribute tom.engine.adt.tomoption.types.Option which just has been set

toATerm

public aterm.ATerm toATerm()
Returns an ATerm representation of this term.

Overrides:
toATerm in class Declaration
Returns:
an ATerm representation of this term.

fromTerm

public static Declaration fromTerm(aterm.ATerm trm,
                                   ATermConverter atConv)
Apply a conversion on the ATerm contained in the String and returns a tom.engine.adt.tomdeclaration.types.Declaration from it

Parameters:
trm - ATerm to convert into a Gom term
atConv - ATerm Converter used to convert the ATerm
Returns:
the Gom term

getChildCount

public int getChildCount()
Returns the number of childs of the term

Specified by:
getChildCount in interface Visitable
Returns:
the number of childs of the term

getChildAt

public Visitable getChildAt(int index)
Returns the child at the specified index

Specified by:
getChildAt in interface Visitable
Parameters:
index - index of the child to return; must be nonnegative and less than the childCount
Returns:
the child at the specified index
Throws:
IndexOutOfBoundsException - if the index out of range

setChildAt

public Visitable setChildAt(int index,
                            Visitable v)
Set the child at the specified index

Specified by:
setChildAt in interface Visitable
Parameters:
index - index of the child to set; must be nonnegative and less than the childCount
v - child to set at the specified index
Returns:
the child which was just set
Throws:
IndexOutOfBoundsException - if the index out of range

setChildren

public Visitable setChildren(Visitable[] childs)
Set children to the term

Specified by:
setChildren in interface Visitable
Parameters:
childs - array of children to set
Returns:
an array of children which just were set
Throws:
IndexOutOfBoundsException - if length of "childs" is different than 5

getChildren

public Visitable[] getChildren()
Returns the whole children of the term

Specified by:
getChildren in interface Visitable
Returns:
the children of the term

hashFunction

protected int hashFunction()
Compute a hashcode for this term. (for internal use)

Returns:
a hash value