(***********************************************************************)
(*                                                                     *)
(*                                 GALAX                               *)
(*                            XML Query Engine                         *)
(*                                                                     *)
(*  Copyright 2001, Lucent Technologies.                               *)
(*  Distributed only by permission.                                    *)
(*                                                                     *)
(***********************************************************************)

(* $Id: mapping.mli,v 1.6 2003/04/16 19:52:47 mff Exp $ *)

(***********************************************************************)
(* this interface is the toplevel of the mapping from Full XQuery      *)
(* expression to the Core XQuery Expreession.                          *)
(***********************************************************************)

(* Maps sort declarations and compiles a new schema *)

val map_sort : Namespace.nsenv -> Xquery_ast.sort_decl_list -> Schema.schema

val map_context : Xquery_ast.context_decl list -> (Namespace.nsenv * Xquery_ast.sort_decl list)

(* Maps datatypes into models *)

val map_resolved_datatype_to_model : Xquery_ast.datatype -> Xquery_ast.model

(* Mapping functions for:
     o library module
     o main module 
     o individual statement 
*)

val map_library_module : Norm_context.norm_context -> Xquery_ast.query_module -> (Norm_context.norm_context * Xquery_ast.cquery_module)
val map_main_module    : Norm_context.norm_context -> Xquery_ast.query_module -> (Norm_context.norm_context * Xquery_ast.cquery_module)
val map_statement      : Norm_context.norm_context -> Xquery_ast.statement -> Xquery_ast.cstatement
val map_expr           : Norm_context.norm_context -> Xquery_ast.expr -> Xquery_ast.cexpr
val map_update         : Norm_context.norm_context -> Xquery_ast.update -> Xquery_ast.cupdate

