annotate tools/nclex.mll @ 1:b5139af1a420 tip basis

Fixed permissions on compile scripts
author Mike Spivey <mike@cs.ox.ac.uk>
date Fri, 13 Oct 2017 17:27:58 +0100
parents bfdcc3820b32
children
rev   line source
mike@0 1 (* nclex.mll *)
mike@0 2 (* Copyright (c) 2017 J. M. Spivey *)
mike@0 3
mike@0 4 {
mike@0 5 open Ncparse
mike@0 6 open String
mike@0 7 open Lexing
mike@0 8
mike@0 9 let line_no = ref 1
mike@0 10 }
mike@0 11
mike@0 12 rule token =
mike@0 13 parse
mike@0 14 "<"(['A'-'Z''a'-'z']+|'('[^')']+')' as s) { OPEN s }
mike@0 15 | [^'<''>''('')'',''@'' ''\n']+ as s { WORD s }
mike@0 16 | "(*"[^'\n']*"*)" as s { WORD s }
mike@0 17 | "->" as s { WORD s }
mike@0 18 | " " { SPACE }
mike@0 19 | ">" { CLOSE }
mike@0 20 | "(" { LPAREN }
mike@0 21 | ")" { RPAREN }
mike@0 22 | "," { COMMA }
mike@0 23 | "@" { ATSIGN }
mike@0 24 | "\n" { incr line_no; CHAR '\n' }
mike@0 25 | _ as c { CHAR c }
mike@0 26 | eof { EOF }
mike@0 27