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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/Doc/labelexp.html
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/Doc/labelexp.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 409 - (view) (download) (as text)

1 : monnier 409 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 :     <HTML>
3 :     <HEAD>
4 :     <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
5 :     <META NAME="GENERATOR" CONTENT="Mozilla/4.07 [en] (X11; I; Linux 2.2.7 i686) [Netscape]">
6 :     </HEAD>
7 :     <BODY bgcolor="#FFFFFF">
8 :    
9 :     <CENTER>
10 :     <H1>
11 :     <FONT COLOR="#aa0000">Label Expressions</FONT></H1></CENTER>
12 :    
13 :     A <font color="#ff0000"> label expression </font> is a constant
14 :     expression defined in terms of labels. MLRISC uses the type
15 :     <tt>labexp</tt> to represent label expressions. Label expressions
16 :     are defined in the structure
17 :     <a href="../instructions/labelExp.sml" target=code> LabelExp </a>.
18 :     <pp>
19 :     The datatype <tt>labexp</tt> has the following definition:
20 :     <pre>
21 :     datatype labexp =
22 :     LABEL of Label.label
23 :     | CONST of int
24 :     | PLUS of labexp * labexp
25 :     | MINUS of labexp * labexp
26 :     | MULT of labexp * labexp
27 :     | DIV of labexp * labexp
28 :     | LSHIFT of labexp * word
29 :     | RSHIFT of labexp * word
30 :     | AND of labexp * word
31 :     | OR of labexp * word
32 :     </pre>
33 :    
34 :     In addition, the following functions are defined in <tt>labexp</tt>:
35 :     <ul>
36 :     <li> <tt>valueOf : labexp -> int</tt> -- Returns the value associated with
37 :     a label expression
38 :     <li> <tt>toString : labexp -> string</tt> -- Return the pretty printed representation of an expression
39 :     <li> <tt>hash : labexp -> word</tt> -- Returns the hash value of an expression
40 :     <li> <tt>== : labexp * labexp -> bool</tt> -- Tests whether two label expression are lexically identical
41 :     </ul>
42 :    
43 :    
44 :     <HR>
45 :     <FONT SIZE="-2">
46 :     <ADDRESS>
47 :     <A HREF="mailto:leunga@cs.nyu.edu">Allen Leung</A></ADDRESS>
48 :     <BR>
49 :    
50 :     </BODY>
51 :     </HTML>

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