https://github.com/rgwohlbold/interpreter-ice
Java lexer, parser and interpreter for a c-style programming language
https://github.com/rgwohlbold/interpreter-ice
interpreter java lexer parser
Last synced: over 1 year ago
JSON representation
Java lexer, parser and interpreter for a c-style programming language
- Host: GitHub
- URL: https://github.com/rgwohlbold/interpreter-ice
- Owner: rgwohlbold
- Created: 2017-09-21T15:43:37.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-23T02:49:16.000Z (almost 9 years ago)
- Last Synced: 2025-01-23T06:32:07.733Z (over 1 year ago)
- Topics: interpreter, java, lexer, parser
- Language: Java
- Size: 12.7 KB
- Stars: 2
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
interpreter-ice
Description
This is a simple Java interpreter and parser, inspired by Ruslan Spivak's tutorials on writing a Pascal interpreter in Python.
The language syntax (currently named iCe) is just C without semicolons (who needs those anyway?). The interpreter currently supports arithmetic expressions and variable assignments and prints out all assigned variables.
Structure
The Program is divided into three parts:
- The Lexer, also called Tokenizer, reads in the Text and converts it into Tokens with defined TokenTypes.
- The Parser receives the Tokens from the Lexer and creates an Abstract Syntax Tree (AST)
- The Interpreter gets the Abstract Syntax Tree from the Parser and recursively "visits" every Node and executes the actions specified.
Links
Ruslan Spivak's tutorials