public final class MethodSpec extends SpecificationBase
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
divergesKeyword |
static java.lang.String |
exceptionsKeyword |
static java.lang.String |
postKeyword |
static java.lang.String |
preKeyword |
static java.lang.String |
terminationKeyword |
static java.lang.String |
variablesKeyword |
Modifier and Type | Method and Description |
---|---|
void |
accept(ASTVisitor visitor)
Accept visitor for a visit.
|
void |
accept(ASTVisitorOld visitor)
Accept visitor for a visit.
|
void |
acceptChildren(ASTVisitor visitor)
Accept visitor for a visit to the children of this node.
|
static MethodSpec |
construct(java.lang.String text,
ErrorStream error,
SourcePosition pos)
Construct method specification from denoted text.
|
Formula |
getDivergesCondition()
Get method diverges condition.
|
Name[] |
getExceptions()
Get list of exceptions that may be thrown by method.
|
Formula |
getPostCondition()
Get method postcondition.
|
Formula |
getPreCondition()
Get method precondition.
|
Term[] |
getTerminationTerm()
Get termination term vector.
|
Name[] |
getVariables()
Get method frame i.e.
|
boolean |
isHelper()
Get helper status of a method.
|
void |
setDivergesCondition(Formula div)
Set diverges condition.
|
void |
setExceptions(java.util.Vector<Name> es)
Set exceptions
|
void |
setHelper(boolean helper)
Set helper status of a method.
|
void |
setPostCondition(Formula post)
Set postcondition.
|
void |
setPreCondition(Formula pre)
Set precondition.
|
void |
setTerminationTerm(java.util.Vector<Term> term)
Set termination term.
|
void |
setVariables(java.util.Vector<Name> vs)
Set specification variables.
|
getPosition, getText, setPosition
accept, accept, print, printCore, toString, toStringCore
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPosition, setPosition
print, printCore, toString, toStringCore
public static final java.lang.String variablesKeyword
public static final java.lang.String exceptionsKeyword
public static final java.lang.String preKeyword
public static final java.lang.String divergesKeyword
public static final java.lang.String postKeyword
public static final java.lang.String terminationKeyword
public static MethodSpec construct(java.lang.String text, ErrorStream error, SourcePosition pos)
text
- the text of the specification.error
- the stream for printing error messagespos
- the source position of the specificationpublic Name[] getVariables()
public void setVariables(java.util.Vector<Name> vs)
vs
- vector of variable names (may be null)public Name[] getExceptions()
public void setExceptions(java.util.Vector<Name> es)
es
- vector of exception names (may be null)public Formula getPreCondition()
public void setPreCondition(Formula pre)
pre
- the method precondition (may be null).public Formula getDivergesCondition()
public void setDivergesCondition(Formula div)
div
- the method diverges condition (may be null).public Formula getPostCondition()
public void setPostCondition(Formula post)
post
- the method postcondition (may be null).public Term[] getTerminationTerm()
public void setTerminationTerm(java.util.Vector<Term> term)
term
- the loop termination term vector (may be null).public void setHelper(boolean helper)
helper
- true iff the method is a helper.public boolean isHelper()
public void accept(ASTVisitorOld visitor)
accept
in interface AST
accept
in class SpecificationBase
visitor
- the visitor who is accepted by this node.public void accept(ASTVisitor visitor)
accept
in interface AST
accept
in class SpecificationBase
visitor
- the visitor who is accepted by this node.public void acceptChildren(ASTVisitor visitor)
acceptChildren
in interface AST
acceptChildren
in class ASTBase
visitor
- the visitor who is accepted by the children of this node.