https://github.com/furuame/Pascal-Esque-Interpreter
P.E.I is a Pascal like interpreter implemented in C
https://github.com/furuame/Pascal-Esque-Interpreter
interpreter pascal
Last synced: 5 months ago
JSON representation
P.E.I is a Pascal like interpreter implemented in C
- Host: GitHub
- URL: https://github.com/furuame/Pascal-Esque-Interpreter
- Owner: furuame
- License: mit
- Created: 2018-02-28T15:22:41.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-25T09:41:11.000Z (about 7 years ago)
- Last Synced: 2024-05-18T21:40:33.709Z (11 months ago)
- Topics: interpreter, pascal
- Language: C
- Homepage:
- Size: 46.9 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AwesomeInterpreter - Pascal-Esque-Interpreter
README
# Pascal-Esque-Interpreter (P.E.I)
This is a simple Pascal-like interpreter referenced from [Ruslan's Blog](https://ruslanspivak.com).## Build
* ```$ make main```
* ```$ ./main test_program.ps```## Limits
* Number in the interpreter is handled with integer## Test Program to interpreter
```
PROGRAM test_program;
VAR
_a, b, c : INTEGER;
d, e, f : INTEGER;BEGIN
_a := 3;
b := 6;
c := _a + b;
{ This is comment. }
BEGIN
d := 5;
e := 9;
f := d + e + c;
END;
_a := _a + f + 3;
_a := _a div 2
END.
```## Result
```
_a: 14
b: 6
c: 9
d: 5
e: 9
f: 23
```