Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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