Label Expressions
A label expression is a constant
expression defined in terms of labels, or user
defined constants. MLRISC uses the type
labexp to represent label expressions. Label expressions
are defined in the structure
LabelExp.
The datatype labexp has the following definition:
datatype labexp =
LABEL of Label.label
| CONST of Constant.const
| INT of int
| PLUS of labexp * labexp
| MINUS of labexp * labexp
| MULT of labexp * labexp
| DIV of labexp * labexp
| LSHIFT of labexp * word
| RSHIFT of labexp * word
| AND of labexp * word
| OR of labexp * word
In addition, the following functions are defined in labexp:
- valueOf : labexp -> int -- Returns the value associated with
a label expression
- toString : labexp -> string -- Return the pretty printed representation of an expression
- hash : labexp -> word -- Returns the hash value of an expression
- == : labexp * labexp -> bool -- Tests whether two label expression are lexically identical
The type labexp is depends on client defined
constants typed. The functor LabelExp
is parameterized as follows.
functor LabelExp(Constant : CONSTANT)
|
|
Generated by
mltex2html
|
Last modified: Mon Jun 8 14:18:05 UTC 2009 by buildd@vernadsky
|
|