aboutsummaryrefslogtreecommitdiff
path: root/boot/parser.yy
diff options
context:
space:
mode:
Diffstat (limited to 'boot/parser.yy')
-rw-r--r--boot/parser.yy29
1 files changed, 16 insertions, 13 deletions
diff --git a/boot/parser.yy b/boot/parser.yy
index 65d3dba..855cc76 100644
--- a/boot/parser.yy
+++ b/boot/parser.yy
@@ -161,6 +161,7 @@ along with GCC; see the file COPYING3. If not see
%type <std::unique_ptr<elna::boot::attribute>> attribute;
%type <std::vector<elna::boot::attribute>> attributes;
%type <std::pair<std::vector<std::string>, bool>> import_declaration;
+%type <bool> export_marker;
%type <std::vector<std::string>> import_path;
%type <std::vector<elna::boot::identifier>> required_identifiers optional_identifiers generic_parameters;
%type <std::unique_ptr<elna::boot::enumeration_type_expression::member_declaration>> enumeration_member;
@@ -244,9 +245,15 @@ optional_begin_statements:
| statements { $$ = $1; }
identifier:
IDENTIFIER { $$ = std::make_unique<boot::identifier>($1, boot::make_position(@1)); }
+export_marker:
+ "*" { $$ = true; }
+ | %empty { $$ = false; }
identifier_definition:
- IDENTIFIER "*" { $$ = std::make_unique<boot::identifier_definition>($1, boot::make_position(@1), true); }
- | IDENTIFIER { $$ = std::make_unique<boot::identifier_definition>($1, boot::make_position(@1), false); }
+ IDENTIFIER generic_parameters export_marker
+ {
+ $$ = std::make_unique<boot::identifier_definition>($1, boot::make_position(@1),
+ $3, std::move($2));
+ }
attribute:
"#{" IDENTIFIER optional_expressions "}"
{
@@ -282,16 +289,14 @@ procedure_heading:
$$->attributes = $4;
}
procedure_declaration:
- "proc" identifier_definition generic_parameters procedure_heading procedure_body
+ "proc" identifier_definition procedure_heading procedure_body
{
$$ = new boot::procedure_declaration(boot::make_position(@$),
- std::move(*$2), $4, std::move(*$5));
- $$->parameters = $3;
+ std::move(*$2), $3, std::move(*$4));
}
- | "proc" identifier_definition generic_parameters procedure_heading "extern"
+ | "proc" identifier_definition procedure_heading "extern"
{
- $$ = new boot::procedure_declaration(boot::make_position(@$), std::move(*$2), $4);
- $$->parameters = $3;
+ $$ = new boot::procedure_declaration(boot::make_position(@$), std::move(*$2), $3);
}
call_expression:
designator_expression actual_parameter_list
@@ -764,16 +769,14 @@ import_declarations:
new boot::import_declaration(boot::make_position(@$), std::move(segments), exported));
}
type_declaration:
- identifier_definition generic_parameters "=" type_expression
+ identifier_definition "=" type_expression
{
- $$ = new boot::type_declaration(boot::make_position(@$), std::move(*$1), $4);
- $$->parameters = $2;
+ $$ = new boot::type_declaration(boot::make_position(@$), std::move(*$1), $3);
}
- | identifier_definition generic_parameters "=" "extern"
+ | identifier_definition "=" "extern"
{
$$ = new boot::type_declaration(boot::make_position(@$), std::move(*$1),
new boot::extern_type_expression(boot::make_position(@$)));
- $$->parameters = $2;
}
type_declarations:
type_declaration type_declarations