Commit d43802e0 authored by POTTIER Francois's avatar POTTIER Francois

Removed the file [ConcreteSyntax].

parent dd8cf6a8
...@@ -2,5 +2,4 @@ ...@@ -2,5 +2,4 @@
which could be produced by either ocamlyacc or Menhir. *) which could be produced by either ocamlyacc or Menhir. *)
val grammar : val grammar :
(Lexing.lexbuf -> Parser.token) -> Lexing.lexbuf -> ConcreteSyntax.grammar (Lexing.lexbuf -> Parser.token) -> Lexing.lexbuf -> Syntax.grammar
type grammar =
{
pg_filename : Syntax.filename;
pg_declarations : (Syntax.declaration Positions.located) list;
pg_rules : Syntax.parameterized_rule list;
pg_trailer : Syntax.trailer option;
}
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
%{ %{
open ConcreteSyntax
open Syntax open Syntax
open Positions open Positions
...@@ -30,7 +29,7 @@ open Positions ...@@ -30,7 +29,7 @@ open Positions
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* Start symbol. */ /* Start symbol. */
%start <ConcreteSyntax.grammar> grammar %start <Syntax.grammar> grammar
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* Priorities. */ /* Priorities. */
...@@ -344,4 +343,3 @@ trailer: ...@@ -344,4 +343,3 @@ trailer:
{ Some (Lazy.force p) } { Some (Lazy.force p) }
%% %%
...@@ -19,7 +19,7 @@ let load_partial_grammar filename = ...@@ -19,7 +19,7 @@ let load_partial_grammar filename =
let lexbuf = Lexing.from_string contents in let lexbuf = Lexing.from_string contents in
lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with pos_fname = filename }; lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with pos_fname = filename };
let grammar = let grammar =
{ (Driver.grammar Lexer.main lexbuf) with ConcreteSyntax.pg_filename = filename } { (Driver.grammar Lexer.main lexbuf) with Syntax.pg_filename = filename }
in in
Error.file_contents := None; Error.file_contents := None;
grammar grammar
...@@ -164,4 +164,3 @@ let () = ...@@ -164,4 +164,3 @@ let () =
exit 0 exit 0
| Settings.PMNormal -> | Settings.PMNormal ->
() ()
open Misc open Misc
open Syntax open Syntax
open ConcreteSyntax
open InternalSyntax open InternalSyntax
open Positions open Positions
...@@ -433,7 +432,7 @@ let iter_on_only_used_symbols f t = ...@@ -433,7 +432,7 @@ let iter_on_only_used_symbols f t =
| _ -> ()) | _ -> ())
t t
let symbols_of grammar (pgrammar : ConcreteSyntax.grammar) = let symbols_of grammar (pgrammar : Syntax.grammar) =
let tokens = grammar.p_tokens in let tokens = grammar.p_tokens in
let symbols_of_rule symbols prule = let symbols_of_rule symbols prule =
let rec store_except_rule_parameters = let rec store_except_rule_parameters =
......
val join_partial_grammars : val join_partial_grammars :
ConcreteSyntax.grammar list -> InternalSyntax.grammar Syntax.grammar list -> InternalSyntax.grammar
...@@ -123,3 +123,10 @@ type parameterized_rule = ...@@ -123,3 +123,10 @@ type parameterized_rule =
pr_branches : parameterized_branch list; pr_branches : parameterized_branch list;
} }
type grammar =
{
pg_filename : filename;
pg_declarations : declaration Positions.located list;
pg_rules : parameterized_rule list;
pg_trailer : trailer option;
}
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
%{ %{
open ConcreteSyntax
open Syntax open Syntax
open Positions open Positions
...@@ -21,7 +20,7 @@ open Positions ...@@ -21,7 +20,7 @@ open Positions
%token <Stretch.t Lazy.t> PERCENTPERCENT %token <Stretch.t Lazy.t> PERCENTPERCENT
%token <Syntax.identifier option array -> Syntax.action> ACTION %token <Syntax.identifier option array -> Syntax.action> ACTION
%start grammar %start grammar
%type <ConcreteSyntax.grammar> grammar %type <Syntax.grammar> grammar
/* These declarations solve a shift-reduce conflict in favor of /* These declarations solve a shift-reduce conflict in favor of
shifting: when the declaration of a non-terminal symbol begins with shifting: when the declaration of a non-terminal symbol begins with
...@@ -335,4 +334,3 @@ producer: ...@@ -335,4 +334,3 @@ producer:
{ Positions.lex_join (symbol_start_pos()) (symbol_end_pos()), Some $1, $3 } { Positions.lex_join (symbol_start_pos()) (symbol_end_pos()), Some $1, $3 }
%% %%
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