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

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/parser/diderot.grm
ViewVC logotype

Diff of /branches/lamont/src/compiler/parser/diderot.grm

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

revision 77, Mon May 24 21:57:10 2010 UTC revision 78, Mon May 24 22:31:49 2010 UTC
# Line 63  Line 63 
63  %defs (  %defs (
64    structure PT = ParseTree    structure PT = ParseTree
65    structure L = Literal    structure L = Literal
66    structure Op = Operators    structure B = BasisNames
67    
68  (* apply a mark constructor to a span and a tree *)  (* apply a mark constructor to a span and a tree *)
69    fun mark cons (span : AntlrStreamPos.span, tr) = cons{span = span, tree = tr}    fun mark cons (span : AntlrStreamPos.span, tr) = cons{span = span, tree = tr}
# Line 77  Line 77 
77    fun markExpr (_, e as PT.E_Mark _) = e    fun markExpr (_, e as PT.E_Mark _) = e
78      | markExpr (sp, tr) = mark PT.E_Mark (sp, tr)      | markExpr (sp, tr) = mark PT.E_Mark (sp, tr)
79    
80      fun mkCondExp cons (e, []) = e
81        | mkCondExp cons (e, [e']) = cons(e, e')
82        | mkCondExp (e, e'::r) = cons(e, mkCondExp(e', r))
83    
84  (* build an application for an infix binary operator *)  (* build an application for an infix binary operator *)
85    fun mkBinApp (e1, rator, e2) = PT.E_BinOp(e1, rator, e2)    fun mkBinApp (e1, rator, e2) = PT.E_BinOp(e1, rator, e2)
86    
# Line 266  Line 270 
270  (***** Expressions *****)  (***** Expressions *****)
271    
272  Expr  Expr
273          : AndExpr ( "||" AndExpr => (Op.orElse, AndExpr) )*          : AndExpr ("||" AndExpr)*
274                  => (mkLBinExp (AndExpr, SR))                  => (List.foldr PT.AndAlso
275          ;          ;
276    
277  AndExpr  AndExpr

Legend:
Removed from v.77  
changed lines
  Added in v.78

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