Add pointer and field access nodes
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
%token <std::string> STRING "string"
|
||||
%token <bool> BOOLEAN
|
||||
%token IF WHILE DO
|
||||
%token CONST VAR PROCEDURE ARRAY OF TYPE
|
||||
%token CONST VAR PROCEDURE ARRAY OF TYPE RECORD
|
||||
%token BEGIN_BLOCK END_BLOCK
|
||||
%token LEFT_PAREN RIGHT_PAREN LEFT_SQUARE RIGHT_SQUARE SEMICOLON DOT COMMA
|
||||
%token GREATER_EQUAL LESS_EQUAL LESS_THAN GREATER_THAN NOT_EQUAL EQUALS
|
||||
@@ -315,14 +315,17 @@ type_expression:
|
||||
{
|
||||
$$ = new elna::source::array_type_expression(elna::source::make_position(@1), $4, $2);
|
||||
}
|
||||
| HAT type_expression
|
||||
{
|
||||
$$ = new elna::source::pointer_type_expression(elna::source::make_position(@1), $2);
|
||||
}
|
||||
| IDENTIFIER
|
||||
{
|
||||
$$ = new elna::source::basic_type_expression(elna::source::make_position(@1), $1);
|
||||
}
|
||||
variable_declaration: IDENTIFIER COLON type_expression
|
||||
{
|
||||
$$ = new elna::source::declaration(elna::source::make_position(@1),
|
||||
$1, $3);
|
||||
$$ = new elna::source::declaration(elna::source::make_position(@1), $1, $3);
|
||||
};
|
||||
variable_declarations:
|
||||
variable_declaration COMMA variable_declarations
|
||||
|
||||
Reference in New Issue
Block a user