let regexp num = digit+
let regexp tex_token = '\\' alpha+
let regexp symbol = [^ 'a' - 'z' 'A' - 'Z' '0' - '9' ' ' '\t' '\n' ]
-let regexp ident_cont = alpha | num | '_'
+let regexp ident_cont = alpha | num | '_' | '\''
let regexp ident_cont' = ident_cont | tex_token
let regexp ident = (alpha ident_cont*) | ('_' ident_cont+)
let regexp ident' = ((alpha | tex_token) ident_cont'*) | ('_' ident_cont'+)
let regexp paren = [ '(' '[' '{' ')' ']' '}' ]
+let regexp implicit = '?'
let regexp meta = '?' num
let regexp qstring = '"' [^ '"']* '"'
let regexp uri =
| num -> return lexbuf ("NUM", Ulexing.utf8_lexeme lexbuf)
| paren -> return lexbuf ("PAREN", Ulexing.utf8_lexeme lexbuf)
| meta -> return lexbuf ("META", Ulexing.utf8_lexeme lexbuf)
+ | implicit -> return lexbuf ("IMPLICIT", Ulexing.utf8_lexeme lexbuf)
| qstring ->
let lexeme = Ulexing.utf8_lexeme lexbuf in
let s = String.sub lexeme 1 (String.length lexeme - 2) in
Ulexing.utf8_sub_lexeme lexbuf 1 (Ulexing.lexeme_length lexbuf - 1)
in
(try
- return lexbuf ("SYMBOL", Macro.expand macro)
- with Macro.Macro_not_found _ ->
+ return lexbuf ("SYMBOL", CicTextualParser2Macro.expand macro)
+ with CicTextualParser2Macro.Macro_not_found _ ->
return lexbuf ("SYMBOL", Ulexing.utf8_lexeme lexbuf))
| eof -> return lexbuf ("EOI", "")
| _ -> error lexbuf "Invalid character"