415 |
PARSE_ERR(@1, (String("Variable assignment: No variable declared with name '") + name + "'.").c_str()); |
PARSE_ERR(@1, (String("Variable assignment: No variable declared with name '") + name + "'.").c_str()); |
416 |
else if (var->isConstExpr()) |
else if (var->isConstExpr()) |
417 |
PARSE_ERR(@2, (String("Variable assignment: Cannot modify const variable '") + name + "'.").c_str()); |
PARSE_ERR(@2, (String("Variable assignment: Cannot modify const variable '") + name + "'.").c_str()); |
418 |
|
else if (!var->isAssignable()) |
419 |
|
PARSE_ERR(@2, (String("Variable assignment: Variable '") + name + "' is not assignable.").c_str()); |
420 |
else if (var->exprType() != $3->exprType()) |
else if (var->exprType() != $3->exprType()) |
421 |
PARSE_ERR(@3, (String("Variable assignment: Variable '") + name + "' is of type " + typeStr(var->exprType()) + ", assignment is of type " + typeStr($3->exprType()) + " though.").c_str()); |
PARSE_ERR(@3, (String("Variable assignment: Variable '") + name + "' is of type " + typeStr(var->exprType()) + ", assignment is of type " + typeStr($3->exprType()) + " though.").c_str()); |
422 |
$$ = new Assignment(var, $3); |
$$ = new Assignment(var, $3); |