Add the name getter for symbols

Change-Id: I270ff8202f106a70a8bb0c980955a1b7d431c455
This commit is contained in:
Felix Raimundo
2016-04-22 10:54:51 +02:00
parent 6f5cc68b75
commit 4a340aadb6
2 changed files with 5 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ class Symbol : public LeafExpression {
ExpressionLayout * createLayout() const override;
float approximate(Context& context) const override;
Type type() const override;
const char* name() const;
Expression * clone() const override;
bool valueEquals(const Expression * e) const override;
private:

View File

@@ -25,6 +25,10 @@ Expression::Type Symbol::type() const {
return Expression::Type::Symbol;
}
const char* Symbol::name() const {
return m_name;
}
ExpressionLayout * Symbol::createLayout() const {
size_t length = strlen(m_name);
return new StringLayout(m_name, length);