Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ranaaditya/lex-yacc-programs
first step towards crafting compilers
https://github.com/ranaaditya/lex-yacc-programs
bison bison-yacc compiler compiler-design flex hacktoberfest hacktoberfest2021 lex lexical-analyzer lexical-parser yaac
Last synced: 25 days ago
JSON representation
first step towards crafting compilers
- Host: GitHub
- URL: https://github.com/ranaaditya/lex-yacc-programs
- Owner: ranaaditya
- Created: 2020-10-24T09:02:48.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-31T17:25:09.000Z (about 3 years ago)
- Last Synced: 2024-05-01T12:22:32.132Z (6 months ago)
- Topics: bison, bison-yacc, compiler, compiler-design, flex, hacktoberfest, hacktoberfest2021, lex, lexical-analyzer, lexical-parser, yaac
- Language: Lex
- Homepage:
- Size: 20.5 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lex-Yacc-Programs
## Installation
```
sudo apt-get install flex
sudo apt-get install byacc
sudo apt-get install bison
```## Compile & Run
### `Lex` Programs
```bash
lex && gcc -lfl lex.yy.c && ./a.out < input.txt | sed '/^$/d'
```
We use `sed` to remove empty lines.### `Lex + Yacc` Programs
```bash
flex
bison -dy
gcc -lfl lex.yy.cc y.tab.c
./a.out < input.txt | sed '/^$/d'
```OR (in short)
```bash
flex && bison -dy && gcc -lfl lex.yy.cc y.tab.cc && ./a.out < input.txt | sed '/^$/d'
```We use `sed` to remove empty lines.
## Contribution
Feel free to raise issues and send PRs for new programms