- There are two types of parsers: top-down and bottom-up.
- The difference between top-down & bottom-up parsers is that the top-down parser starts with constructing the root node of the AST(Abstract Syntax Tree) and descends and the bottom-up does it the other way around.
- Recursive descent parsing, early parsing or predictive parsing are variations of top-down parsing.
- The parser that I wrote is a recursive descent parser.
- It is sometimes also called Pratt parser,
- It is "top-down operator precedence"
- Note: Expressions produce values, statements don't
let x = 5;
doesn't produce a value but5
produces a value 5return n;
is a statement it doesn't produces a valueadd(x,y)
is a function literal, it produces a value that it will return- It depends on the programming language and the choice its designers made, we are parsing for monkey programming language so fuction literals are expressions
-
Notifications
You must be signed in to change notification settings - Fork 0
gauravtak/monkey-interpreter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A simple interpreter for monkey programming language
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published