#include <RangeChecker.h>
Public Member Functions | |
RangeChecker (TypeCheck &TC) | |
bool | checkDeclarationRange (Expr *lower, Expr *upper) |
Checks a range as used in an integer type declaration. | |
DiscreteType * | checkDSTRange (Expr *lower, Expr *upper) |
Checks a range as used as a loop control. | |
DiscreteType * | checkSubtypeRange (DiscreteType *base, Expr *lower, Expr *upper) |
Checks a range for compatibility wrt a discrete type. | |
bool | resolveRange (Range *range, DiscreteType *type) |
Resolves the type of range to the given type. |
Definition at line 33 of file RangeChecker.h.
comma::RangeChecker::RangeChecker | ( | TypeCheck & | TC | ) | [inline] |
Definition at line 36 of file RangeChecker.h.
Checks a range as used in an integer type declaration.
The following method takes expressions denoting the lower and upper bounds of the range. Semantic analysis performs the following checks:
Note that these types of ranges do not require that the upper and lower bounds be of the same type.
Returns true if the checks succeeded and false otherwise.
Definition at line 27 of file RangeChecker.cpp.
DiscreteType * RangeChecker::checkDSTRange | ( | Expr * | lower, | |
Expr * | upper | |||
) |
Checks a range as used as a loop control.
The following method takes the expressions denoting the lower and upper bounds of a discrete subtype declaration (to be used as the control for a loop
statement or as an index specification for an array type). Semantic analysis performs the following checks:
Returns a discrete subtype constrained to the given bounds if the checks succeed and null otherwise.
Definition at line 44 of file RangeChecker.cpp.
DiscreteType * RangeChecker::checkSubtypeRange | ( | DiscreteType * | base, | |
Expr * | lower, | |||
Expr * | upper | |||
) |
Checks a range for compatibility wrt a discrete type.
Given a discrete subtype base, checks that the given bounds form a valid constraint over base.
Returns a discrete subtype constrined to the given bounds if the check succeeds and null otherwise.
Definition at line 105 of file RangeChecker.cpp.
bool RangeChecker::resolveRange | ( | Range * | range, | |
DiscreteType * | type | |||
) |
Resolves the type of range
to the given type.
Definition at line 115 of file RangeChecker.cpp.