summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Forward.h
diff options
context:
space:
mode:
authorStephan Unverwerth <s.unverwerth@gmx.de>2020-03-11 19:27:43 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-12 09:25:49 +0100
commitf3a9eba987a8346dc2c13cedac3865eee38a10a4 (patch)
treeff51343e5d7ed95715aff7aed8131280f060c14b /Libraries/LibJS/Forward.h
parent17705d23fbe700d03bcf32a79bb63a2b074e44b9 (diff)
downloadserenity-f3a9eba987a8346dc2c13cedac3865eee38a10a4.zip
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.:
Diffstat (limited to 'Libraries/LibJS/Forward.h')
-rw-r--r--Libraries/LibJS/Forward.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibJS/Forward.h b/Libraries/LibJS/Forward.h
index 0af451f63e..4f38acf973 100644
--- a/Libraries/LibJS/Forward.h
+++ b/Libraries/LibJS/Forward.h
@@ -30,6 +30,7 @@ namespace JS {
class ASTNode;
class Cell;
+class Expression;
class Heap;
class HeapBlock;
class Interpreter;