Implement while loops
This commit is contained in:
@ -8,6 +8,12 @@
|
||||
|
||||
#include "elna/source/result.h"
|
||||
|
||||
location_t elna_gcc_location(const elna::source::position *position);
|
||||
namespace elna
|
||||
{
|
||||
namespace gcc
|
||||
{
|
||||
location_t get_location(const elna::source::position *position);
|
||||
|
||||
const char *elna_gcc_print_type(tree type);
|
||||
const char *print_type(tree type);
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,9 @@ namespace gcc
|
||||
tree current_statements{ NULL_TREE };
|
||||
tree current_expression{ NULL_TREE };
|
||||
std::unordered_map<std::string, tree> symbol_map;
|
||||
tree main_fndecl{ NULL_TREE };
|
||||
|
||||
tree build_label_decl (const char *name, location_t loc);
|
||||
|
||||
public:
|
||||
void visit(source::program *program) override;
|
||||
@ -30,6 +33,8 @@ namespace gcc
|
||||
void visit(source::declaration *declaration) override;
|
||||
void visit(source::variable_expression *expression) override;
|
||||
void visit(source::assign_statement *statement) override;
|
||||
void visit(source::if_statement *statement) override;
|
||||
void visit(source::while_statement *statement) override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -486,5 +486,7 @@ namespace source
|
||||
expression& operand();
|
||||
unary_operator operation() const noexcept;
|
||||
};
|
||||
|
||||
const char *print_binary_operator(const binary_operator operation);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user