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/compiler/Parse/ast/fixity.sml
ViewVC logotype

Annotation of /sml/trunk/src/compiler/Parse/ast/fixity.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 114 - (view) (download)

1 : monnier 16 (* Copyright 1996 by AT&T Bell Laboratories *)
2 :     (* fixity.sml *)
3 :    
4 :     signature FIXITY =
5 :     sig
6 :     datatype fixity = NONfix | INfix of (int*int)
7 :     val infixleft : int -> fixity
8 :     val infixright : int -> fixity
9 :     val fixityToString : fixity -> string
10 :    
11 :     end (* signature FIXITY *)
12 :    
13 :    
14 :     structure Fixity : FIXITY =
15 :     struct
16 :    
17 :     datatype fixity = NONfix | INfix of (int*int)
18 :    
19 :     (* building fixities *)
20 :     fun infixleft n = INfix (n+n, n+n+1)
21 :     fun infixright n = INfix (n+n+1, n+n)
22 :    
23 :     fun fixityToString NONfix = "nonfix "
24 :     | fixityToString (INfix (i,_)) =
25 :     (if i mod 2 = 0 then "infix " else "infixr ")^
26 :     (if i div 2 > 0 then Int.toString (i div 2)^" " else "")
27 :    
28 :     end (* structure Fixity *)
29 :    
30 :     (*
31 : monnier 113 * $Log$
32 : monnier 16 *)

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