Skip to content

Latest commit

 

History

History
13 lines (13 loc) · 955 Bytes

README.md

File metadata and controls

13 lines (13 loc) · 955 Bytes

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:
  1. The Lexer, also called Tokenizer, reads in the Text and converts it into Tokens with defined TokenTypes.
  2. The Parser receives the Tokens from the Lexer and creates an Abstract Syntax Tree (AST)
  3. 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