- added 'null' token to the ZScript parser which is needed for null pointers.

- removed function declaration parser from DECORATE because it is not needed anymore.
- fixed: comparison operators could not handle names.
This commit is contained in:
Christoph Oelckers 2016-10-19 00:35:34 +02:00
commit 665d752686
7 changed files with 23 additions and 272 deletions

View file

@ -956,6 +956,13 @@ primary(X) ::= IDENTIFIER(A).
expr->Type = NULL;
X = expr;
}
primary(X) ::= NULL(T).
{
NEW_AST_NODE(Expression, expr, T);
expr->Operation = PEX_Null;
expr->Type = NULL;
X = expr;
}
primary(X) ::= SUPER(T).
{
NEW_AST_NODE(Expression, expr, T);

View file

@ -3,6 +3,7 @@ xx(Nil, )
xx(ID, )
xx(Super, )
xx(Null, )
xx(Self, )
xx(ConstValue, )
xx(FuncCall, )

View file

@ -153,6 +153,7 @@ static void InitTokenMap()
TOKENDEF (TK_Out, ZCC_OUT);
TOKENDEF (TK_Optional, ZCC_OPTIONAL);
TOKENDEF (TK_Super, ZCC_SUPER);
TOKENDEF (TK_Null, ZCC_NULL);
TOKENDEF (TK_Self, ZCC_SELF);
TOKENDEF ('~', ZCC_TILDE);
TOKENDEF ('!', ZCC_BANG);