functor TigerLexFun(structure Tokens : Tiger_TOKENS)= struct structure UserDeclarations = struct type pos = int type svalue = Tokens.svalue type ('a,'b) token = ('a,'b) Tokens.token type lexresult = (svalue,pos) token val lineNum = ErrorMsg.lineNum val linePos = ErrorMsg.linePos val commentDepth = ref 0; val stringAcc = ref ""; val stringBeg = ref 0; fun err(p1,p2) = ErrorMsg.error p1 local fun exp (n, 0) = 1 | exp (n, y) = n * exp (n, y-1); in fun stol (#"\\"::tail) = stol(tail) |stol (n::[]) = ord (n) - ord (#"0") | stol (n::tail) = (ord(n) - ord (#"0")) * exp (10, length(tail)) + stol(tail) | stol ([]) = 0; end; fun accumulateString (s) = (stringAcc := String.concat [!stringAcc, s]); fun eof() = let val pos = hd(!linePos) in Tokens.EOF(pos,pos) end end (* end of user routines *) exception LexError (* raised if illegal leaf action tried *) structure Internal = struct datatype yyfinstate = N of int type statedata = {fin : yyfinstate list, trans: string} (* transition & final state table *) val tab = let val s = [ (0, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (1, "\007\007\007\007\007\007\007\007\007\094\093\007\007\007\007\007\ \\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\007\ \\092\007\091\007\007\007\090\007\089\088\087\086\085\084\083\081\ \\079\079\079\079\079\079\079\079\079\079\077\076\073\072\070\007\ \\007\011\011\011\011\011\011\011\011\011\011\011\011\011\011\011\ \\011\011\011\011\011\011\011\011\011\011\011\069\007\068\007\007\ \\007\063\058\011\056\050\040\011\011\037\011\011\034\011\031\029\ \\011\011\011\011\021\011\018\013\011\011\011\010\009\008\007\007\ \\007" ), (3, "\095\095\095\095\095\095\095\095\095\095\098\095\095\095\095\095\ \\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\ \\095\095\095\095\095\095\095\095\095\095\096\095\095\095\095\095\ \\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\ \\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\ \\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\ \\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\ \\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\095\ \\095" ), (5, "\099\099\099\099\099\099\099\099\099\099\000\099\099\099\099\099\ \\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\ \\099\099\117\099\099\099\099\099\099\099\099\099\099\099\099\099\ \\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\ \\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\ \\099\099\099\099\099\099\099\099\099\099\099\099\100\099\099\099\ \\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\ \\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\099\ \\099" ), (11, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (13, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\014\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (14, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\015\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (15, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\016\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (16, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\017\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (18, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\019\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (19, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\020\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (21, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\026\012\012\012\012\012\012\025\ \\012\012\012\012\012\012\012\012\012\022\012\000\000\000\000\000\ \\000" ), (22, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\023\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (23, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\024\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (26, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\027\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (27, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\028\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (29, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\030\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (31, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\032\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (32, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\033\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (34, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\035\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (35, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\036\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (37, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\039\012\012\012\012\012\012\012\038\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (40, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\048\ \\012\012\012\012\012\041\012\012\012\012\012\000\000\000\000\000\ \\000" ), (41, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\042\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (42, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\043\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (43, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\044\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (44, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\045\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (45, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\046\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (46, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\047\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (48, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\049\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (50, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\053\012\051\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (51, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\052\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (53, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\054\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (54, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\055\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (56, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\057\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (58, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\059\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (59, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\060\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (60, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\061\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (61, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\062\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (63, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\064\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (64, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\065\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (65, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\066\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\ \\000" ), (66, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\012\012\012\012\012\012\012\012\012\012\000\000\000\000\000\000\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\012\012\000\000\000\000\012\ \\000\012\012\012\012\012\012\012\012\012\012\012\012\012\012\012\ \\012\012\012\012\012\012\012\012\012\067\012\000\000\000\000\000\ \\000" ), (70, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\071\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (73, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\075\074\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (77, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\078\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (79, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\080\080\080\080\080\080\080\080\080\080\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (81, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\082\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (96, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\097\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (100, "\000\000\000\000\000\000\000\000\000\115\115\000\000\000\115\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\115\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\112\112\112\112\112\112\112\112\112\112\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\111\000\108\000\ \\000\107\106\000\000\000\105\000\000\000\000\000\000\000\104\000\ \\000\000\103\000\102\000\101\000\000\000\000\000\000\000\000\000\ \\000" ), (108, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\110\110\110\110\110\110\110\110\110\110\110\110\110\110\110\110\ \\110\110\110\110\110\110\110\110\110\110\110\000\000\000\000\000\ \\000\109\109\109\109\109\109\109\109\109\109\109\109\109\109\109\ \\109\109\109\109\109\109\109\109\109\109\109\000\000\000\000\000\ \\000" ), (112, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\113\113\113\113\113\113\113\113\113\113\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (113, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\114\114\114\114\114\114\114\114\114\114\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (115, "\000\000\000\000\000\000\000\000\000\115\115\000\000\000\115\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\115\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\116\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \\000" ), (0, "")] fun f x = x val s = map f (rev (tl (rev s))) exception LexHackingError fun look ((j,x)::r, i) = if i = j then x else look(r, i) | look ([], i) = raise LexHackingError fun g {fin=x, trans=i} = {fin=x, trans=look(s,i)} in Vector.fromList(map g [{fin = [], trans = 0}, {fin = [], trans = 1}, {fin = [], trans = 1}, {fin = [], trans = 3}, {fin = [], trans = 3}, {fin = [], trans = 5}, {fin = [], trans = 5}, {fin = [(N 204)], trans = 0}, {fin = [(N 132),(N 204)], trans = 0}, {fin = [(N 92),(N 204)], trans = 0}, {fin = [(N 126),(N 204)], trans = 0}, {fin = [(N 90),(N 204)], trans = 11}, {fin = [(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 13}, {fin = [(N 90)], trans = 14}, {fin = [(N 90)], trans = 15}, {fin = [(N 90)], trans = 16}, {fin = [(N 68),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 18}, {fin = [(N 90)], trans = 19}, {fin = [(N 19),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 21}, {fin = [(N 90)], trans = 22}, {fin = [(N 90)], trans = 23}, {fin = [(N 15),(N 90)], trans = 11}, {fin = [(N 58),(N 90)], trans = 11}, {fin = [(N 90)], trans = 26}, {fin = [(N 90)], trans = 27}, {fin = [(N 78),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 29}, {fin = [(N 37),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 31}, {fin = [(N 90)], trans = 32}, {fin = [(N 48),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 34}, {fin = [(N 90)], trans = 35}, {fin = [(N 52),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 37}, {fin = [(N 44),(N 90)], trans = 11}, {fin = [(N 81),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 40}, {fin = [(N 90)], trans = 41}, {fin = [(N 90)], trans = 42}, {fin = [(N 90)], trans = 43}, {fin = [(N 90)], trans = 44}, {fin = [(N 90)], trans = 45}, {fin = [(N 90)], trans = 46}, {fin = [(N 28),(N 90)], trans = 11}, {fin = [(N 90)], trans = 48}, {fin = [(N 62),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 50}, {fin = [(N 90)], trans = 51}, {fin = [(N 41),(N 90)], trans = 11}, {fin = [(N 90)], trans = 53}, {fin = [(N 90)], trans = 54}, {fin = [(N 73),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 56}, {fin = [(N 55),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 58}, {fin = [(N 90)], trans = 59}, {fin = [(N 90)], trans = 60}, {fin = [(N 90)], trans = 61}, {fin = [(N 34),(N 90)], trans = 11}, {fin = [(N 90),(N 204)], trans = 63}, {fin = [(N 90)], trans = 64}, {fin = [(N 90)], trans = 65}, {fin = [(N 90)], trans = 66}, {fin = [(N 87),(N 90)], trans = 11}, {fin = [(N 134),(N 204)], trans = 0}, {fin = [(N 124),(N 204)], trans = 0}, {fin = [(N 114),(N 204)], trans = 70}, {fin = [(N 119)], trans = 0}, {fin = [(N 96),(N 204)], trans = 0}, {fin = [(N 116),(N 204)], trans = 73}, {fin = [(N 112)], trans = 0}, {fin = [(N 122)], trans = 0}, {fin = [(N 138),(N 204)], trans = 0}, {fin = [(N 101),(N 204)], trans = 77}, {fin = [(N 99)], trans = 0}, {fin = [(N 8),(N 204)], trans = 79}, {fin = [(N 8)], trans = 79}, {fin = [(N 109),(N 204)], trans = 81}, {fin = [(N 141)], trans = 0}, {fin = [(N 136),(N 204)], trans = 0}, {fin = [(N 105),(N 204)], trans = 0}, {fin = [(N 10),(N 204)], trans = 0}, {fin = [(N 103),(N 204)], trans = 0}, {fin = [(N 107),(N 204)], trans = 0}, {fin = [(N 130),(N 204)], trans = 0}, {fin = [(N 128),(N 204)], trans = 0}, {fin = [(N 94),(N 204)], trans = 0}, {fin = [(N 150),(N 204)], trans = 0}, {fin = [(N 3),(N 204)], trans = 0}, {fin = [(N 1)], trans = 0}, {fin = [(N 5),(N 204)], trans = 0}, {fin = [(N 148),(N 204)], trans = 0}, {fin = [(N 148),(N 204)], trans = 96}, {fin = [(N 144)], trans = 0}, {fin = [(N 146)], trans = 0}, {fin = [(N 186),(N 204)], trans = 0}, {fin = [(N 186),(N 204)], trans = 100}, {fin = [(N 184)], trans = 0}, {fin = [(N 170)], trans = 0}, {fin = [(N 167)], trans = 0}, {fin = [(N 164)], trans = 0}, {fin = [(N 161)], trans = 0}, {fin = [(N 158)], trans = 0}, {fin = [(N 155)], trans = 0}, {fin = [], trans = 108}, {fin = [(N 181)], trans = 0}, {fin = [(N 177)], trans = 0}, {fin = [(N 173)], trans = 0}, {fin = [], trans = 112}, {fin = [], trans = 113}, {fin = [(N 191)], trans = 0}, {fin = [], trans = 115}, {fin = [(N 202)], trans = 0}, {fin = [(N 152),(N 186),(N 204)], trans = 0}]) end structure StartStates = struct datatype yystartstate = STARTSTATE of int (* start state definitions *) val COMMENT = STARTSTATE 3; val INITIAL = STARTSTATE 1; val STRING = STARTSTATE 5; end type result = UserDeclarations.lexresult exception LexerError (* raised if illegal leaf action tried *) end fun makeLexer yyinput = let val yygone0=1 val yyb = ref "\n" (* buffer *) val yybl = ref 1 (*buffer length *) val yybufpos = ref 1 (* location of next character to use *) val yygone = ref yygone0 (* position in file of beginning of buffer *) val yydone = ref false (* eof found yet? *) val yybegin = ref 1 (*Current 'start state' for lexer *) val YYBEGIN = fn (Internal.StartStates.STARTSTATE x) => yybegin := x fun lex () : Internal.result = let fun continue() = lex() in let fun scan (s,AcceptingLeaves : Internal.yyfinstate list list,l,i0) = let fun action (i,nil) = raise LexError | action (i,nil::l) = action (i-1,l) | action (i,(node::acts)::l) = case node of Internal.N yyk => (let val yytext = substring(!yyb,i0,i-i0) val yypos = i0+ !yygone open UserDeclarations Internal.StartStates in (yybufpos := i; case yyk of (* Application actions *) 1 => (lineNum := !lineNum+1; linePos := yypos :: !linePos; continue()) | 10 => (Tokens.COMMA(yypos,yypos+1)) | 101 => (Tokens.COLON(yypos, yypos+1)) | 103 => (Tokens.PLUS(yypos, yypos+1)) | 105 => (Tokens.MINUS(yypos, yypos+1)) | 107 => (Tokens.TIMES(yypos, yypos+1)) | 109 => (Tokens.DIVIDE(yypos, yypos+1)) | 112 => (Tokens.NEQ(yypos, yypos+1)) | 114 => (Tokens.GT(yypos, yypos+1)) | 116 => (Tokens.LT(yypos, yypos+1)) | 119 => (Tokens.GE(yypos, yypos+1)) | 122 => (Tokens.LE(yypos, yypos+1)) | 124 => (Tokens.LBRACK(yypos, yypos+1)) | 126 => (Tokens.LBRACE(yypos, yypos+1)) | 128 => (Tokens.LPAREN(yypos, yypos+1)) | 130 => (Tokens.RPAREN(yypos, yypos+1)) | 132 => (Tokens.RBRACE(yypos, yypos+1)) | 134 => (Tokens.RBRACK(yypos, yypos+1)) | 136 => (Tokens.DOT(yypos, yypos+1)) | 138 => (Tokens.SEMICOLON(yypos, yypos+1) (* note the sign of cancer *)) | 141 => (YYBEGIN COMMENT; commentDepth := 1; lex()) | 144 => (if !commentDepth = 1 then (YYBEGIN INITIAL; lex()) else (commentDepth := !commentDepth-1; lex())) | 146 => (lineNum := !lineNum+1; lex()) | 148 => (lex()) | 15 => (Tokens.TYPE(yypos,yypos+4)) | 150 => (YYBEGIN STRING; stringAcc := ""; stringBeg := yypos; lex()) | 152 => (YYBEGIN INITIAL; Tokens.STRING(!stringAcc, !stringBeg, !stringBeg +length (explode (!stringAcc)))) | 155 => (accumulateString("\a"); lex()) | 158 => (accumulateString("\b"); lex()) | 161 => (accumulateString("\f"); lex()) | 164 => (accumulateString("\n"); lex()) | 167 => (accumulateString("\r"); lex()) | 170 => (accumulateString("\t"); lex()) | 173 => (accumulateString("\\"); lex()) | 177 => ( accumulateString( implode [chr(ord(hd(tl(tl(explode yytext)))) - 64)]); lex()) | 181 => ( accumulateString( implode [chr(ord(hd(tl (tl(explode yytext)))) - 96)]); lex()) | 184 => (accumulateString("\v"); lex()) | 186 => (accumulateString(yytext); lex()) | 19 => (Tokens.VAR(yypos,yypos+3)) | 191 => (accumulateString(implode ([chr(stol (explode yytext))])); lex()) | 202 => (lex()) | 204 => (ErrorMsg.error yypos ("illegal character " ^ yytext); continue()) | 28 => (Tokens.FUNCTION(yypos,yypos+8)) | 3 => (lex()) | 34 => (Tokens.BREAK(yypos,yypos+5)) | 37 => (Tokens.OF(yypos,yypos+2)) | 41 => (Tokens.END(yypos,yypos+3)) | 44 => (Tokens.IN(yypos,yypos+2)) | 48 => (Tokens.NIL(yypos,yypos+3)) | 5 => (lex()) | 52 => (Tokens.LET(yypos,yypos+3)) | 55 => (Tokens.DO(yypos,yypos+2)) | 58 => (Tokens.TO(yypos,yypos+2)) | 62 => (Tokens.FOR(yypos,yypos+3)) | 68 => (Tokens.WHILE(yypos,yypos+5)) | 73 => (Tokens.ELSE(yypos,yypos+4)) | 78 => (Tokens.THEN(yypos,yypos+4)) | 8 => (let val strlist= explode yytext in Tokens.INT(stol(strlist), yypos, length strlist) end) | 81 => (Tokens.IF(yypos,yypos+2)) | 87 => (Tokens.ARRAY(yypos,yypos+5)) | 90 => (Tokens.ID(yytext,yypos, yypos + (length (explode yytext)))) | 92 => (Tokens.OR(yypos,yypos+1)) | 94 => (Tokens.AND(yypos,yypos+1)) | 96 => (Tokens.EQ(yypos,yypos+1)) | 99 => (Tokens.ASSIGN(yypos,yypos+2)) | _ => raise Internal.LexerError ) end ) val {fin,trans} = Vector.sub(Internal.tab, s) val NewAcceptingLeaves = fin::AcceptingLeaves in if l = !yybl then if trans = #trans(Vector.sub(Internal.tab,0)) then action(l,NewAcceptingLeaves ) else let val newchars= if !yydone then "" else yyinput 1024 in if (size newchars)=0 then (yydone := true; if (l=i0) then UserDeclarations.eof () else action(l,NewAcceptingLeaves)) else (if i0=l then yyb := newchars else yyb := substring(!yyb,i0,l-i0)^newchars; yygone := !yygone+i0; yybl := size (!yyb); scan (s,AcceptingLeaves,l-i0,0)) end else let val NewChar = Char.ord(String.sub(!yyb,l)) val NewState = if NewChar<128 then Char.ord(String.sub(trans,NewChar)) else Char.ord(String.sub(trans,128)) in if NewState=0 then action(l,NewAcceptingLeaves) else scan(NewState,NewAcceptingLeaves,l+1,i0) end end (* val start= if substring(!yyb,!yybufpos-1,1)="\n" then !yybegin+1 else !yybegin *) in scan(!yybegin (* start *),nil,!yybufpos,!yybufpos) end end in lex end end