How to create a Lexer and Parser in C. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to create a Lexer and Parser in C.

I was busy doing BNF for my language, and I came across the need for Lexers and Parsers... Are you able to help with a simple example? Thanks!

25th May 2018, 7:06 PM
Edwin Pratt
Edwin Pratt - avatar
4 Answers
+ 3
for a lexer, try out the programs "lex" or "flex" for a parser, i suggest "yacc" or "bison"
25th May 2018, 9:08 PM
hinanawi
hinanawi - avatar
+ 1
Hi hinanawi! Thank you very much for your answer; I appreciate it a lot! May you explain how I can use it with C++?
25th May 2018, 9:12 PM
Edwin Pratt
Edwin Pratt - avatar
+ 1
Edwin Pratt i don't believe the programs listed support c++ (although a google search could prove me wrong), and if that's the case, you might need to look up programs that do
25th May 2018, 9:14 PM
hinanawi
hinanawi - avatar
+ 1
Thank you hinanawi. Will do.
25th May 2018, 9:15 PM
Edwin Pratt
Edwin Pratt - avatar