4-variable-simplifier/expression/variable/new.c
2026-04-25 16:00:10 -04:00

27 lines
495 B
C

#include <debug.h>
#include "../new.h"
#include "inheritance.h"
#include "struct.h"
#include "new.h"
struct expression* new_variable_expression(
int cost,
struct string* name)
{
ENTER;
struct variable_expression* this =
(void*) new_expression(
/* inheritance: */ &variable_expression_inheritance,
/* cost: */ cost,
/* size: */ sizeof(*this));
this->name = inc_string(name);
EXIT;
return (void*) this;
}