Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erikdelange/EXIN-The-Experimental-Interpreter
Define your own programming language and design your own interpreter! This one is written in C and executes a simple Basic/C/Python like programming language.
https://github.com/erikdelange/EXIN-The-Experimental-Interpreter
c ebnf interpreter programming-language
Last synced: 2 months ago
JSON representation
Define your own programming language and design your own interpreter! This one is written in C and executes a simple Basic/C/Python like programming language.
- Host: GitHub
- URL: https://github.com/erikdelange/EXIN-The-Experimental-Interpreter
- Owner: erikdelange
- Created: 2017-07-29T11:31:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-06T16:17:14.000Z (over 4 years ago)
- Last Synced: 2024-11-16T20:13:04.769Z (2 months ago)
- Topics: c, ebnf, interpreter, programming-language
- Language: C
- Homepage:
- Size: 2.42 MB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- AwesomeInterpreter - EXIN-The-Experimental-Interpreter
README
# EXIN - An Experimental Interpreter
**June 6, 2020
This repository has been superseded by [EXIN-AST](https://github.com/erikdelange/EXIN-AST-The-Experimental-Interpreter), and will not be developed any further. While still implementing the same language [EXIN-AST](https://github.com/erikdelange/EXIN-AST-The-Experimental-Interpreter) follows a more elegant design centered around an Abstract Syntax Tree.**
___
EXIN is an exercise in defining a programming language and writing an interpreter for it. Both are as simple as possible to make it easy to understand how the interpreter code is structured and to be able to add new features. The language resembles (as far as I know) Basic, C and Python. This is an example of EXIN code:
```
# Reverse string s
#
def reverse(s)
str new
int index = s.lenwhile index
index -= 1
new += s[index]return new
# First a short demo
#
str s2, s1 = "abracadabra"s2 = reverse(s1)
print -raw s1, " reversed is ", s2, 2 * "\n"
# Now let the user enter strings
#
do
input "Enter a string to reverse (empty line to end): " s1
if s1 == ""
break
print s1, "reversed is", reverse(s1)
while 1
```
The interpreter is written in C (version C99). The details of the language and the interpreter are explained in the documents listed below. EXIN is designed for fun and education (at least mine :) and you can do with it whatever you like.- [EXIN language reference](EXIN%20language%20reference.md)
- [EXIN software architecture](EXIN%20software%20architecture.md)
- [EXIN syntax diagram](EXIN%20syntax%20diagram.pdf)