|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjml2b.util.Profiler
jml2b.formula.Formula
jml2b.formula.TerminalForm
This class implements terminal formula: identifiers, literal constants and builtin types. The node type can be
Field Summary | |
static TerminalForm |
arraylength
The formula arraylength . |
static TerminalForm |
elemtype
The constant formula elemtype , In the B lemmas,
elemtype is a function that assign the type of its element
to an array instance. |
static TerminalForm |
instances
The formula instances . |
static TerminalForm |
j_int2byte
The constant formula j_int2byte , In the B lemmas,
j_int2byte is a function that converts an int into a byte. |
static TerminalForm |
j_int2char
The constant formula j_int2char , In the B lemmas,
j_int2char is a function that converts an int into a char. |
static TerminalForm |
j_int2short
The constant formula j_int2short , In the B lemmas,
j_int2short is a function that converts an int into a
short. |
static TerminalForm |
REFERENCES
The constant formula REFERENCES . |
static TerminalForm |
typeof
The formula typeof . |
Constructor Summary | |
TerminalForm(byte nodeType)
Constructs a formula that is not a Java identifer. |
|
TerminalForm(byte nodeType,
java.lang.String nodeText)
Constructs a formula that is not a Java identifer. |
|
TerminalForm(byte nodeType,
java.lang.String nodeText,
Identifier ident,
boolean subident)
Constructs a terminal formula. |
|
TerminalForm(Identifier ident)
Constructs a formula from a Java identifer. |
|
TerminalForm(Identifier ident,
java.lang.String subident)
Constructs a formula from a Java identifer and a postfix string. |
|
TerminalForm(int v)
Constructs a formula that is a Ja_NUM_INT . |
|
TerminalForm(java.lang.String nodeText)
Constructs a formula that is an identifier but not a Java identifer. |
Method Summary | |
java.lang.Object |
clone()
Clones the formula. |
int |
contains(java.util.Vector selectedFields)
|
boolean |
equals(java.lang.Object f)
Returns whether the formula equals the parameter. |
void |
garbageIdent()
Annotates all the fields that appear in the formula to declare them in the Atelier B files. |
static TerminalForm |
getArraylength(IJml2bConfiguration config)
|
BasicType |
getBasicType()
Returns the type of a formula |
void |
getFields(java.util.Set fields)
Collects the fields that occur in the formula. |
Identifier |
getIdent()
|
java.lang.String |
getNodeText()
Returns the nodeText. |
java.lang.String |
getNonAmbiguousName()
|
Formula |
instancie(Formula b)
Replaces this with the parameter in the expression. |
boolean |
is(Formula f)
Returns whether the formula corresponds to a read formula. |
boolean |
isObvious(boolean atTheEnd)
Returns whether a formula is obvious. |
void |
processIdent()
Collects all the indentifier of a formula to give them an index in the identifer array. |
void |
save(IJml2bConfiguration config,
IOutputStream s,
IJmlFile jf)
Saves the formula in a .jpo file |
void |
setBox(ParsedItem box)
Sets the box. |
Formula |
sub(Formula a,
Formula b,
boolean subInCalledOld)
Applies a substitution on a formula. |
Formula |
subIdent(java.lang.String a,
Formula b)
Applies a substitution on a formula. |
Formula |
suppressSpecialOld(int token)
Suppress the called old pragmas. |
Expression |
toExp()
|
Methods inherited from class jml2b.formula.Formula |
and, create, declarField, domainRestrict, getFalse, getNodeType, getNull, implies, indent, isBFalse, matchAEqualsNull, not, oldParam, or, renameParam, sub, toJava, toLang, toVector |
Methods inherited from class jml2b.util.Profiler |
runGC |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static TerminalForm instances
instances
. In the B lemmas,
instances
is the set of all current class instances.
public static TerminalForm typeof
typeof
. In the B lemmas, typeof
is a function that assign a type to an instance.
public static TerminalForm arraylength
arraylength
. In the B lemmas,
arraylength
is a function that assign the length to an
array instance.
public static TerminalForm REFERENCES
REFERENCES
. In the B lemmas,
REFERENCES
is the set of all existing or potential
instances.
public static TerminalForm elemtype
elemtype
, In the B lemmas,
elemtype
is a function that assign the type of its element
to an array instance.
public static TerminalForm j_int2short
j_int2short
, In the B lemmas,
j_int2short
is a function that converts an int into a
short.
public static TerminalForm j_int2byte
j_int2byte
, In the B lemmas,
j_int2byte
is a function that converts an int into a byte.
public static TerminalForm j_int2char
j_int2char
, In the B lemmas,
j_int2char
is a function that converts an int into a char.
Constructor Detail |
public TerminalForm(byte nodeType, java.lang.String nodeText, Identifier ident, boolean subident)
nodeType
- The node type of this formulanodeText
- The string corresponding to this formulaident
- The identifier corresponding to this formulasubident
- The postfix string associated with this formulapublic TerminalForm(byte nodeType)
nodeType
- The node type of this formulapublic TerminalForm(byte nodeType, java.lang.String nodeText)
nodeType
- The node type of this formulanodeText
- The string corresponding to this formulapublic TerminalForm(int v)
Ja_NUM_INT
.
v
- The integer valuepublic TerminalForm(java.lang.String nodeText)
nodeText
- The string corresponding to this formulapublic TerminalForm(Identifier ident)
ident
- The identifier corresponding to this formulapublic TerminalForm(Identifier ident, java.lang.String subident)
ident
- The identifier corresponding to this formulasubident
- The postfix string associated with this formulaMethod Detail |
public static TerminalForm getArraylength(IJml2bConfiguration config) throws Jml2bException
Jml2bException
public java.lang.Object clone()
Formula
clone
in class Formula
public void processIdent()
Formula
processIdent
in class Formula
jml2b.pog.IdentifierResolver#bIdents
public Formula instancie(Formula b)
Formula
this
with the parameter in the expression.
instancie
in class Formula
b
- expression on which the method where the expression occurs is
called.
public void garbageIdent()
Formula
garbageIdent
in class Formula
public void getFields(java.util.Set fields)
Formula
getFields
in class Formula
fields
- The set a collected fields.public Formula sub(Formula a, Formula b, boolean subInCalledOld)
Formula
sub
in class Formula
a
- the substituted formulab
- the new formulasubInCalledOld
- specify whether the substitution should also be
applied in the called old construction
public Formula subIdent(java.lang.String a, Formula b)
Formula
subIdent
in class Formula
a
- the substituted string correspondingto an identifierb
- the new formula
public boolean equals(java.lang.Object f)
Formula
equals
in class Formula
f
- the checked parameter
true
if the formula syntaxically equals the
parameter, false
otherwisepublic boolean is(Formula f)
Formula
is
in class Formula
f
- a read formula coming from a jpo file
true
if the formula equals to the read formula,
false
otherwise.public int contains(java.util.Vector selectedFields)
contains
in class Formula
public boolean isObvious(boolean atTheEnd)
Formula
isObvious
in class Formula
true
if the formula is considered as obvious,
false
otherwisepublic void save(IJml2bConfiguration config, IOutputStream s, IJmlFile jf) throws java.io.IOException
Formula
save
in class Formula
config
- s
- the ouputstream corresponding to a jpo filejf
-
java.io.IOException
- when the formula cannot be saved.public java.lang.String getNonAmbiguousName()
public Formula suppressSpecialOld(int token)
Formula
suppressSpecialOld
in class Formula
public java.lang.String getNodeText()
public void setBox(ParsedItem box)
box
- The box to setpublic BasicType getBasicType()
Formula
getBasicType
in class Formula
public Identifier getIdent()
public Expression toExp()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |