(file) Return to mlex.mll CVS log (file) (dir) Up to [venge] / src / mkc

File: [venge] / src / mkc / mlex.mll (download)
Revision: 1.3, Sun Apr 28 05:30:35 2002 UTC (8 years, 4 months ago) by graydon
Branch: MAIN
Changes since 1.2: +2 -1 lines
tidying up for presentability

(* simplified lexical structure of make(1) language
   copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
   GPL 2.x+ no warranty provided or implied *)

{
  open Lexing
  open String
}

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) }

graydon hoare
Powered by
ViewCVS 0.9.2