aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmData.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-03-02 05:56:39 +0800
committerchriseth <c@ethdev.com>2016-03-30 08:37:00 +0800
commitf0494307232e52dcc268f5f32d26cc89d7e98e3a (patch)
tree5a03eae3515eb50d67388e7d7d1193d016baaddf /libsolidity/inlineasm/AsmData.h
parent949b00ed591303c531ed8fa73087b710b7a554de (diff)
downloaddexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.tar
dexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.tar.gz
dexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.tar.bz2
dexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.tar.lz
dexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.tar.xz
dexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.tar.zst
dexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.zip
Code generation (missing external access and source locations).
Diffstat (limited to 'libsolidity/inlineasm/AsmData.h')
-rw-r--r--libsolidity/inlineasm/AsmData.h60
1 files changed, 27 insertions, 33 deletions
diff --git a/libsolidity/inlineasm/AsmData.h b/libsolidity/inlineasm/AsmData.h
index a38a9d36..0361a4c2 100644
--- a/libsolidity/inlineasm/AsmData.h
+++ b/libsolidity/inlineasm/AsmData.h
@@ -29,42 +29,36 @@ namespace dev
{
namespace solidity
{
-
-class AsmData
+namespace assembly
{
-public:
- /// Direct EVM instruction (except PUSHi and JUMPDEST)
- struct Instruction { eth::Instruction instruction; };
- /// Literal number or string (up to 32 bytes)
- struct Literal { bool isNumber; std::string value; };
- /// External / internal identifier or label reference
- struct Identifier { std::string name; };
- struct FunctionalInstruction;
- /// Jump label ("name:")
- struct Label { std::string name; };
- /// Assignemnt (":= x", moves stack top into x, potentially multiple slots)
- struct Assignment { Identifier variableName; };
- struct FunctionalAssignment;
- struct VariableDeclaration;
- struct Block;
- using Statement = boost::variant<Instruction, Literal, Label, Assignment, Identifier, FunctionalAssignment, FunctionalInstruction, VariableDeclaration, Block>;
- /// Functional assignment ("x := mload(20)", expects push-1-expression on the right hand
- /// side and requires x to occupy exactly one stack slot.
- struct FunctionalAssignment { Identifier variableName; std::shared_ptr<Statement> value; };
- /// Functional instruction, e.g. "mul(mload(20), add(2, x))"
- struct FunctionalInstruction { Instruction instruction; std::vector<Statement> arguments; };
- /// Block-scope variable declaration ("let x := mload(20)"), non-hoisted
- struct VariableDeclaration { std::string name; std::shared_ptr<Statement> value; };
- /// Block that creates a scope (frees declared stack variables)
- struct Block { std::vector<Statement> statements; };
-
- AsmData(Block&& _statements): m_statements(_statements) {}
- Block const& statements() const { return m_statements; }
+/// What follows are the AST nodes for assembly.
-private:
- Block m_statements;
-};
+/// Direct EVM instruction (except PUSHi and JUMPDEST)
+struct Instruction { eth::Instruction instruction; };
+/// Literal number or string (up to 32 bytes)
+struct Literal { bool isNumber; std::string value; };
+/// External / internal identifier or label reference
+struct Identifier { std::string name; };
+struct FunctionalInstruction;
+/// Jump label ("name:")
+struct Label { std::string name; };
+/// Assignemnt (":= x", moves stack top into x, potentially multiple slots)
+struct Assignment { Identifier variableName; };
+struct FunctionalAssignment;
+struct VariableDeclaration;
+struct Block;
+using Statement = boost::variant<Instruction, Literal, Label, Assignment, Identifier, FunctionalAssignment, FunctionalInstruction, VariableDeclaration, Block>;
+/// Functional assignment ("x := mload(20)", expects push-1-expression on the right hand
+/// side and requires x to occupy exactly one stack slot.
+struct FunctionalAssignment { Identifier variableName; std::shared_ptr<Statement> value; };
+/// Functional instruction, e.g. "mul(mload(20), add(2, x))"
+struct FunctionalInstruction { Instruction instruction; std::vector<Statement> arguments; };
+/// Block-scope variable declaration ("let x := mload(20)"), non-hoisted
+struct VariableDeclaration { std::string name; std::shared_ptr<Statement> value; };
+/// Block that creates a scope (frees declared stack variables)
+struct Block { std::vector<Statement> statements; };
}
}
+}