Commit a8207ca1 authored by POTTIER Francois's avatar POTTIER Francois

Inlined [branches] again. No use isolating it.

parent 8cc8231b
/* This is the crude version of the parser. It is meant to be processed /* This is the crude version of the parser. It is meant to be processed
by ocamlyacc. Its existence is necessary for bootstrapping. It is kept by ocamlyacc. Its existence is necessary for bootstrapping. It is kept
in sync with [fancy-parser]. The two parsers accept the same language, in sync with [fancy-parser], with a few differences:
but [fancy-parser] performs slightly more refined error handling. */ 1. [fancy-parser] exploits many features of Menhir;
2. [fancy-parser] performs slightly more refined error handling;
3. [fancy-parser] supports anonymous rules. */
%{ %{
...@@ -162,7 +164,8 @@ rule: ...@@ -162,7 +164,8 @@ rule:
symbol symbol
optional_formal_parameters optional_formal_parameters
COLON COLON
branches optional_bar
production_group production_groups
{ {
let public, inline = $1 in let public, inline = $1 in
{ pr_public_flag = public; { pr_public_flag = public;
...@@ -170,14 +173,10 @@ rule: ...@@ -170,14 +173,10 @@ rule:
pr_nt = Positions.value $2; pr_nt = Positions.value $2;
pr_positions = [ Positions.position $2 ]; pr_positions = [ Positions.position $2 ];
pr_parameters = $3; pr_parameters = $3;
pr_branches = $5 pr_branches = List.flatten ($6 :: List.rev $7)
} }
} }
branches:
optional_bar production_group production_groups
{ List.flatten ($2 :: List.rev $3) }
flags: flags:
/* epsilon */ /* epsilon */
{ false, false } { false, false }
......
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