Ignore:
Timestamp:
Sep 29, 2010, 12:25:28 PM (10 years ago)
Author:
sacerdot
Message:

Several bug fixes and code clean-up.
New main file: test.ml to parse and execute an HEX file.
Usage: ./test.native foo.hex

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/Parser.ml

    r130 r138  
    22open BitVectors;;
    33open ASM;;
     4
     5let chars_of_string s =
     6 let len = String.length s in
     7 let rec aux n =
     8  if n < len then
     9   s.[n] :: aux (n + 1)
     10  else
     11   []
     12 in
     13  aux 0
     14;;
    415
    516type 'a parser = char list -> ('a * char list) list
     
    1324      List.concat $ List.map (fun (a, x') -> (g a) x') frst
    1425
    15 let prs_zero = fun x -> []
     26let prs_zero = fun _ -> []
    1627;;
     28
     29let prs_eof = function [] -> [(),[]] | _ -> [];;
    1730
    1831let prs_predicate p =
     
    3548    match (f ++ g) x with
    3649      [] -> []
    37     | hd::tl -> [hd]
     50    | hd::_ -> [hd]
    3851;;
    3952
Note: See TracChangeset for help on using the changeset viewer.