]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_textual_parser/cicTextualLexer.mll
Initial revision
[helm.git] / helm / ocaml / cic_textual_parser / cicTextualLexer.mll
index 3e256b2cf7aab75b055b2c0f012589b8d6ae91e9..1be084795a11505eb80764da93da88e1ad79d5b6 100644 (file)
@@ -49,7 +49,7 @@
  ;;
 }
 let num = ['1'-'9']['0'-'9']* | '0'
-let alfa = ['A'-'Z' 'a'-'z' '_']
+let alfa = ['A'-'Z' 'a'-'z' '_' ''' '-']
 let ident = alfa (alfa | num)*
 let baseuri = '/'(ident '/')* ident '.'
 let conuri = baseuri ("con" | "var")
@@ -71,12 +71,17 @@ rule token =
   | indtyuri    { INDTYURI (indtyuri_of_uri ("cic:" ^ L.lexeme lexbuf)) }
   | indconuri   { INDCONURI (indconuri_of_uri("cic:" ^ L.lexeme lexbuf)) }
   | num         { NUM (int_of_string (L.lexeme lexbuf)) }
-  | '?' num     { META (int_of_string (L.lexeme lexbuf)) }
+  | '?' num     { let lexeme = L.lexeme lexbuf in
+                   META
+                    (int_of_string
+                     (String.sub lexeme 1 (String.length lexeme - 1))) }
   | ":>"        { CAST }
   | ":="        { LETIN }
   | '?'         { IMPLICIT }
   | '('         { LPAREN }
   | ')'         { RPAREN }
+  | '['         { LBRACKET }
+  | ']'         { RBRACKET }
   | '{'         { LCURLY }
   | '}'         { RCURLY }
   | ';'         { SEMICOLON }
@@ -85,5 +90,6 @@ rule token =
   | ':'         { COLON }
   | '.'         { DOT }
   | "->"        { ARROW }
+  | "_"         { NONE }
   | eof         { EOF }
 {}