public class AtMostQuantifierExpression extends QuantifiedConstraintExpression
atmost
expression of
argument in (expression) constraint-expression
where the first
expression
must evaluate to an int
, the second
expression
must evaluate to a Collection
, and the "at most"
quantifier expression is sastisfied iff when taking settings of argument
from
the Collection
, constraint-expression
is satisfied at most as
many times as the integer the first expression
evaluates to.Modifier and Type | Field and Description |
---|---|
Expression |
upperBound
(¬ø) This expression evaluates to an integer representing the maximum number of
objects that must satisfy the child constraint expression in order for this quantified
constraint expression to be satisfied.
|
boolean |
upperBoundIsQuantified
Filled in by
SemanticAnalysis , this flag is set if upperBound
contains any quantified variables. |
argument, collection, collectionIsQuantified, constraint
parenthesized
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
AtMostQuantifierExpression(int line,
int byteOffset,
Expression ub,
Argument a,
Expression c,
ConstraintExpression co)
Full constructor.
|
AtMostQuantifierExpression(TokenValue t,
Expression ub,
Argument a,
Expression c,
ConstraintExpression co)
Parser's constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a new object with the same primitive data, and recursively creates new member data
objects as well.
|
HashSet |
getVariableTypes()
Returns a set of
Argument s storing the name and type of each variable that is a
subexpression of this expression. |
ASTNodeIterator |
iterator()
Returns an iterator used to successively access the children of this node.
|
void |
runPass(Pass pass)
Ensures that the correct
run() method is called for this type of node. |
void |
write(StringBuffer buffer)
Writes a string representation of this
ASTNode to the specified buffer. |
containsQuantifiedVariable
public Expression upperBound
public boolean upperBoundIsQuantified
SemanticAnalysis
, this flag is set if upperBound
contains any quantified variables.public AtMostQuantifierExpression(int line, int byteOffset, Expression ub, Argument a, Expression c, ConstraintExpression co)
line
- The line on which the source code represented by this node is found.byteOffset
- The byte offset from the beginning of the source file at which the source
code represented by this node is found.ub
- The upper bound expression.a
- The quantification variable specification.c
- Evaluates to the collection of objects.co
- The quantified constraint.public AtMostQuantifierExpression(TokenValue t, Expression ub, Argument a, Expression c, ConstraintExpression co)
t
- The token containing line and byte offset information.ub
- The upper bound expression.a
- The quantification variable specification.c
- Evaluates to the collection of objects.co
- The quantified constraint.public HashSet getVariableTypes()
Argument
s storing the name and type of each variable that is a
subexpression of this expression. This method cannot be run before
SemanticAnalysis
runs.getVariableTypes
in class QuantifiedConstraintExpression
public ASTNodeIterator iterator()
iterator
in class QuantifiedConstraintExpression
public Object clone()
public void runPass(Pass pass)
run()
method is called for this type of node.public void write(StringBuffer buffer)
ASTNode
to the specified buffer. The
representation written is parsable by the LBJava compiler, but not very readable.Copyright © 2016. All rights reserved.