Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 20 insertions, 1 deletions
-rw-r--r--website/content/slides/01_dragons/_index.md21
diff --git a/website/content/slides/01_dragons/_index.md b/website/content/slides/01_dragons/_index.md
index 52ecf91..7892a65 100644
--- a/website/content/slides/01_dragons/_index.md
+++ b/website/content/slides/01_dragons/_index.md
@@ -197,7 +197,26 @@ LR(n) and LALR(n) are family of parsing algorithms for CFG
---
###### AST
-# TODO: use JavaScript AST dumper
+https://esprima.org/demo/parse.html?code=function%20answer()%20%7B%0A%20%20%20%20return%206%20*%207%3B%0A%7D
+
+ {
+ "type": "FunctionDeclaration",
+ "id": { "type": "Identifier", "name": "answer" },
+ "body": {
+ "type": "BlockStatement",
+ "body": [
+ {
+ "type": "ReturnStatement",
+ "argument": {
+ "type": "BinaryExpression",
+ "operator": "*",
+ "left": { "type": "Literal", "value": 6 },
+ "right": { "type": "Literal", "value": 7 }
+ }
+ }
+ ]
+ },
+ }
---
### Middle