Documentation ¶
Overview ¶
Monkey is a scripting language implemented in golang, based upon the book "Write an Interpreter in Go", written by Thorsten Ball.
This implementation adds a number of tweaks, improvements, and new features. For example we support file-based I/O, regular expressions, the ternary operator, and more.
For full details please consult the project homepage https://github.com/skx/monkey/
Directories ¶
Path | Synopsis |
---|---|
config
|
|
enum
|
|
interpreter
|
|
ast
Package ast contains the definitions of the abstract-syntax tree that our parse produces, and our interpreter executes.
|
Package ast contains the definitions of the abstract-syntax tree that our parse produces, and our interpreter executes. |
evaluator
Package evaluator contains the core of our interpreter, which walks the AST produced by the parser and evaluates the user-submitted program.
|
Package evaluator contains the core of our interpreter, which walks the AST produced by the parser and evaluates the user-submitted program. |
lexer
Package lexer contains the code to lex input-programs into a stream of tokens, such that they may be parsed.
|
Package lexer contains the code to lex input-programs into a stream of tokens, such that they may be parsed. |
object
Package object contains our core-definitions for objects.
|
Package object contains our core-definitions for objects. |
parser
Package parser is used to parse input-programs written in monkey and convert them to an abstract-syntax tree.
|
Package parser is used to parse input-programs written in monkey and convert them to an abstract-syntax tree. |
token
Package token contains constants which are used when lexing a program written in the monkey language, as done by the parser.
|
Package token contains constants which are used when lexing a program written in the monkey language, as done by the parser. |
Click to show internal directories.
Click to hide internal directories.