Implement basics of a AST -> JS generator

Authored by Jan Marker <jan@jangmarker.de>.

Description

Implement basics of a AST -> JS generator

Summary:
For a list of currently supported language features,
please see the commits below.

It relates to T509

[Compiler] Start

[Compiler] Add basic integration test for JS Generator

[Compiler] Make first integration test work

  • assignments
  • post-/predecrements
  • post-/preincrements

[Compiler] Adopt integration name class to naming schema

[Compiler] Start work on functions

[Compiler] Refactor to use stack only

This allows for a more consequent concept.

  • add handling of lists for SourceElements and StatementList needed to have same pass level of integration tests as before the refactoring
  • change macros to reflect new concept
  • introduces a new error type InternalError this error is created if the stack was not correctly reduced, which should not happen in practice

[Compiler] Finish work on functions

[Compiler] Better logic for nullptr members

  • no more "" on stack
  • more expressive logic
  • generates code for var i correctly

[Compiler] Complete binary operations

[Compiler] Make function declarations more robust

  • handle multiple parameters more correctly
  • handle empty body correctly
  • move integration test for EmptyStatement in its own file

[Compiler] Make functoin declaration lists work

[Compiler] Make return statements work

[Compiler] Implement branching

[Compiler] Make switch statement work

[Compiler] Make test better readable and maintainable

Reviewers: akreuzkamp

Reviewed By: akreuzkamp

Differential Revision: https://phabricator.kde.org/D350

Details

Committed
Jan Marker <jan@jangmarker.de>Sep 30 2015, 8:31 PM
Reviewer
akreuzkamp
Differential Revision
D350: Implement basics of a AST -> JS generator
Parents
R18:7da4becf8d17: [Compiler] Fix coding-style
R18:836250207635: [Compiler] Add cmake install statement.
Branches
Unknown
Tags
Unknown
Jan Marker <jan@jangmarker.de> committed R18:2c9cc50c5bf4: Implement basics of a AST -> JS generator (authored by Jan Marker <jan@jangmarker.de>).Sep 30 2015, 8:31 PM

Merged Changes

CommitAuthorDetailsCommitted
7da4becf8d17Jan Marker
[Compiler] Fix coding-style 
Sep 30 2015
c3b668afb038D350Jan Marker
[Compiler] Fix issues pointed out in review 
Sep 15 2015
4dcf51cd0879D350Jan Marker
[Compiler] Make test better readable and maintainable 
Sep 11 2015
b989d2f3da7aD350Jan Marker
[Compiler] Make switch statement work 
Sep 11 2015
04f9bdb8b7f9D350Jan Marker
[Compiler] Implement branching 
Sep 11 2015
515f5250b489D350Jan Marker
[Compiler] Make return statements work 
Sep 11 2015
205f94a8ba3dD350Jan Marker
[Compiler] Make functoin declaration lists work 
Sep 11 2015
3ad75f37c4efD350Jan Marker
[Compiler] Make function declarations more robust 
Sep 11 2015
7e8c6e2ab824D350Jan Marker
[Compiler] Complete binary operations 
Sep 11 2015
669abd21a96dD350Jan Marker
[Compiler] Better logic for nullptr members 
Sep 11 2015
536ca0e634d0D350Jan Marker
[Compiler] Finish work on functions 
Sep 11 2015
34c82139fd7bD350Jan Marker
[Compiler] Refactor to use stack only 
Sep 11 2015
692a961c98a8D350Jan Marker
[Compiler] Start work on functions 
Sep 11 2015
f114acfbc75bD350Jan Marker
[Compiler] Adopt integration name class to naming schema 
Sep 11 2015
427509a5a46cD350Jan Marker
[Compiler] Make first integration test work 
Sep 11 2015
80163042f953D350Jan Marker
[Compiler] Add basic integration test for JS Generator 
Sep 11 2015
2ee5d2f5466aD350Jan Marker
[Compiler] Start implementation of AST -> JS generator 
Sep 11 2015