X-Git-Url: http://git.joshuawise.com/snipe.git/blobdiff_plain/6ade8b0a3251e44b34c6bdbbd9403e36d6fd6231..5e46186e8e7b8f4d9a28cb95954d8a75b6b34f81:/parse/parse.sml?ds=inline diff --git a/parse/parse.sml b/parse/parse.sml index aa701c4..a2cc2fe 100644 --- a/parse/parse.sml +++ b/parse/parse.sml @@ -1,4 +1,4 @@ -(* L3 Compiler +(* L5 Compiler * Parsing * Author: Kaustuv Chaudhuri * Modified: Frank Pfenning @@ -17,10 +17,10 @@ end structure Parse :> PARSE = struct - 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 L5LrVals = L5LrValsFn (structure Token = LrParser.Token) + structure L5Lex = L5LexFn (structure Tokens = L5LrVals.Tokens) + structure L5Parse = Join (structure ParserData = L5LrVals.ParserData + structure Lex = L5Lex structure LrParser = LrParser) (* Main parsing function *) @@ -31,18 +31,18 @@ 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 - (L3Lex.makeLexer (fn _ => TextIO.input instream)) + (L5Lex.makeLexer (fn _ => TextIO.input instream)) (* 0 = no error correction, 15 = reasonable lookahead for correction *) - val (absyn, _) = L3Parse.parse(0, lexer, parseerror, ()) + val (absyn, _) = L5Parse.parse(0, lexer, parseerror, ()) val _ = if !ErrorMsg.anyErrors then raise ErrorMsg.Error else () in absyn end) - handle Fail s => ( ErrorMsg.error NONE ("lexer error: "^s) ; - raise ErrorMsg.Error ) - | LrParser.ParseError => raise ErrorMsg.Error (* always preceded by msg *) + handle (*L5Lex.LexError => ( ErrorMsg.error NONE "lexer 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 )