Add semicolons back
This commit is contained in:
@ -126,7 +126,9 @@ along with GCC; see the file COPYING3. If not see
|
||||
%type <elna::boot::variable_declaration *> formal_parameter
|
||||
%type <std::shared_ptr<elna::boot::top_type>> type_expression;
|
||||
%type <elna::boot::traits_expression *> traits_expression;
|
||||
%type <elna::boot::expression *> expression operand unary;
|
||||
%type <elna::boot::expression *> expression operand;
|
||||
%type <elna::boot::unary_expression *> unary_expression;
|
||||
%type <elna::boot::binary_expression *> binary_expression;
|
||||
%type <std::vector<elna::boot::expression *>> expressions actual_parameter_list;
|
||||
%type <elna::boot::designator_expression *> designator_expression;
|
||||
%type <elna::boot::assign_statement *> assign_statement;
|
||||
@ -143,7 +145,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
%type <std::vector<elna::boot::type_definition *>> type_definitions type_part;
|
||||
%type <elna::boot::block *> block;
|
||||
%type <elna::boot::field_t> field_declaration;
|
||||
%type <std::vector<std::pair<std::string, std::shared_ptr<elna::boot::top_type>>>> optional_fields fields;
|
||||
%type <std::vector<std::pair<std::string, std::shared_ptr<elna::boot::top_type>>>> optional_fields required_fields;
|
||||
%type <std::vector<elna::boot::conditional_statements *>> elsif_then_statements elsif_do_statements;
|
||||
%type <elna::boot::cast_expression *> cast_expression;
|
||||
%type <std::pair<std::string, bool>> identifier_definition;
|
||||
@ -321,8 +323,11 @@ operand:
|
||||
| call_expression { $$ = $1; }
|
||||
| "(" expression ")" { $$ = $2; }
|
||||
expression:
|
||||
unary { $$ = $1; }
|
||||
| expression "*" expression
|
||||
unary_expression { $$ = $1; }
|
||||
| binary_expression { $$ = $1; }
|
||||
| operand { $$ = $1; }
|
||||
binary_expression:
|
||||
expression "*" expression
|
||||
{
|
||||
$$ = new elna::boot::binary_expression(elna::boot::make_position(@2), $1, $3,
|
||||
elna::boot::binary_operator::multiplication);
|
||||
@ -402,7 +407,7 @@ expression:
|
||||
$$ = new elna::boot::binary_expression(elna::boot::make_position(@2), $1, $3,
|
||||
elna::boot::binary_operator::shift_right);
|
||||
}
|
||||
unary:
|
||||
unary_expression:
|
||||
"@" operand
|
||||
{
|
||||
$$ = new elna::boot::unary_expression(elna::boot::make_position(@1), $2,
|
||||
@ -418,7 +423,6 @@ unary:
|
||||
$$ = new elna::boot::unary_expression(elna::boot::make_position(@1), $2,
|
||||
elna::boot::unary_operator::minus);
|
||||
}
|
||||
| operand { $$ = $1; }
|
||||
expressions:
|
||||
expression "," expressions
|
||||
{
|
||||
@ -449,26 +453,30 @@ statement:
|
||||
| if_statement { $$ = $1; }
|
||||
| call_expression { $$ = $1; }
|
||||
statements:
|
||||
statement statements
|
||||
statement ";" statements
|
||||
{
|
||||
std::swap($$, $2);
|
||||
std::swap($$, $3);
|
||||
$$.emplace($$.cbegin(), $1);
|
||||
}
|
||||
| statement
|
||||
{
|
||||
$$.push_back($1);
|
||||
}
|
||||
| /* no statements */ {}
|
||||
statement_part:
|
||||
"begin" statements { std::swap($$, $2); }
|
||||
| {}
|
||||
field_declaration:
|
||||
IDENTIFIER ":" type_expression { $$ = std::make_pair($1, $3); }
|
||||
fields:
|
||||
field_declaration fields
|
||||
required_fields:
|
||||
field_declaration required_fields
|
||||
{
|
||||
std::swap($$, $2);
|
||||
$$.emplace($$.cbegin(), $1);
|
||||
}
|
||||
| field_declaration { $$.emplace_back($1); }
|
||||
optional_fields:
|
||||
fields { std::swap($$, $1); }
|
||||
required_fields { std::swap($$, $1); }
|
||||
| /* no fields */ {}
|
||||
type_expression:
|
||||
"[" INTEGER "]" type_expression
|
||||
@ -483,7 +491,7 @@ type_expression:
|
||||
{
|
||||
$$ = std::make_shared<elna::boot::record_type>(elna::boot::make_position(@1), std::move($2));
|
||||
}
|
||||
| "union" fields "end"
|
||||
| "union" required_fields "end"
|
||||
{
|
||||
$$ = std::make_shared<elna::boot::union_type>(elna::boot::make_position(@1), std::move($2));
|
||||
}
|
||||
@ -523,12 +531,11 @@ constant_definitions:
|
||||
constant_definition constant_definitions
|
||||
{
|
||||
std::swap($$, $2);
|
||||
$$.emplace($$.cbegin(), std::move($1));
|
||||
$$.insert($$.cbegin(), $1);
|
||||
}
|
||||
| constant_definition { $$.emplace_back(std::move($1)); }
|
||||
| /* no constant definitions */ {}
|
||||
constant_part:
|
||||
/* no constant definitions */ {}
|
||||
| "const" {}
|
||||
{}
|
||||
| "const" constant_definitions { std::swap($$, $2); }
|
||||
type_definition: identifier_definition "=" type_expression
|
||||
{
|
||||
@ -538,9 +545,9 @@ type_definitions:
|
||||
type_definition type_definitions
|
||||
{
|
||||
std::swap($$, $2);
|
||||
$$.emplace($$.cbegin(), std::move($1));
|
||||
$$.insert($$.cbegin(), $1);
|
||||
}
|
||||
| type_definition { $$.emplace_back(std::move($1)); }
|
||||
| type_definition { $$.push_back($1); }
|
||||
type_part:
|
||||
/* no type definitions */ {}
|
||||
| "type" {}
|
||||
|
Reference in New Issue
Block a user