Front End (part 1) Some easy stuff to warm up. Makefiles have a pretty simple lexical structure. Our lexer talks to camlp4 so we need to return ("CLASS","lexeme") pairs. This is the entire lexer. It is written in ocamllex language. let special = ['$' '@' '<' '^' '(' ')' '=' ':' '%'] let nq = ("\\\""|[^'"']) let sym = ['-' '_' '.' '/' 'a'-'z''A'-'Z''0'-'9']* rule token = parse ' '* { token lexbuf } | ('#' [^'\n']*)? ('\n'+) { ("EOL", "") } | '\t' { ("TAB", "") } | eof { ("EOF", "") } | (sym | '"' nq* '"') { ("WORD", lexeme lexbuf) } | special { ("", lexeme lexbuf)} | _ { ("", lexeme lexbuf)}