]> Joshua Wise's Git repositories - snipe.git/blobdiff - parse/parse.sml
Initial import of l3c
[snipe.git] / parse / parse.sml
index 1fc612f9727fba19963e2f91548cbb76a0cd9e0a..aa701c41c89903b298b0f40d0c8aae4d3fb544d0 100644 (file)
@@ -1,4 +1,4 @@
-(* L1 Compiler
+(* L3 Compiler
  * Parsing
  * Author: Kaustuv Chaudhuri <kaustuv+@cs.cmu.edu>
  * Modified: Frank Pfenning <fp@cs.cmu.edu>
@@ -17,10 +17,10 @@ end
 structure Parse :> PARSE =
 struct 
 
-  structure L2LrVals = L2LrValsFn (structure Token = LrParser.Token)
-  structure L2Lex = L2LexFn (structure Tokens = L2LrVals.Tokens)
-  structure L2Parse = Join (structure ParserData = L2LrVals.ParserData
-                            structure Lex = L2Lex
+  structure L3LrVals = L3LrValsFn (structure Token = LrParser.Token)
+  structure L3Lex = L3LexFn (structure Tokens = L3LrVals.Tokens)
+  structure L3Parse = Join (structure ParserData = L3LrVals.ParserData
+                            structure Lex = L3Lex
                             structure LrParser = LrParser)
 
   (* Main parsing function *)
@@ -31,9 +31,9 @@ struct
          val _ = ParseState.setfile filename (* start at position 0 in filename *)
          fun parseerror (s, p1, p2) = ErrorMsg.error (ParseState.ext (p1,p2)) s
          val lexer = LrParser.Stream.streamify
-                         (L2Lex.makeLexer (fn _ => TextIO.input instream))
+                         (L3Lex.makeLexer (fn _ => TextIO.input instream))
          (* 0 = no error correction, 15 = reasonable lookahead for correction *)
-         val (absyn, _) = L2Parse.parse(0, lexer, parseerror, ())
+         val (absyn, _) = L3Parse.parse(0, lexer, parseerror, ())
           val _ = if !ErrorMsg.anyErrors
                  then raise ErrorMsg.Error
                  else ()
@@ -41,7 +41,7 @@ struct
          absyn
        end)
       handle Fail s => ( ErrorMsg.error NONE ("lexer error: "^s) ;
-                        raise ErrorMsg.Error )
+                        raise ErrorMsg.Error )
           | LrParser.ParseError => raise ErrorMsg.Error (* always preceded by msg *)
            | e as IO.Io _ => ( ErrorMsg.error NONE (exnMessage e);
                                raise ErrorMsg.Error )
This page took 0.022755 seconds and 4 git commands to generate.