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 (19 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 
\mlrischref{instructions/labelExp.sml}{LabelExp}.

The datatype \sml{labexp} has the following definition:
\begin{SML}
  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
\end{SML}

In addition, the following functions are defined in \sml{labexp}:
\begin{itemize}
  \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
\end{itemize}

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

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0