diff options
Diffstat (limited to 'ExpressionCompiler.h')
-rw-r--r-- | ExpressionCompiler.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h index 471d8186..3567a914 100644 --- a/ExpressionCompiler.h +++ b/ExpressionCompiler.h @@ -59,6 +59,9 @@ public: /// Appends code for a State Variable accessor function static void appendStateVariableAccessor(CompilerContext& _context, VariableDeclaration const& _varDecl, bool _optimize = false); + /// Appends code for a State Variable Initialization function + static void appendStateVariableInitialization(CompilerContext& _context, VariableDeclaration const& _varDecl, bool _optimize = false); + private: explicit ExpressionCompiler(CompilerContext& _compilerContext, bool _optimize = false): m_optimize(_optimize), m_context(_compilerContext), m_currentLValue(m_context) {} @@ -111,6 +114,9 @@ private: /// Appends code for a State Variable accessor function void appendStateVariableAccessor(VariableDeclaration const& _varDecl); + /// Appends code for a State Variable initialization + void appendStateVariableInitialization(VariableDeclaration const& _varDecl); + /** * Helper class to store and retrieve lvalues to and from various locations. * All types except STACK store a reference in a slot on the stack, STACK just @@ -126,8 +132,13 @@ private: std::shared_ptr<Type const> const& _dataType, unsigned _baseStackOffset = 0); /// Set type according to the declaration and retrieve the reference. - /// @a _expression is the current expression + /// @a _identifier is the current identifier void fromIdentifier(Identifier const& _identifier, Declaration const& _declaration); + + /// Set type according to the declaration and retrieve the reference. + /// @a _declaration is the variable declaration + void fromStateVariable(VariableDeclaration const& _declaration); + void reset() { m_type = LValueType::None; m_dataType.reset(); m_baseStackOffset = 0; m_size = 0; } bool isValid() const { return m_type != LValueType::None; } |