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 /smlnj-lib/branches/rt-transition/SExp/sexp.sml
ViewVC logotype

Annotation of /smlnj-lib/branches/rt-transition/SExp/sexp.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4071 - (view) (download)

1 : jhr 4071 (* sexp.sml
2 :     *
3 :     * COPYRIGHT (c) 2011 The Fellowship of SML/NJ (http://www.smlnj.org)
4 :     * All rights reserved.
5 :     *
6 :     * Author: Damon Wang (with modifications by John Reppy)
7 :     *
8 :     * This is the tree representation of a SExp data as produced/consumed
9 :     * by the tree parser.
10 :     *)
11 :    
12 :     structure SExp =
13 :     struct
14 :    
15 :     datatype value
16 :     = SYMBOL of Atom.atom
17 :     | LIST of value list
18 :     | BOOL of bool
19 :     | INT of IntInf.int
20 :     | FLOAT of real
21 :     | STRING of string
22 :    
23 :     fun same (SYMBOL a, SYMBOL b) = Atom.same (a, b)
24 :     | same (LIST a, LIST b) = ListPair.all same (a, b)
25 :     | same (BOOL a, BOOL b) = (a = b)
26 :     | same (INT a, INT b) = (a = b)
27 :     | same (FLOAT a, FLOAT b) = Real.==(a, b)
28 :     | same (STRING a, STRING b) = (a = b)
29 :     | same _ = false
30 :    
31 :     end

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