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

SCM Repository

[smlnj] Diff of /sml/trunk/src/ml-yacc/lib/parser2.sml
ViewVC logotype

Diff of /sml/trunk/src/ml-yacc/lib/parser2.sml

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

revision 1334, Thu May 22 22:46:30 2003 UTC revision 1335, Tue May 27 21:54:23 2003 UTC
# Line 99  Line 99 
99        structure LrTable = LrTable        structure LrTable = LrTable
100        structure Stream = Stream        structure Stream = Stream
101    
102          fun eqT (LrTable.T i, LrTable.T i') = i = i'
103    
104        structure Token : TOKEN =        structure Token : TOKEN =
105          struct          struct
106              structure LrTable = LrTable              structure LrTable = LrTable
107              datatype ('a,'b) token = TOKEN of LrTable.term * ('a * 'b * 'b)              datatype ('a,'b) token = TOKEN of LrTable.term * ('a * 'b * 'b)
108              val sameToken = fn (TOKEN(t,_),TOKEN(t',_)) => t=t'              val sameToken = fn (TOKEN(t,_),TOKEN(t',_)) => eqT (t,t')
109          end          end
110    
111        open LrTable        open LrTable
# Line 409  Line 411 
411       *)       *)
412          fun do_delete(nil,lp as (TOKEN(_,(_,l,_)),_)) = SOME(nil,l,l,lp)          fun do_delete(nil,lp as (TOKEN(_,(_,l,_)),_)) = SOME(nil,l,l,lp)
413            | do_delete([t],(tok as TOKEN(t',(_,l,r)),lp')) =            | do_delete([t],(tok as TOKEN(t',(_,l,r)),lp')) =
414                 if t=t'                 if eqT (t, t')
415                     then SOME([tok],l,r,Stream.get lp')                     then SOME([tok],l,r,Stream.get lp')
416                     else NONE                     else NONE
417            | do_delete(t::rest,(tok as TOKEN(t',(_,l,r)),lp')) =            | do_delete(t::rest,(tok as TOKEN(t',(_,l,r)),lp')) =
418                 if t=t'                 if eqT (t,t')
419                     then case do_delete(rest,Stream.get lp')                     then case do_delete(rest,Stream.get lp')
420                           of SOME(deleted,l',r',lp'') =>                           of SOME(deleted,l',r',lp'') =>
421                                 SOME(tok::deleted,l,r',lp'')                                 SOME(tok::deleted,l,r',lp'')

Legend:
Removed from v.1334  
changed lines
  Added in v.1335

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