Skip to content

🔧 My studies involving context-free grammar analysis. The analyzers were built using familiar tools such as YACC, Lex and Bison. Topics covered include token filtering, simple variable manipulation, and arrays.

License

melchisedech333/lex-yacc-experiments

Repository files navigation




Language: PT-BR

Here are my codes, studies and experiments in general, which I performed using the tools for context-free grammar analysis. They are lex, yacc and bison.

If my code has helped you, please consider sponsoring me 💙


📑 Table of Contents



🛠️ Instructions

Each directory is equivalent to a specific test. And to compile run the file compile-and-run.sh passing the directory name as a parameter.

./compile-and-run.sh "2 - filter tokens"

After compiling, just run the generated file with the name parsing, and type the input.

./parsing

For this example in question (using the 2 - filter tokens), a valid input could be:

10 20 30 A

For this input, the output will be:

type: INTEGER
token: 10

type: INTEGER
token: 20

type: INTEGER
token: 30

type: UNKNOWN
token: A

It is important to mention that within each directory there is a file called input.txt, which contain one (or more) possible example entries.


😃 Author

Sponsor: melchisedech333
Twitter: Melchisedech333
LinkedIn: Melchisedech Rex
Blog: melchisedech333.github.io


📜 License

BSD-3-Clause license



Remember to give me
a beautiful little star 🤩