1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00
serenity/Libraries/LibJS
Stephan Unverwerth f3a9eba987 LibJS: Add Javascript lexer and parser
This adds a basic Javascript lexer and parser. It can parse the
currently existing demo programs. More work needs to be done to
turn it into a complete parser than can parse arbitrary JS Code.

The lexer outputs tokens with preceeding whitespace and comments
in the trivia member. This should allow us to generate the exact
source code by concatenating the generated tokens.

The parser is written in a way that it always returns a complete
syntax tree. Error conditions are represented as nodes in the
tree. This simplifies the code and allows it to be used as an
early stage parser, e.g for parsing JS documents in an IDE while
editing the source code.:
2020-03-12 09:25:49 +01:00
..
AST.cpp LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
AST.h LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
Cell.cpp LibJS: Support "hello friends".length 2020-03-11 19:00:26 +01:00
Cell.h LibJS: Add a convenience helper for visiting a JS::Value 2020-03-09 22:19:06 +01:00
Forward.h LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
Function.cpp LibJS: Start building a JavaScript engine for SerenityOS :^) 2020-03-07 19:42:11 +01:00
Function.h LibJS: Start building a JavaScript engine for SerenityOS :^) 2020-03-07 19:42:11 +01:00
Heap.cpp LibJS: Make the GC marking phase cycle-proof 2020-03-09 22:18:03 +01:00
Heap.h LibJS: Make the GC marking phase cycle-proof 2020-03-09 22:18:03 +01:00
HeapBlock.cpp LibJS: Add a basic mark&sweep garbage collector :^) 2020-03-08 19:23:58 +01:00
HeapBlock.h LibJS: Add a basic mark&sweep garbage collector :^) 2020-03-08 19:23:58 +01:00
Interpreter.cpp LibJS: Fix string roots not being collected 2020-03-12 07:50:49 +01:00
Interpreter.h LibJS: Allow the choice of a scope of declaration for a variable (#1408) 2020-03-11 20:09:20 +01:00
Lexer.cpp LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
Lexer.h LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
Makefile LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
Object.cpp LibJS: Add a convenience helper for visiting a JS::Value 2020-03-09 22:19:06 +01:00
Object.h LibJS: Make the GC marking phase cycle-proof 2020-03-09 22:18:03 +01:00
Parser.cpp LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
Parser.h LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
PrimitiveString.cpp LibJS: Add a new PrimitiveString class to hold GC-allocated strings 2020-03-11 19:00:22 +01:00
PrimitiveString.h LibJS: Add a new PrimitiveString class to hold GC-allocated strings 2020-03-11 19:00:22 +01:00
StringObject.cpp LibJS: Add StringObject, an Object wrapper around primitive strings 2020-03-11 19:00:26 +01:00
StringObject.h LibJS: Add StringObject, an Object wrapper around primitive strings 2020-03-11 19:00:26 +01:00
Token.cpp LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
Token.h LibJS: Add Javascript lexer and parser 2020-03-12 09:25:49 +01:00
Value.cpp LibJS: Support "hello friends".length 2020-03-11 19:00:26 +01:00
Value.h LibJS: Support "hello friends".length 2020-03-11 19:00:26 +01:00