A simple lexical analyzer built using Flex, following the tutorial on https://www.youtube.com/watch?v=54bo1qaHAfk&t=517s
The lexical analyzer will tokenize the config.in file into tokens and myscanner.c will read the file and perform a basic syntax analysis with error handling.
Generate the lexical analyzer using lex
lex myscanner.l
Complie the program
gcc myscanner.c lex.yy.c -o myscanner
To test, you can provide input using stdin
./myscanner < config.in
The source code is implemented based on https://www.youtube.com/watch?v=54bo1qaHAfk&t=517s