sml Standard ML of New Jersey, Version 110.0.7, September 28, 2000 [CM; autoload enabled] - use "calcLex.lex.sml"; [opening calcLex.lex.sml] GC #0.0.0.0.1.8: (10 ms) GC #0.0.0.1.2.21: (10 ms) GC #0.0.0.1.3.34: (0 ms) structure CalcLex : sig structure Internal : structure UserDeclarations : exception LexError val makeLexer : (int -> string) -> unit -> Internal.result end val it = () : unit - use "rec-descent.sml"; [opening rec-descent.sml] opening CalcLex.Internal structure StartStates : sig datatype yystartstate = STARTSTATE of int val INITIAL : yystartstate end type result = CalcLex.UserDeclarations.lexresult type statedata = {fin:yyfinstate list, trans:string} datatype yyfinstate = N of int exception LexerError val tab : {fin:yyfinstate list, trans:string} vector opening CalcLex.UserDeclarations datatype lexresult = DIV | EOF | EOS | ID of string | LPAREN | NUM of int | PLUS | PRINT | RPAREN | SUB | TIMES val eof : unit -> lexresult val error : string -> unit val linenum : int ref datatype opNode = OP of lexresult datatype synTree = EXP of synTree * synTree | EXP1 of opNode * synTree | Empty | FACTOR of lexresult | TERM of synTree * synTree | TERM1 of opNode * synTree rec-descent.sml:52.11-52.51 Warning: binding not exhaustive (expTree,RPAREN :: rest) = ... rec-descent.sml:15.1-54.10 Warning: match nonexhaustive ID s :: rest => ... NUM n :: rest => ... LPAREN :: more => ... GC #0.0.0.1.4.76: (0 ms) val exp = fn : lexresult list -> synTree * lexresult list val exp1 = fn : lexresult list -> synTree * lexresult list val term = fn : lexresult list -> synTree * lexresult list val term1 = fn : lexresult list -> synTree * lexresult list val factor = fn : lexresult list -> synTree * lexresult list exception SYNTAX_ERROR of lexresult list val allTokens = fn : (unit -> lexresult) -> lexresult list rec-descent.sml:65.1-73.7 Warning: match nonexhaustive nil => ... val parse = fn : 'a list -> synTree val it = () : unit - val re tree = parse(); val tree = EXP (TERM (FACTOR #,Empty),EXP1 (OP #,EXP #)) : synTree -