Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/Doc/latex/labelexp.tex
ViewVC logotype

View of /sml/trunk/src/MLRISC/Doc/latex/labelexp.tex

Parent Directory Parent Directory | Revision Log Revision Log

Revision 651 - (download) (as text) (annotate)
Thu Jun 1 18:34:03 2000 UTC (20 years, 3 months ago) by monnier
File size: 1506 byte(s)
bring revisions from the vendor branch to the trunk
\section{Label Expressions}

A \newdef{label expression} is a constant
expression defined in terms of labels, or user 
defined \href{constants.html}{constants}.  MLRISC uses the type
\sml{labexp} to represent label expressions.  Label expressions
are defined in the structure 

The datatype \sml{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 \sml{labexp}:
  \item \sml{valueOf : labexp -> int}  -- Returns the value associated with
a label expression
  \item \sml{toString : labexp -> string} -- Return the pretty printed representation of an expression
  \item \sml{hash : labexp -> word} -- Returns the hash value of an expression
  \item \sml{== : labexp * labexp -> bool} -- Tests whether two label expression are lexically identical

The type \sml{labexp} is depends on client defined 
\href{constants.html}{constants} typed.  The functor \sml{LabelExp}
is parameterized as follows.
   functor \mlrischref{instructions/labelExp.sml}{LabelExp}(Constant : \mlrischref{instructions/constant.sig}{CONSTANT})

ViewVC Help
Powered by ViewVC 1.0.0