Make type_expression abstract
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
%token IF WHILE DO
|
||||
%token CONST VAR PROCEDURE
|
||||
%token BEGIN_BLOCK END_BLOCK
|
||||
%token LEFT_PAREN RIGHT_PAREN SEMICOLON DOT COMMA
|
||||
%token LEFT_PAREN RIGHT_PAREN LEFT_SQUARE RIGHT_SQUARE SEMICOLON DOT COMMA
|
||||
%token GREATER_EQUAL LESS_EQUAL LESS_THAN GREATER_THAN NOT_EQUAL EQUALS
|
||||
%token PLUS MINUS MULTIPLICATION DIVISION
|
||||
%token ASSIGNMENT COLON HAT AT
|
||||
@@ -83,7 +83,7 @@
|
||||
%type <std::unique_ptr<elna::source::declaration>> variable_declaration;
|
||||
%type <std::vector<std::unique_ptr<elna::source::declaration>>> variable_declarations variable_declaration_part
|
||||
formal_parameter_list;
|
||||
%type <std::unique_ptr<elna::source::type_expression>> type_expression;
|
||||
%type <std::unique_ptr<elna::source::basic_type_expression>> type_expression;
|
||||
%type <std::unique_ptr<elna::source::expression>> expression pointer summand factor address comparand;
|
||||
%type <std::vector<std::unique_ptr<elna::source::expression>>> expressions actual_parameter_list;
|
||||
%type <std::unique_ptr<elna::source::variable_expression>> variable_expression;
|
||||
@@ -299,13 +299,9 @@ optional_statements:
|
||||
statements { std::swap($$, $1); }
|
||||
| /* no statements */ {}
|
||||
type_expression:
|
||||
HAT IDENTIFIER
|
||||
IDENTIFIER
|
||||
{
|
||||
$$ = std::make_unique<elna::source::type_expression>(elna::source::make_position(@1), $2, true);
|
||||
}
|
||||
| IDENTIFIER
|
||||
{
|
||||
$$ = std::make_unique<elna::source::type_expression>(elna::source::make_position(@1), $1, false);
|
||||
$$ = std::make_unique<elna::source::basic_type_expression>(elna::source::make_position(@1), $1);
|
||||
}
|
||||
variable_declaration: IDENTIFIER COLON type_expression
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user