From 12232668d931b0f3593807d2096a2c2f26844b0b Mon Sep 17 00:00:00 2001 From: Martin Dobrev Date: Sun, 18 Nov 2018 20:32:58 +0200 Subject: Code generation improvements (#56) * Implement code generation for some unary expressions Implement debug code augmentation. Now part of expresions have source location. Extend Tokens with Column information. Refactor byte code generation. Add options for byte code generator. * Fix linux build * Little refactoring in byte code generation * Fix couple bugs in byte code generation and add some tests. * Fix some linux warnings. --- JSImpl/src/Expression.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'JSImpl/src/Expression.h') diff --git a/JSImpl/src/Expression.h b/JSImpl/src/Expression.h index 4d45cc3..3fa7b90 100644 --- a/JSImpl/src/Expression.h +++ b/JSImpl/src/Expression.h @@ -8,8 +8,15 @@ class Expression : public IPLEnableShared { public: + Expression() : m_Line((unsigned)-1), m_Column((unsigned)-1) {} virtual ~Expression() {} virtual void Accept(ExpressionVisitor& v) = 0; + unsigned GetLine() { return m_Line; }; + unsigned GetColumn() { return m_Column; }; + void SetLocation(unsigned l, unsigned c) { m_Line = l; m_Column = c; }; + private: + unsigned m_Line = 0; + unsigned m_Column = 0; }; #define EXPAND_ARGUMENT(type, name, def)\ -- cgit v1.3.1-23-gd82d