2#include <gyoji-frontend.hpp>
3#include <gyoji-mir.hpp>
27 size_t get_basic_block_id()
const;
28 size_t get_location()
const;
30 size_t basic_block_id;
95 void dump(
int indent)
const;
103 const Scope *get_child()
const;
117 LocalVariable *local_variable;
129 class LocalVariable {
178 size_t _loop_break_blockid,
179 size_t _loop_continue_blockid
190 void dump(
int indent)
const;
199 bool is_loop()
const;
201 size_t get_loop_break_blockid()
const;
203 size_t get_loop_continue_blockid()
const;
214 size_t loop_break_blockid;
215 size_t loop_continue_blockid;
254 size_t get_block()
const;
255 bool is_resolved()
const;
314 size_t _loop_break_blockid,
315 size_t _loop_continue_blockid
342 size_t label_block_id,
349 void label_declare(
std::string label_name,
size_t label_blockid);
404 size_t get_loop_break_blockid()
const;
405 size_t get_loop_continue_blockid()
const;
439 const Scope *get_current()
const;
Compiler Context.
Definition gyoji-context.hpp:30
References a location in the source-file.
Definition source-reference.hpp:16
A named label inside a scope.
Definition function-scope.hpp:242
~FunctionLabel()
Move along, nothing to see here.
Definition function-scope.cpp:657
Location inside a specific basic block.
Definition function-scope.hpp:23
Primitive operation in a scope.
Definition function-scope.hpp:46
ScopeOperationType
Definition function-scope.hpp:49
@ GOTO_DEFINITION
Definition function-scope.hpp:61
@ CHILD_SCOPE
Definition function-scope.hpp:66
@ VAR_DECL
Definition function-scope.hpp:53
@ LABEL_DEFINITION
Definition function-scope.hpp:57
~ScopeOperation()
Move along, nothing to see here.
Definition function-scope.cpp:70
Tracks variables declared in each scope along with abels and goto statements in a highly simplified i...
Definition function-scope.hpp:290
void label_define(std::string label_name, const Gyoji::context::SourceReference &_source_ref)
Definition function-scope.cpp:274
void scope_push(const Gyoji::context::SourceReference &_source_ref)
Definition function-scope.cpp:228
std::vector< std::string > get_variables_to_unwind_for_label(std::string &label) const
bool add_variable(std::string variable_name, const Gyoji::mir::Type *mir_type, const Gyoji::context::SourceReference &source_ref)
Definition function-scope.cpp:412
std::vector< std::string > get_variables_to_unwind_for_root() const
Definition function-scope.cpp:368
std::vector< std::string > get_variables_to_unwind_for_scope() const
Definition function-scope.cpp:382
void scope_pop()
Definition function-scope.cpp:252
bool check(std::vector< std::pair< const ScopeOperation *, std::vector< const ScopeOperation * > > > &goto_fixups) const
Definition function-scope.cpp:523
bool is_in_loop() const
Definition function-scope.cpp:484
void scope_push_loop(const Gyoji::context::SourceReference &_source_ref, size_t _loop_break_blockid, size_t _loop_continue_blockid)
Definition function-scope.cpp:239
~ScopeTracker()
Move along, nothing to see here.
Definition function-scope.cpp:222
const LocalVariable * get_variable(std::string variable_name) const
Definition function-scope.cpp:352
Represents variable declarations, labels, and goto inside a lexical scope.
Definition function-scope.hpp:164
Scope()
Definition function-scope.cpp:147
~Scope()
Move along, nothing to see here.
Definition function-scope.cpp:165
const LocalVariable * get_variable(std::string name) const
Definition function-scope.cpp:182
This represents a type as declared in a translation unit.
Definition types.hpp:299
Converts the strongly-typed syntax tree into the MIR representation.
Definition function-resolver.hpp:23