Commit 6cca2515 authored by gerd's avatar gerd

New headers specific for the output format


git-svn-id: https://godirepo.camlcity.org/svn/lib-pxp/trunk@671 dbe99aee-44db-0310-b2b3-d33182c8eb97
parent 73d7992a
This diff is collapsed.
......@@ -345,11 +345,14 @@ let write_output_files cfg cc =
CC_generic(defs,let_str) ->
( match cfg.out_format with
`OCAMLLEX ->
output_string out "{\n";
if List.mem_assoc "HEADER" lex_src then (
output_string out "{\n";
output_string out (List.assoc "HEADER" lex_src);
output_string out "}\n";
);
if List.mem_assoc "HEADER_OCAMLLEX" lex_src then (
output_string out (List.assoc "HEADER_OCAMLLEX" lex_src);
);
output_string out "}\n";
List.iter (Lexpp_file.print_definition out) defs;
output_string out let_str;
if List.mem_assoc "LET" lex_src then
......@@ -358,6 +361,9 @@ let write_output_files cfg cc =
if List.mem_assoc "HEADER" lex_src then (
output_string out (List.assoc "HEADER" lex_src);
);
if List.mem_assoc "HEADER_ULEX" lex_src then (
output_string out (List.assoc "HEADER_ULEX" lex_src);
);
List.iter (Lexpp_file.print_ulex_definition out) defs;
output_string out (transform_let_to_ulex let_str);
if List.mem_assoc "LET" lex_src then
......@@ -370,11 +376,14 @@ let write_output_files cfg cc =
if cfg.out_format <> `WLEX then
failwith "This output format is incompatible with wlex char classes";
output_string out classes_str;
output_string out "{\n";
if List.mem_assoc "HEADER" lex_src then (
output_string out "{\n";
output_string out (List.assoc "HEADER" lex_src);
output_string out "}\n";
);
if List.mem_assoc "HEADER_WLEX" lex_src then (
output_string out (List.assoc "HEADER_WLEX" lex_src);
);
output_string out "}\n";
output_string out let_str;
if List.mem_assoc "LET" lex_src then
output_string out (List.assoc "LET" lex_src);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment