|
hoshi-lang dev
Yet another programming language
|
#include <IR.h>
Public Member Functions | |
| IRVariableTable ()=default | |
| yoi::indexT | createScope () |
| yoi::indexT | lookup (const yoi::wstr &name) |
| Look up a variable by name in the current scope. If the variable is not found in the current scope, look it up in the parent scope. | |
| std::shared_ptr< IRValueType > | get (yoi::indexT index) |
| std::shared_ptr< IRValueType > | operator[] (const yoi::wstr &name) |
| void | set (yoi::indexT index, const std::shared_ptr< IRValueType > &type) |
| yoi::indexT | put (const yoi::wstr &name, const std::shared_ptr< IRValueType > &type) |
| void | popScope () |
| yoi::wstr | to_string (yoi::indexT indent=0) |
| yoi::vec< std::shared_ptr< IRValueType > > & | getVariables () |
| std::map< yoi::indexT, yoi::wstr > & | getReversedVariableNameMap () |
| yoi::indexT | scopeIndex (yoi::indexT varIndex) |
Private Attributes | |
| yoi::vec< std::shared_ptr< IRValueType > > | variables |
| yoi::vec< std::map< yoi::wstr, yoi::indexT > > | variableNameIndexMap |
| std::map< yoi::indexT, yoi::indexT > | variableScopeMap |
| std::map< yoi::indexT, yoi::wstr > | reversedVariableNameMap |
|
default |
| yoi::indexT createScope | ( | ) |
Definition at line 848 of file IR.cpp.
Referenced by IRFunctionDefinition::IRFunctionDefinition().

| std::shared_ptr< IRValueType > get | ( | yoi::indexT | index | ) |
| std::map< yoi::indexT, yoi::wstr > & getReversedVariableNameMap | ( | ) |
| yoi::vec< std::shared_ptr< IRValueType > > & getVariables | ( | ) |
Definition at line 1024 of file IR.cpp.
Referenced by LLVMCodegen::generateFunction().

| yoi::indexT lookup | ( | const yoi::wstr & | name | ) |
Look up a variable by name in the current scope. If the variable is not found in the current scope, look it up in the parent scope.
| name | The name of the variable to look up. |
| std::runtime_error | panics if the variable is not found in any scope. |
Definition at line 839 of file IR.cpp.
References IRStructDefinition::name, and yoi::wstring2string().

| std::shared_ptr< IRValueType > operator[] | ( | const yoi::wstr & | name | ) |
Definition at line 871 of file IR.cpp.
References IRStructDefinition::name.
| yoi::indexT put | ( | const yoi::wstr & | name, |
| const std::shared_ptr< IRValueType > & | type | ||
| ) |
Definition at line 875 of file IR.cpp.
References IRStructDefinition::name.
Referenced by IRFunctionDefinition::IRFunctionDefinition().

| yoi::indexT scopeIndex | ( | yoi::indexT | varIndex | ) |
| void set | ( | yoi::indexT | index, |
| const std::shared_ptr< IRValueType > & | type | ||
| ) |
| yoi::wstr to_string | ( | yoi::indexT | indent = 0 | ) |
Definition at line 857 of file IR.cpp.
Referenced by IRFunctionDefinition::to_string().

|
private |
|
private |
|
private |
|
private |