;;
}
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")
Hashtbl.find uri_of_id_map $1
with
Not_found ->
- raise (UnknownIdentifier $1)
+ match ! CicTextualParser0.locate_object $1 with
+ | None -> raise (UnknownIdentifier $1)
+ | Some term -> Hashtbl.add uri_of_id_map $1 term; term
}
| CASE LPAREN expr COLON INDTYURI SEMICOLON expr RPAREN LCURLY branches RCURLY
{ let cookingno = get_cookingno (fst $5) in
let current_uri = ref (UriManager.uri_of_string "cic:/dummy.con");;
let binders = ref ([] : (Cic.name option) list);;
let metasenv = ref ([] : Cic.metasenv);;
+let locate_object = ref ((fun _ -> None):string->Cic.term option);;
+
+let set_locate_object f =
+ locate_object := f
mQueryUtil.cmi: mathQL.cmo
mQueryTParser.cmo: mathQL.cmo mQueryTParser.cmi
mQueryTParser.cmx: mathQL.cmx mQueryTParser.cmi
-mQueryUtil.cmo: mQueryTLexer.cmo mQueryTParser.cmi mathQL.cmo mQueryUtil.cmi
-mQueryUtil.cmx: mQueryTLexer.cmx mQueryTParser.cmx mathQL.cmx mQueryUtil.cmi
mQueryTLexer.cmo: mQueryTParser.cmi
mQueryTLexer.cmx: mQueryTParser.cmx
+mQueryUtil.cmo: mQueryHTML.cmo mQueryTLexer.cmo mQueryTParser.cmi mathQL.cmo \
+ mQueryUtil.cmi
+mQueryUtil.cmx: mQueryHTML.cmx mQueryTLexer.cmx mQueryTParser.cmx mathQL.cmx \
+ mQueryUtil.cmi
INTERFACE_FILES = mQueryTParser.mli mQueryUtil.mli
IMPLEMENTATION_FILES = mathQL.ml mQueryTParser.ml mQueryTLexer.ml \
- mQueryUtil.ml
+ mQueryHTML.ml mQueryUtil.ml
EXTRA_OBJECTS_TO_INSTALL = mathQL.ml mathQL.cmi mQueryTLexer.cmi \
- mQueryTLexer.mll mQueryTParser.mly
+ mQueryTLexer.mll mQueryTParser.mly \
+ mQueryHTML.ml mQueryHTML.cmi
EXTRA_OBJECTS_TO_CLEAN = mQueryTParser.ml mQueryTParser.mli \
mQueryTLexer.ml
(******************************************************************************)
open MathQL
+open MQueryHTML
-(* string linearization of a reference *)
+(* string linearization of a reference **************************************)
let str_btoken = function
| MQBC s -> s
let xp_str_uref (u, i) =
UriManager.string_of_uri u ^ str_frag true string_of_int i
-(* raw HTML representation *)
-
-let key s = "<font color=\"blue\">" ^ s ^ " </font>"
-
-let sub s = "<font color=\"blue\"> " ^ s ^ " </font>"
-
-let sub2 s = "<font color=\"blue\">" ^ s ^ "</font>"
-
-let sym s = s
-
-let sep s = s
-
-let str s = "<font color=\"red\">'" ^ s ^ "'</font>"
-
-let pat s = "<font color=\"red\">\"" ^ s ^ "\"</font>"
-
-let res s = "<font color=\"brown\">\"" ^ s ^ "\"</font>"
-
-let nl () = "<br>"
-
-let par () = "<p>"
-
-(* HTML representation of a query *)
+(* HTML representation of a query ********************************************)
let out_rvar s = sym s
let rec out_sequence f = function
| [] -> sep "."
| [s] -> f s
- | s :: tail -> f s ^ sep "," ^ out_sequence f tail
+ | s :: tail -> f s ^ sep ", " ^ out_sequence f tail
let out_order = function
| MQAsc -> sub2 "asc"
let out_query = function
| MQList l -> out_list l
-(* HTML representation of a query result *)
+(* HTML representation of a query result ************************************)
let rec out_res_list = function
| [] -> ""
match qr with
| MQRefs l -> out_res_list l
-(* Converting functions *)
+(* Converting functions *****************************************************)
let tref_uref u =
let s = str_uref u in