diff options
| Commit | 12232668d931b0f3593807d2096a2c2f26844b0b (patch) | |
|---|---|---|
| Author | 2018-11-18 20:32:58 +0200 | |
| Committer | 2018-11-18 20:32:58 +0200 | |
| Files | eb05bfcde4de31a03ce033ed479db29c4b527bcc /JSImpl/src/ByteCodeGenerator.h | |
| IPL-12232668d931b0f3593807d2096a2c2f26844b0b.tar IPL-12232668d931b0f3593807d2096a2c2f26844b0b.tar.gz IPL-12232668d931b0f3593807d2096a2c2f26844b0b.zip | ||
| Parent | 5729bc0ea96fc0b944c243230910c537d692bcad (diff) | |
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.
1 files changed, 11 insertions, 1 deletions
| -rw-r--r-- | JSImpl/src/ByteCodeGenerator.h | 12 |
diff --git a/JSImpl/src/ByteCodeGenerator.h b/JSImpl/src/ByteCodeGenerator.h index a619603..4a1d521 100644 --- a/JSImpl/src/ByteCodeGenerator.h +++ b/JSImpl/src/ByteCodeGenerator.h @@ -2,5 +2,15 @@ #include "Expression.h" +struct ByteCodeGeneratorOptions +{ + enum OptimizationsType + { + None + }; + ByteCodeGeneratorOptions(OptimizationsType o = None, bool debug = false) : Optimisations(o), AddDebugInformation(debug) {} + OptimizationsType Optimisations; + bool AddDebugInformation; +}; -IPLString GenerateByteCode(ExpressionPtr program); +IPLString GenerateByteCode(ExpressionPtr program, const IPLString& source, const ByteCodeGeneratorOptions& options = ByteCodeGeneratorOptions()); |
