Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/parser/diderot.grm
ViewVC logotype

Diff of /trunk/src/parser/diderot.grm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 27, Tue Feb 9 02:36:31 2010 UTC revision 28, Tue Feb 9 02:55:41 2010 UTC
# Line 69  Line 69 
69    fun markExp (_, e as PT.E_Mark _) = e    fun markExp (_, e as PT.E_Mark _) = e
70      | markExp (sp, tr) = mark PT.E_Mark (sp, tr)      | markExp (sp, tr) = mark PT.E_Mark (sp, tr)
71    
72    (* build an application for an infix binary operator *)
73      fun mkBinApp (e1, rator, e2) = PT.E_BinOp(e1, rator, e2)
74    
75    (* construct application expressions for left-associative binary operators *)
76      fun mkLBinExp (e, []) = e
77        | mkLBinExp (e, (id, e')::r) = mkLBinExp (mkBinApp(e, id, e'), r)
78    
79    (* construct application expressions for right-associative binary operators *)
80      fun mkRBinExp (e, []) = e
81        | mkRBinExp (e, [(id, e')]) = mkBinApp(e, id, e')
82        | mkRBinExp (e, (id, e')::r) = mkBinApp(e, id, mkRBinExp(e', r))
83    
84    fun flatten NONE = []    fun flatten NONE = []
85      | flatten (SOME l) = l      | flatten (SOME l) = l
86  );  );

Legend:
Removed from v.27  
changed lines
  Added in v.28

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