https://github.com/asynched/yacc-lex-language
A simple language with an interpreter using yacc/lex.
https://github.com/asynched/yacc-lex-language
compiler language lex yacc
Last synced: 3 days ago
JSON representation
A simple language with an interpreter using yacc/lex.
- Host: GitHub
- URL: https://github.com/asynched/yacc-lex-language
- Owner: asynched
- Created: 2022-06-04T12:28:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-04T13:16:04.000Z (over 3 years ago)
- Last Synced: 2025-06-09T19:50:00.942Z (4 months ago)
- Topics: compiler, language, lex, yacc
- Language: C
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yacc-lex-language
A simple language with an interpreter using yacc/lex.
## Building
### Requirements
- GNU/Make
- GCC
- Bison
- Flex### How to build?
To build the executable, run:
```sh
$ make build
```> This will generate a `build/` directory with the executable `lang.o`.
## Running the interpreter
To run the interpreter, type in your terminal:
```sh
$ build/lang.o
```This language only recognizes a few symbols and operations, such as add, subtract, print, etc.
- Adding
```
print 1 + 2;
```- Subtracting
```
print 2 - 1;
```- Multiplying
```
print 5 * 2;
```- Dividing
```
print 10 / 2;
```- Clearing the screen
```
clear;
```- Assignment
```
a = 10 + 5;
```- Exiting
```
exit;
```## Sources
- [Language tutorial](https://www.youtube.com/watch?v=__-wUHG2rfM)
- [Github Repository](https://github.com/jengelsma/yacc-tutorial)