2011/1/28 john skaller <skal...@users.sourceforge.net>
>
>
> OK, so I tried this and I get:
>
> ~/felix>flx --test=build/release/ --force abe
> Saving automaton felix.automaton
> Fatal error: exception Invalid_argument("output_value: abstract value
> (Custom)")
>
> This is hardly surprising, but leaves the question: exactly what is saved?
>
Basically it contains the automaton, the user actions, the merge functions,
the grammar and other values that describe the parser. It is a value of type
parser_pilot that is used.
A parser_pilot is a couple of a parsing_device and a parser_parameters (the
parser_parameters part is not used actually).
Here are the details of the types if you need them exactly:
and ('t,'o,'gd,'ld,'l) parser_pilot =
('t,'o,'gd,'ld,'l) parsing_device * ('t,'o,'gd,'ld,'l) parser_parameters
and ('token,'obj,'data,'local_data,'lexbuf) parser_parameters = {
merge_warning : bool;
undef_nt : bool;
get_value : 'token -> 'obj;
get_name : 'token -> int;
str_token : 'token -> string;
global_data_equal : 'data -> 'data -> bool;
local_data_equal : 'local_data -> 'local_data -> bool;
find_rightSib_global_data_equal : 'data -> 'data -> bool;
find_rightSib_local_data_equal : 'local_data -> 'local_data -> bool;
test_cons : ('obj -> bool) array;
str_cons : 'obj -> string;
cons_str : string array;
cons_table : (string, int) Hashtbl.t;
merge_array : ('obj,'data,'local_data) merge_function array;
lexbuf_position_fun : 'lexbuf -> (Lexing.position * Lexing.position);
regexp_fun : 'obj dyplexbuf -> 'obj;
use_dyplex : bool;
use_rule_order : bool;
use_all_actions : bool }
and ('t,'o,'gd,'ld,'l) parsing_device = {
ra_list :
(rule * ('t,'o,'gd,'ld,'l) action *
(int * ('t,'o,'gd,'ld,'l) inherited_val) list)
list;
gram_lhs : ((int list) * (int option)) array;
gram_rhs : rhs array;
gram_parnt : (int * int) list array;
(* one index by rule, the list contains the places in the rhs where
a parameterized nt lies (a nt that sends down an inherited attribute)
and the ids of its associated inherited value *)
lhs_table : lhs array;
bnt_array : bool array;
(* tells whether a nt is "bestowing" values i.e. parameterized *)
(*dypgen_epsilon : int;
(* the id of the non terminal dypgen__epsilon *)*)
actions : ('t,'o,'gd,'ld,'l) action list array;
inherited :
(('t,'o,'gd,'ld,'l) inherited_val list * int * int * int * bool) array;
(* 1st int is the number of synthesized attributes that arguments
i.e. the number of symbols preceding the inherited att in the rhs,
the 2nd int is the nt of the lhs in case it is parameterized,
the 3rd int is the nt that is using this action.
the bool tells whether the first symbol in the rhs is dypgen__epsilon. *)
entry_point : int;
entry_points : (int, state) Hashtbl.t;
g_nb : int;
(* the id of the grammar of the parser *)
lex_nb : int;
(* the id of the main lexer *)
nt_table : (string, int) Hashtbl.t;
stations : state option array;
state_list : state list;
is_trace : Dyp_special_types.is_trace;
(*array_nt_prio : Dyp_special_types.array_nt_prio;*)
st_nb : int;
table : (int, int) Hashtbl.t array array;
(* 1st index for state
2nd index: 0 for terminals, 1 for non terminals
3rd index to choose which terminal or nt. *)
table_it : item_set array;
state_is_mergeable : bool array;
state_bnt : int option array; (*Int_set.t array;*)
(* for each state, id of the action to produce inherited attributes. *)
(*table_lex_trans : bool array;*)
(* index: (state id * nb of ter) + ter id,
says whether a transition with this terminal exists.
to be improved : an int array *)
table_lit_trans : lit_trans array;
(*lhslists : lhslists;*)
r_L : int list array;
(*po : bool option array array;*)
(*po : bool array array;*)
po : ((int * int), bool) Hashtbl.t ;
(** Partial order between non terminal name couples. A couple of non
terminals is bound to a bool. This may be implemented alternatively
with a set : the presence of a couple (nt1,nt2) in the set would
denote that nt1<=nt2 is true. This would save memory space. *)
cyclic_rules : int list array;
(* For each rule tells whether the rule is cyclic. If the rule is not
cyclic then the list is empty, otherwise it contains the places of the
non terminals in the rhs which make the rule cyclic. *)
data : 'gd;
loc_data : 'ld;
(*prio : priority_data;*)
token_nb : int;
nt_nb : int;
(* number of non terminals in the internal grammar
(as opposed to the user grammar. *)
(*prio_of_ind : int array;
nt_of_ind : non_ter array;*)
(*lhs_of_ind : lhs array;*)
str_non_ter : string array;
cons_of_nt : int array;
relations : string list list;
nt_cons_map : nt_cons_map;
rn_of_rule : (rule, int) Hashtbl.t;
(*regexp_decl :
(string, (node -> int -> int -> node * int * int)) Hashtbl.t;*)
regexp_decl : (string, (node -> int -> node * int)) Hashtbl.t;
main_lexer_start : node;
main_lexer_table : lex_table;
main_lexer_actions : (int * ('o dyplexbuf -> 'o)) array;
(* the int is the id of the terminal that is produced *)
aux_lexer : 'o aux_lexer;
str_ter : string array;
ter_table : (string, int) Hashtbl.t;
layout_id : int;
regexp_table : (regexp, int) Hashtbl.t;
(*regexp_actions : (int * ('o dyplexbuf -> 'o)) array;*)
regexp_array : regexp array;
rule_options : int array;
(* tells for each rule whether it allows layout characters inside
or afterward *)
nt_ntl_array : Int_set.t array;
(* for each nt(p) gives the set of all the implicit non terminals
that accept nt(p) *)
implicit_rule : bool array;
left_rec_rule : bool array;
}
and types that are used in those:
type ('obj,'gd,'ld) merge_function =
('obj * 'gd * 'ld) list -> ('obj list) * 'gd * 'ld
type ('t,'o,'gd,'ld,'l) action =
Dypgen_action of ( 'o list -> (Lexing.position * Lexing.position) ->
(Lexing.position * Lexing.position) list -> 'gd ->
'ld -> 'ld -> debug_infos ->
('t,'o,'gd,'ld,'l) parser_pilot ->
(unit -> string list) ->
('o * bool * bool *
'gd * 'ld *
((rule * ('t,'o,'gd,'ld,'l) action *
(int * ('t,'o,'gd,'ld,'l) inherited_val) list) list) *
(string * string) list *
(* list of couples (nt,cons) to bind new non terminals to constructors
*)
string list list * (* those are the new relations *)
(out_channel option) * (out_channel option) *
('t,'o,'gd,'ld,'l) parser_pilot option) )
and ('t,'o,'gd,'ld,'l) inherited_val =
'o list -> (Lexing.position * Lexing.position) ->
(Lexing.position * Lexing.position) list -> 'gd ->
'ld -> 'ld -> debug_infos ->
('t,'o,'gd,'ld,'l) parser_pilot ->
(unit -> string list) ->
'o
and 'o aux_lexer = {
aux_lexer_start : (string, node) Hashtbl.t;
aux_lexer_table : (string, lex_table) Hashtbl.t;
aux_lexer_actions : (string, ('o list -> 'o dyplexbuf -> 'o) array)
Hashtbl.t
}
and 'o dyplexbuf = {
lb_lexbuf : Lexing.lexbuf;
lb_aux_lex : 'o aux_lexer }
Emmanuel
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language