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 💙
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.
Sponsor: melchisedech333
Twitter: Melchisedech333
LinkedIn: Melchisedech Rex
Blog: melchisedech333.github.io