Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Boktraskare/traskare
Interpreter
https://github.com/Boktraskare/traskare
Last synced: 2 months ago
JSON representation
Interpreter
- Host: GitHub
- URL: https://github.com/Boktraskare/traskare
- Owner: Boktraskare
- Created: 2017-06-20T20:02:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-14T16:40:36.000Z (over 7 years ago)
- Last Synced: 2024-04-24T16:41:49.962Z (9 months ago)
- Language: C
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
- AwesomeInterpreter - traskare
README
This is a description of the traskare code. This is written for my own learning
purposes and might be (probably is) incorrect on many parts of the theory of
compilers and interpreters.* Traskare
** Scanner
** Parser
*** Overview
The parser is a standard recursive descent parser.*** Input
The input to the parser is obscured by the fact that tokens are scanned as the
parser asks for them. initParser() will prime the parser by scanning the source
and load the first token. After the first token is scanned, a call to parse() will
kick off the whole scanning process, during which the parser requests tokens from
the scanner continuously. The scanner will scan the source and produce tokens "on
demand", but this is transparent to the parser.*** Output
In case the parsing was succesful the output is an abstract syntax tree. If an
error flag was set during parsing, the produced tree is not fit for evaluation.
This difference is communicated with the error boolean in the returned structure.In case the error boolean is set, the tree will itself contain nodes wrapping the
errors produced during parsing. To report these errors a simple traversal will do.