lambda-calc-1/statement/assignment/new.c
2025-01-13 20:36:07 -06:00

31 lines
614 B
C

#include <debug.h>
#include <string/inc.h>
#include <expression/inc.h>
#include "../new.h"
#include "inheritance.h"
#include "struct.h"
#include "new.h"
struct statement* new_assignment_statement(
struct string* variable_name,
struct expression* expression)
{
ENTER;
struct assignment_statement* this = (void*) new_statement(
/* inheritance: */ &assignment_statement_inheritance,
/* alloc size: */ sizeof(*this));
this->variable_name = inc_string(variable_name);
this->expression = inc_expression(expression);
EXIT;
return (void*) this;
}