Add lexer and parser sources
This commit is contained in:
@ -83,7 +83,7 @@ namespace elna::boot
|
||||
}
|
||||
}
|
||||
|
||||
void declaration_visitor::visit(type_definition *definition)
|
||||
void declaration_visitor::visit(type_declaration *definition)
|
||||
{
|
||||
definition->body().accept(this);
|
||||
auto unresolved_declaration = this->unresolved.at(definition->identifier.identifier);
|
||||
@ -164,9 +164,12 @@ namespace elna::boot
|
||||
void declaration_visitor::visit(variable_declaration *declaration)
|
||||
{
|
||||
declaration->variable_type().accept(this);
|
||||
|
||||
this->symbols->enter(declaration->identifier.identifier,
|
||||
std::make_shared<variable_info>(this->current_type));
|
||||
}
|
||||
|
||||
void declaration_visitor::visit(constant_definition *definition)
|
||||
void declaration_visitor::visit(constant_declaration *definition)
|
||||
{
|
||||
definition->body().accept(this);
|
||||
|
||||
@ -174,7 +177,7 @@ namespace elna::boot
|
||||
std::make_shared<constant_info>(this->current_literal));
|
||||
}
|
||||
|
||||
void declaration_visitor::visit(procedure_definition *definition)
|
||||
void declaration_visitor::visit(procedure_declaration *definition)
|
||||
{
|
||||
std::shared_ptr<procedure_info> info = std::make_shared<procedure_info>(
|
||||
build_procedure(definition->heading()), definition->parameter_names);
|
||||
@ -184,7 +187,7 @@ namespace elna::boot
|
||||
|
||||
if (definition->body.has_value())
|
||||
{
|
||||
for (constant_definition *const constant : definition->body.value().constants())
|
||||
for (constant_declaration *const constant : definition->body.value().constants())
|
||||
{
|
||||
constant->accept(this);
|
||||
}
|
||||
@ -293,7 +296,7 @@ namespace elna::boot
|
||||
|
||||
void declaration_visitor::visit(unit *unit)
|
||||
{
|
||||
for (type_definition *const type : unit->types)
|
||||
for (type_declaration *const type : unit->types)
|
||||
{
|
||||
const std::string& type_identifier = type->identifier.identifier;
|
||||
|
||||
@ -303,7 +306,7 @@ namespace elna::boot
|
||||
add_error<already_declared_error>(type->identifier.identifier, this->input_file, type->position());
|
||||
}
|
||||
}
|
||||
for (type_definition *const type : unit->types)
|
||||
for (type_declaration *const type : unit->types)
|
||||
{
|
||||
type->accept(this);
|
||||
}
|
||||
@ -316,7 +319,7 @@ namespace elna::boot
|
||||
{
|
||||
variable->accept(this);
|
||||
}
|
||||
for (procedure_definition *const procedure : unit->procedures)
|
||||
for (procedure_declaration *const procedure : unit->procedures)
|
||||
{
|
||||
procedure->accept(this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user