Dan Klishch
ff44aea917
JSSpecCompiler: Add control flow building pass
2023-12-14 09:06:05 -07:00
Dan Klishch
dbd624e875
JSSpecCompiler: Allow dumping AST after specified passes
2023-12-07 10:13:21 -07:00
Dan Klishch
6ed069ea8d
JSSpecCompiler: Provide an adequate command line interface
2023-10-26 15:45:31 -06:00
Dan Klishch
867ce0df52
JSSpecCompiler: Move passes to Passes subdirectory of Compiler/
2023-10-26 15:45:31 -06:00
Dan Klishch
61fa00d46c
JSSpecCompiler: Refactor CompilerPass
to accept TranslationUnitRef
2023-10-26 15:45:31 -06:00
Dan Klishch
567b1f6e7c
JSSpecCompiler: Adopt more C++ terminology
...
Let's not use strange names like `ExecutionContext`, which nobody will
understand in the future.
2023-10-02 21:15:08 +02:00
Dan Klishch
81519975c5
JSSpecCompiler: Add reference resolving pass
...
It replaces UnresolvedReference with Variable, FunctionPointer, or
SlotName nodes. Also, it gathers all variable names from their
declarations.
2023-09-17 16:04:42 -06:00
Dan Klishch
4c4e1e1aed
JSSpecCompiler: Add if branch merging pass
...
It merges standalone IfBranch/ElseIfBranch nodes into IfElseIfChain
nodes. This will ease CFG generation later.
2023-09-09 11:20:43 -06:00
Dan Klishch
72794e7843
JSSpecCompiler: Add function call canonicalization pass
...
It simplifies ladders of BinaryOperators nodes in the function call
arguments into nice and neat FunctionCall node. Ladders initially appear
since I do not want to complicate expression parser, so it interprets
`f(a, b, c, d)` as `f "function_call_operator" (a, (b, (c, d))))`.
2023-09-09 11:20:43 -06:00
Dan Klishch
cd8f4aaa7d
JSSpecCompiler: Introduce Function and ExecutionContext classes
...
Currently, they are not extremely useful, but the plan is to store
all function-local state in JSSpecCompiler::Function and all
"translation unit" state in ExecutionContext.
2023-09-02 19:57:06 +02:00
Dan Klishch
66f4cdba85
JSSpecCompiler: Make it compile and dump AST created from stdin input
2023-08-31 11:00:31 +02:00