Introduce emit statement.

This commit is contained in:
chriseth
2018-02-22 15:17:30 +01:00
parent 8fc9535d43
commit 388718b59f
17 changed files with 252 additions and 3 deletions
+21
View File
@@ -1196,6 +1196,27 @@ public:
virtual void accept(ASTConstVisitor& _visitor) const override;
};
/**
* The emit statement is used to emit events: emit EventName(arg1, ..., argn)
*/
class EmitStatement: public Statement
{
public:
explicit EmitStatement(
SourceLocation const& _location,
ASTPointer<ASTString> const& _docString,
ASTPointer<FunctionCall> const& _functionCall
):
Statement(_location, _docString), m_eventCall(_functionCall) {}
virtual void accept(ASTVisitor& _visitor) override;
virtual void accept(ASTConstVisitor& _visitor) const override;
FunctionCall const& eventCall() const { return *m_eventCall; }
private:
ASTPointer<FunctionCall> m_eventCall;
};
/**
* Definition of a variable as a statement inside a function. It requires a type name (which can
* also be "var") but the actual assignment can be missing.