CVS: sml-dist/src/lexgen/src lex-gen.sml,1.1,1.2
Matthias Blume <[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj.commits |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/smlnj/sml-dist/src/lexgen/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14104/src/lexgen/src
Modified Files:
lex-gen.sml
Log Message:
improvements/bugfixes to lexgen from Aaron Turon
Index: lex-gen.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/lexgen/src/lex-gen.sml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** lex-gen.sml 1 Mar 2006 04:44:29 -0000 1.1
--- lex-gen.sml 1 Mar 2006 20:17:26 -0000 1.2
***************
*** 35,39 ****
* a flag set to true if the state is new.
*)
! fun mkState (stateMap, res) = (case Map.find(stateMap, res)
of NONE => let
val id = !n
--- 35,39 ----
* a flag set to true if the state is new.
*)
! fun mkState (stateMap, res, asSS) = (case Map.find(stateMap, res)
of NONE => let
val id = !n
***************
*** 43,47 ****
else finals
val q = LO.State {
! id = id, label = res,
final = Vector.foldri addFinal [] res,
next = ref []
--- 43,47 ----
else finals
val q = LO.State {
! id = id, startState = asSS, label = res,
final = Vector.foldri addFinal [] res,
next = ref []
***************
*** 56,60 ****
fun initIter (states, stateMap, []) = (List.rev states, stateMap)
| initIter (states, stateMap, vec::vecs) = let
! val (_, q, stateMap') = mkState (stateMap, vec)
in initIter (q :: states, stateMap', vecs)
end
--- 56,60 ----
fun initIter (states, stateMap, []) = (List.rev states, stateMap)
| initIter (states, stateMap, vec::vecs) = let
! val (_, q, stateMap') = mkState (stateMap, vec, true)
in initIter (q :: states, stateMap', vecs)
end
***************
*** 66,70 ****
then (stateMap, workList)
else let
! val (isNew, q, stateMap) = mkState(stateMap, res)
in
next := (edge, q) :: !next;
--- 66,70 ----
then (stateMap, workList)
else let
! val (isNew, q, stateMap) = mkState (stateMap, res, false)
in
next := (edge, q) :: !next;
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642