Commit 563a05eb authored by POGODALLA Sylvain's avatar POGODALLA Sylvain

Bug fixes to work with dypgen-200808...

parent 9812a586
......@@ -50,7 +50,7 @@ if test "$OCAMLLEX" = no ; then
fi
#Look for dypgen
DYPGEN_NEEDED=20080204
DYPGEN_NEEDED=20080702
AC_CHECK_PROGS(DYPGEN,dypgen.opt dypgen,no)
if test "$DYPGEN" = no ; then
AC_MSG_ERROR(Cannot find dypgen)
......
......@@ -1977,7 +1977,7 @@ echo "$as_me: error: Cannot find ocamllex" >&2;}
fi
#Look for dypgen
DYPGEN_NEEDED=20080204
DYPGEN_NEEDED=20080702
for ac_prog in dypgen.opt dypgen
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
......
help;
load d ../data/tag.acg;
compose tag_strings tag_syntax as tag_yields;
list;
tag_syntax tag_yields tag_semantics analyse C_sleeps I_s I_vp (C_dog C_a (C_black (C_big (C_new I_n)))) : S;
tag_syntax tag_yields tag_semantics analyse C_chases I_s I_vp (C_dog C_every I_n) (C_cat C_a I_n) : S;
......
......@@ -15,17 +15,21 @@ include ../Makefile.master
# Used libraries
LIBS += dyp.cma
DYPPATH = /home/pogodall/import/ocaml/dypgen
DYPGEN_LIB = +dypgen
#DYPGEN_LIB = $(DYPPATH)/dyplib
# The corresponding directories
# (if not in the main ocaml lib directory,
# ex. -I +campl4
LIBDIR = -I +dypgen -I +camlp4
LIBDIR = -I $(DYPGEN_LIB) -I +camlp4
# Directories to which the current source files depend on
PREVIOUS_DIRS = ../utils ../logic
# Source files in the right order of dependance
#ML = error.ml abstract_syntax.ml interface.ml environment.ml entry.ml parser.ml lexer.ml data_parsing.ml
ML = error.ml interface.ml environment.ml entry.ml syntactic_data_structures.ml lexer.ml parser.ml interactive.ml
ML = error.ml interface.ml environment.ml entry.ml syntactic_data_structures.ml token.ml lexer.ml parser.ml interactive.ml
EXE_SOURCES = test.ml
......@@ -37,9 +41,54 @@ EXE_SOURCES = test.ml
include ../Makefile.common
#DYPGEN_EXE = dypgen.opt
#DYPGEN_EXE = $(DYPPATH)/dypgen/dypgen --ocamlc "$(LIBDIR) $(I_PREVIOUS_DIRS)"
DYPGEN_EXE = dypgen.opt --ocamlc "$(LIBDIR) $(I_PREVIOUS_DIRS)"
parser.ml : parser.dyp
dypgen.opt --noemit-token-type $<
$(DYPGEN_EXE) --noemit-token-type $<
#parser.ml : parser.dyp
# $(DYPGEN_EXE) --noemit-token-type $<
lexer.ml : lexer.mll
ocamllex.opt $<
parser.cmi: token.cmi error.cmi environment.cmi ../logic/abstract_syntax.cmi
parser.cmo: ../utils/utils.cmi token.cmi syntactic_data_structures.cmi \
lexer.cmo error.cmi environment.cmi entry.cmi \
../logic/abstract_syntax.cmi parser.cmi
parser.cmx: ../utils/utils.cmx token.cmx syntactic_data_structures.cmx \
lexer.cmx error.cmx environment.cmx entry.cmx \
../logic/abstract_syntax.cmx parser.cmi
token.cmi: ../logic/abstract_syntax.cmi
token.cmo: ../logic/abstract_syntax.cmi token.cmi
token.cmx: ../logic/abstract_syntax.cmx token.cmi
error.cmo: ../utils/utils.cmi error.cmi
error.cmx: ../utils/utils.cmx error.cmi
environment.cmi: interface.cmi ../logic/abstract_syntax.cmi
environment.cmo: ../utils/utils.cmi interface.cmi error.cmi \
../logic/abstract_syntax.cmi environment.cmi
environment.cmx: ../utils/utils.cmx interface.cmx error.cmx \
../logic/abstract_syntax.cmx environment.cmi
syntactic_data_structures.cmi: interface.cmi ../logic/abstract_syntax.cmi
syntactic_data_structures.cmo: ../utils/utils.cmi ../utils/tries.cmi \
../utils/table.cmi error.cmi ../logic/abstract_syntax.cmi \
syntactic_data_structures.cmi
syntactic_data_structures.cmx: ../utils/utils.cmx ../utils/tries.cmx \
../utils/table.cmx error.cmx ../logic/abstract_syntax.cmx \
syntactic_data_structures.cmi
lexer.cmo: ../utils/utils.cmi token.cmi error.cmi entry.cmi
lexer.cmx: ../utils/utils.cmx token.cmx error.cmx entry.cmx
interface.cmi: ../logic/lambda.cmi error.cmi ../logic/abstract_syntax.cmi
......@@ -15,17 +15,21 @@ include ../Makefile.master
# Used libraries
LIBS += dyp.cma
DYPPATH = /home/pogodall/import/ocaml/dypgen
DYPGEN_LIB = +dypgen
#DYPGEN_LIB = $(DYPPATH)/dyplib
# The corresponding directories
# (if not in the main ocaml lib directory,
# ex. -I +campl4
LIBDIR = -I +dypgen -I +camlp4
LIBDIR = -I $(DYPGEN_LIB) -I +camlp4
# Directories to which the current source files depend on
PREVIOUS_DIRS = ../utils ../logic
# Source files in the right order of dependance
#ML = error.ml abstract_syntax.ml interface.ml environment.ml entry.ml parser.ml lexer.ml data_parsing.ml
ML = error.ml interface.ml environment.ml entry.ml syntactic_data_structures.ml lexer.ml parser.ml interactive.ml
ML = error.ml interface.ml environment.ml entry.ml syntactic_data_structures.ml token.ml lexer.ml parser.ml interactive.ml
EXE_SOURCES = test.ml
......@@ -37,9 +41,54 @@ EXE_SOURCES = test.ml
include ../Makefile.common
#DYPGEN_EXE = @DYPGEN@
#DYPGEN_EXE = $(DYPPATH)/dypgen/dypgen --ocamlc "$(LIBDIR) $(I_PREVIOUS_DIRS)"
DYPGEN_EXE = @DYPGEN@ --ocamlc "$(LIBDIR) $(I_PREVIOUS_DIRS)"
parser.ml : parser.dyp
@DYPGEN@ --noemit-token-type $<
$(DYPGEN_EXE) --noemit-token-type $<
#parser.ml : parser.dyp
# $(DYPGEN_EXE) --noemit-token-type $<
lexer.ml : lexer.mll
@OCAMLLEX@ $<
parser.cmi: token.cmi error.cmi environment.cmi ../logic/abstract_syntax.cmi
parser.cmo: ../utils/utils.cmi token.cmi syntactic_data_structures.cmi \
lexer.cmo error.cmi environment.cmi entry.cmi \
../logic/abstract_syntax.cmi parser.cmi
parser.cmx: ../utils/utils.cmx token.cmx syntactic_data_structures.cmx \
lexer.cmx error.cmx environment.cmx entry.cmx \
../logic/abstract_syntax.cmx parser.cmi
token.cmi: ../logic/abstract_syntax.cmi
token.cmo: ../logic/abstract_syntax.cmi token.cmi
token.cmx: ../logic/abstract_syntax.cmx token.cmi
error.cmo: ../utils/utils.cmi error.cmi
error.cmx: ../utils/utils.cmx error.cmi
environment.cmi: interface.cmi ../logic/abstract_syntax.cmi
environment.cmo: ../utils/utils.cmi interface.cmi error.cmi \
../logic/abstract_syntax.cmi environment.cmi
environment.cmx: ../utils/utils.cmx interface.cmx error.cmx \
../logic/abstract_syntax.cmx environment.cmi
syntactic_data_structures.cmi: interface.cmi ../logic/abstract_syntax.cmi
syntactic_data_structures.cmo: ../utils/utils.cmi ../utils/tries.cmi \
../utils/table.cmi error.cmi ../logic/abstract_syntax.cmi \
syntactic_data_structures.cmi
syntactic_data_structures.cmx: ../utils/utils.cmx ../utils/tries.cmx \
../utils/table.cmx error.cmx ../logic/abstract_syntax.cmx \
syntactic_data_structures.cmi
lexer.cmo: ../utils/utils.cmi token.cmi error.cmi entry.cmi
lexer.cmx: ../utils/utils.cmx token.cmx error.cmx entry.cmx
interface.cmi: ../logic/lambda.cmi error.cmi ../logic/abstract_syntax.cmi
{
open Error
open Entry
(* open Parser *)
open Abstract_syntax.Token
open Token
(* open Token*)
type lexing_of =
......@@ -18,14 +20,14 @@
let add_bracket loc = brackets:=loc::!brackets
let remove_bracket l = match !brackets with
| [] -> raise (Error (Lexer_error (Unstarted_bracket, l)))
| [] -> raise (Error.Error (Error.Lexer_error (Error.Unstarted_bracket, l)))
| _::tl -> brackets := tl
let check_brackets () =
match !brackets with
| [] -> ()
| (p1,p2)::__ -> let () = brackets := [] in
raise (Error (Lexer_error (Mismatch_parentheses,(p1,p2))))
raise (Error.Error (Error.Lexer_error (Error.Mismatch_parentheses,(p1,p2))))
let data = ref (Data (Entry.start_data ()))
......@@ -45,7 +47,7 @@
with
| Entry.Expect l ->
let s = Utils.string_of_list " or " Entry.valuation_to_string l in
raise (Error (Lexer_error (Expect s,(p1,p2))))
raise (Error.Error (Error.Lexer_error (Error.Expect s,(p1,p2))))
}
......@@ -63,75 +65,75 @@ let string = (letter|digit|'_')*'\''?
| [' ' '\t'] {lexer lexbuf}
| newline {let () = Error.update_loc lexbuf None in lexer lexbuf}
| "(*" {comment [loc lexbuf] lexbuf}
| "*)" {raise (Error (Lexer_error (Unstarted_comment,loc lexbuf)))}
| "*)" {raise (Error.Error (Error.Lexer_error (Error.Unstarted_comment,loc lexbuf)))}
| eof {let () = update_data Entry.EOI (loc lexbuf) in
let () = check_brackets () in
EOI}
Token.EOI}
| ['='] {let () = update_data Entry.Equal (loc lexbuf) in
let () = check_brackets () in
EQUAL(loc lexbuf)}
Token.EQUAL(loc lexbuf)}
| [';'] {let () = update_data Entry.Semi_colon (loc lexbuf) in
let () = check_brackets () in
SEMICOLON(loc lexbuf)}
Token.SEMICOLON(loc lexbuf)}
| [':'] {let () = update_data Entry.Colon (loc lexbuf) in
let () = check_brackets () in
COLON(loc lexbuf)}
Token.COLON(loc lexbuf)}
| [','] {let () = update_data Entry.Comma (loc lexbuf) in
let () = check_brackets () in
COMMA(loc lexbuf)}
Token.COMMA(loc lexbuf)}
| ['('] {let () = update_data (Entry.Type_or_term Entry.LPAR) (loc lexbuf) in
let l = loc lexbuf in
let () = add_bracket l in
LPAREN l}
Token.LPAREN l}
| [')'] {let () = update_data (Entry.Type_or_term Entry.RPAR) (loc lexbuf) in
let brac_loc = loc lexbuf in
let () = remove_bracket brac_loc in
RPAREN brac_loc}
Token.RPAREN brac_loc}
| ['.'] {let () = update_data (Entry.Type_or_term Entry.DOT) (loc lexbuf) in
DOT(loc lexbuf)}
Token.DOT(loc lexbuf)}
| "signature" {let () = update_data Entry.Sig_kwd (loc lexbuf) in
let () = check_brackets () in
SIG_OPEN(loc lexbuf)}
Token.SIG_OPEN(loc lexbuf)}
| "lexicon" {let () = update_data Entry.Lex_kwd (loc lexbuf) in
let () = check_brackets () in
LEX_OPEN(loc lexbuf)}
Token.LEX_OPEN(loc lexbuf)}
| "end" {let () = update_data Entry.End_kwd (loc lexbuf) in
let () = check_brackets () in
END_OF_DEC(loc lexbuf)}
Token.END_OF_DEC(loc lexbuf)}
| "type" {let () = update_data Entry.Type_kwd (loc lexbuf) in
let () = check_brackets () in
TYPE(loc lexbuf)}
Token.TYPE(loc lexbuf)}
| "prefix" {let () = update_data Entry.Prefix_kwd (loc lexbuf) in
let () = check_brackets () in
PREFIX(loc lexbuf)}
Token.PREFIX(loc lexbuf)}
| "infix" {let () = update_data Entry.Infix_kwd (loc lexbuf) in
let () = check_brackets () in
INFIX(loc lexbuf)}
Token.INFIX(loc lexbuf)}
| "binder" {let () = update_data Entry.Binder_kwd (loc lexbuf) in
let () = check_brackets () in
BINDER(loc lexbuf)}
Token.BINDER(loc lexbuf)}
| "lambda" {let () = update_data (Entry.Type_or_term Entry.LAMBDA) (loc lexbuf) in
LAMBDA0(loc lexbuf)}
Token.LAMBDA0(loc lexbuf)}
| "Lambda" {let () = update_data (Entry.Type_or_term Entry.LAMBDA) (loc lexbuf) in
LAMBDA(loc lexbuf)}
Token.LAMBDA(loc lexbuf)}
| "->" {let () = update_data (Entry.Type_or_term Entry.ARROW) (loc lexbuf) in
LIN_ARROW(loc lexbuf)}
Token.LIN_ARROW(loc lexbuf)}
| "=>" {let () = update_data (Entry.Type_or_term Entry.ARROW) (loc lexbuf) in
ARROW(loc lexbuf)}
Token.ARROW(loc lexbuf)}
| ":=" {let () = update_data Entry.Colon_equal (loc lexbuf) in
COLON_EQUAL(loc lexbuf)}
Token.COLON_EQUAL(loc lexbuf)}
| letter string {let () = update_data Entry.Id (loc lexbuf) in
IDENT (Lexing.lexeme lexbuf,loc lexbuf)}
Token.IDENT (Lexing.lexeme lexbuf,loc lexbuf)}
| symbol {let () = update_data Entry.Sym (loc lexbuf) in
SYMBOL (Lexing.lexeme lexbuf,loc lexbuf)}
Token.SYMBOL (Lexing.lexeme lexbuf,loc lexbuf)}
| _ as c {raise (Error.Error (Error.Lexer_error (Error.Bad_token,loc lexbuf)))}
and comment depth = parse
| "*)" {match depth with
| [a] -> lexer lexbuf
| a::tl -> comment tl lexbuf
| [] -> raise (Error (Lexer_error (Unstarted_comment,loc lexbuf)))}
| [] -> raise (Error.Error (Error.Lexer_error (Error.Unstarted_comment,loc lexbuf)))}
| "(*" {comment ((loc lexbuf)::depth) lexbuf}
| eof {raise (Error (Lexer_error (Unclosed_comment, List.hd depth)))}
| eof {raise (Error.Error (Error.Lexer_error (Error.Unclosed_comment, List.hd depth)))}
| newline {let () = Error.update_loc lexbuf None in comment depth lexbuf}
| _ {comment depth lexbuf}
......
This diff is collapsed.
open Abstract_syntax
module Token =
struct
type t =
| SYMBOL of (string*Abstract_syntax.location)
| IDENT of (string*Abstract_syntax.location)
| LIN_ARROW of (Abstract_syntax.location)
| COLON_EQUAL of (Abstract_syntax.location)
| ARROW of (Abstract_syntax.location)
| LAMBDA0 of (Abstract_syntax.location)
| LAMBDA of (Abstract_syntax.location)
| BINDER of (Abstract_syntax.location)
| INFIX of (Abstract_syntax.location)
| PREFIX of (Abstract_syntax.location)
| TYPE of (Abstract_syntax.location)
| END_OF_DEC of (Abstract_syntax.location)
| LEX_OPEN of (Abstract_syntax.location)
| SIG_OPEN of (Abstract_syntax.location)
| DOT of (Abstract_syntax.location)
| RPAREN of (Abstract_syntax.location)
| LPAREN of (Abstract_syntax.location)
| COMMA of (Abstract_syntax.location)
| COLON of (Abstract_syntax.location)
| SEMICOLON of (Abstract_syntax.location)
| EQUAL of (Abstract_syntax.location)
| EOI
end
(** This modules implements the types for the tokens that are useful
to the parsers and the lexers *)
open Abstract_syntax
module Token :
sig
(** The type of available tokens for parsers and lexers *)
type t =
| SYMBOL of (string*Abstract_syntax.location)
| IDENT of (string*Abstract_syntax.location)
| LIN_ARROW of (Abstract_syntax.location)
| COLON_EQUAL of (Abstract_syntax.location)
| ARROW of (Abstract_syntax.location)
| LAMBDA0 of (Abstract_syntax.location)
| LAMBDA of (Abstract_syntax.location)
| BINDER of (Abstract_syntax.location)
| INFIX of (Abstract_syntax.location)
| PREFIX of (Abstract_syntax.location)
| TYPE of (Abstract_syntax.location)
| END_OF_DEC of (Abstract_syntax.location)
| LEX_OPEN of (Abstract_syntax.location)
| SIG_OPEN of (Abstract_syntax.location)
| DOT of (Abstract_syntax.location)
| RPAREN of (Abstract_syntax.location)
| LPAREN of (Abstract_syntax.location)
| COMMA of (Abstract_syntax.location)
| COLON of (Abstract_syntax.location)
| SEMICOLON of (Abstract_syntax.location)
| EQUAL of (Abstract_syntax.location)
| EOI
end
......@@ -68,30 +68,3 @@ struct
end
module Token =
struct
type t =
| SYMBOL of (string*Abstract_syntax.location)
| IDENT of (string*Abstract_syntax.location)
| LIN_ARROW of (Abstract_syntax.location)
| COLON_EQUAL of (Abstract_syntax.location)
| ARROW of (Abstract_syntax.location)
| LAMBDA0 of (Abstract_syntax.location)
| LAMBDA of (Abstract_syntax.location)
| BINDER of (Abstract_syntax.location)
| INFIX of (Abstract_syntax.location)
| PREFIX of (Abstract_syntax.location)
| TYPE of (Abstract_syntax.location)
| END_OF_DEC of (Abstract_syntax.location)
| LEX_OPEN of (Abstract_syntax.location)
| SIG_OPEN of (Abstract_syntax.location)
| DOT of (Abstract_syntax.location)
| RPAREN of (Abstract_syntax.location)
| LPAREN of (Abstract_syntax.location)
| COMMA of (Abstract_syntax.location)
| COLON of (Abstract_syntax.location)
| SEMICOLON of (Abstract_syntax.location)
| EQUAL of (Abstract_syntax.location)
| EOI
end
......@@ -80,36 +80,6 @@ sig
| Constant of (string * location * term )
end
(** This modules implements the types for the tokens that are useful
to the parsers and the lexers *)
module Token :
sig
(** The type of available tokens for parsers and lexers *)
type t =
| SYMBOL of (string*Abstract_syntax.location)
| IDENT of (string*Abstract_syntax.location)
| LIN_ARROW of (Abstract_syntax.location)
| COLON_EQUAL of (Abstract_syntax.location)
| ARROW of (Abstract_syntax.location)
| LAMBDA0 of (Abstract_syntax.location)
| LAMBDA of (Abstract_syntax.location)
| BINDER of (Abstract_syntax.location)
| INFIX of (Abstract_syntax.location)
| PREFIX of (Abstract_syntax.location)
| TYPE of (Abstract_syntax.location)
| END_OF_DEC of (Abstract_syntax.location)
| LEX_OPEN of (Abstract_syntax.location)
| SIG_OPEN of (Abstract_syntax.location)
| DOT of (Abstract_syntax.location)
| RPAREN of (Abstract_syntax.location)
| LPAREN of (Abstract_syntax.location)
| COMMA of (Abstract_syntax.location)
| COLON of (Abstract_syntax.location)
| SEMICOLON of (Abstract_syntax.location)
| EQUAL of (Abstract_syntax.location)
| EOI
end
......@@ -38,8 +38,39 @@ EXE_SOURCES = test.ml
include ../Makefile.common
script_parser.ml : script_parser.dyp
@DYPGEN@ --noemit-token-type $<
@DYPGEN@ --ocamlc "$(LIBDIR) $(I_PREVIOUS_DIRS)" --noemit-token-type $<
script_lexer.ml : script_lexer.mll
@OCAMLLEX@ $<
script_parser.cmi: script_lexer.cmo ../grammars/environment.cmi \
../logic/abstract_syntax.cmi
script_parser.cmo: scripting_errors.cmi script_lexer.cmo functions.cmi \
../grammars/error.cmi ../grammars/environment.cmi \
../logic/abstract_syntax.cmi script_parser.cmi
script_parser.cmx: scripting_errors.cmx script_lexer.cmx functions.cmx \
../grammars/error.cmx ../grammars/environment.cmx \
../logic/abstract_syntax.cmx script_parser.cmi
script_lexer.cmo: scripting_errors.cmi ../grammars/error.cmi \
../logic/abstract_syntax.cmi
script_lexer.cmx: scripting_errors.cmx ../grammars/error.cmx \
../logic/abstract_syntax.cmx
scripting_errors.cmo: ../grammars/error.cmi ../logic/abstract_syntax.cmi \
scripting_errors.cmi
scripting_errors.cmx: ../grammars/error.cmx ../logic/abstract_syntax.cmx \
scripting_errors.cmi
functions.cmi: ../grammars/environment.cmi
functions.cmo: ../utils/utils.cmi scripting_errors.cmi ../grammars/parser.cmi \
../grammars/environment.cmi functions.cmi
functions.cmx: ../utils/utils.cmx scripting_errors.cmx ../grammars/parser.cmx \
../grammars/environment.cmx functions.cmi
open Environment
module type Action_sig =
sig
type env
exception Not_yet_implemented of string
type action =
| Load
| List
| Select
| Unselect
| Trace
| Dont_trace
| Print
| Analyse
| Compose
| Dont_wait
| Wait
| Help of action option
type file_type = | Data | Script of (string -> env -> env)
val load : file_type -> string -> env -> env
val list : env -> unit
val select : string -> (Lexing.position * Lexing.position) -> env -> env
val unselect : env -> env
val trace : unit -> unit
val dont_trace : unit -> unit
val print : ?name:string -> env -> (Lexing.position * Lexing.position) -> unit
val analyse : ?names:(string * (Lexing.position * Lexing.position)) list -> env -> ?offset:string -> string -> (Lexing.position * Lexing.position) -> unit
val compose :
string * (Lexing.position * Lexing.position) ->
string * (Lexing.position * Lexing.position) ->
string * (Lexing.position * Lexing.position) -> env -> env
val wait : unit -> unit
val dont_wait : unit -> unit
val should_wait : unit -> bool
val help : action -> unit
val exit : unit -> unit
end
module Make (E:Environment_sig) =
struct
type env=E.t
exception Not_yet_implemented of string
let interactive = ref false
type file_type = | Data | Script of (string -> E.t -> E.t)
type file_type = | Data | Script of (string -> env -> env)
module Data_parser = Parser.Make(E)
......
open Environment
module Make(E:Environment_sig) :
module type Action_sig =
sig
type env
exception Not_yet_implemented of string
type action =
......@@ -22,27 +24,27 @@ sig
type file_type = | Data | Script of (string -> E.t -> E.t)
type file_type = | Data | Script of (string -> env -> env)
val load : file_type -> string -> E.t -> E.t
val load : file_type -> string -> env -> env
val list : E.t -> unit
val list : env -> unit
val select : string -> (Lexing.position * Lexing.position) -> E.t -> E.t
val select : string -> (Lexing.position * Lexing.position) -> env -> env
val unselect : E.t -> E.t
val unselect : env -> env
val trace : unit -> unit
val dont_trace : unit -> unit
val print : ?name:string -> E.t -> (Lexing.position * Lexing.position) -> unit
val print : ?name:string -> env -> (Lexing.position * Lexing.position) -> unit
val analyse : ?names:(string * (Lexing.position * Lexing.position)) list -> E.t -> ?offset:string -> string -> (Lexing.position * Lexing.position) -> unit
val analyse : ?names:(string * (Lexing.position * Lexing.position)) list -> env -> ?offset:string -> string -> (Lexing.position * Lexing.position) -> unit
val compose :
string * (Lexing.position * Lexing.position) ->
string * (Lexing.position * Lexing.position) ->
string * (Lexing.position * Lexing.position) -> E.t -> E.t
string * (Lexing.position * Lexing.position) -> env -> env
val wait : unit -> unit
......@@ -54,3 +56,6 @@ sig
val exit : unit -> unit
end
module Make(E:Environment_sig) : Action_sig with type env=E.t
%mltop{
open Abstract_syntax
(* open Abstract_syntax*)
open Script_lexer
(* type token = Script_lexer.token *)
......@@ -29,29 +29,29 @@
%token
EOII
<(string*Abstract_syntax.location*string)>LOAD_DATA
<(string*Abstract_syntax.location*string)>LOAD_SCRIPT
<(string*Abstract_syntax.Abstract_syntax.location*string)>LOAD_DATA
<(string*Abstract_syntax.Abstract_syntax.location*string)>LOAD_SCRIPT
LOAD_HELP
LIST
SELECT
UNSELECT
TRACE
HELP
<Abstract_syntax.location>PRINT
<(string*Abstract_syntax.location*string)>ANALYSE
<Abstract_syntax.Abstract_syntax.location>PRINT
<(string*Abstract_syntax.Abstract_syntax.location*string)>ANALYSE
COMPOSE
<string>SEMICOLONN
AS
DONT
WAIT
<(string*Abstract_syntax.location)>IDENTT
/*<(string*Abstract_syntax.location)>STRING*/
<(string*Abstract_syntax.Abstract_syntax.location)>IDENTT
/*<(string*Abstract_syntax.Abstract_syntax.location)>STRING*/
%start <(E.t)> zzcommands
%local_data_type <(E.t * (string -> E.t -> E.t))>
%global_data_type <bool>
/*%local_data_type <(E.t * (string -> E.t -> E.t))>
%global_data_type <bool>*/
%%
......@@ -183,12 +183,15 @@ WAIT
end}
%mlitop{
open Abstract_syntax
(* open Abstract_syntax*)
open Script_lexer
module Make(E:Environment.Environment_sig) :
sig
module F : Functions.Action_sig with type env=E.t
(* type token = Script_lexer.token*)
val parse_file : string -> E.t -> E.t
......