Kurdeks / jbcc

C compiler written in cpp
4 stars 0 forks source link

Research parser generator #3

Closed jkurdek closed 1 hour ago

jkurdek commented 1 month ago

Do initial research on parser generators. Look at https://www.gnu.org/software/bison/

Willu12 commented 1 month ago

Parsing with bison:

Willu12 commented 1 month ago

useful link

https://www.progtools.org/compilers/tutorials/cxx_and_bison/cxx_and_bison.html

jkurdek commented 1 month ago

Using existing parse.y could be a good idea. With the once you posted we do not need to use separate lexer as bison will do the job of the both of them.

Alternatively we can use both flex and bison. Those two should do the job: https://www.quut.com/c/ANSI-C-grammar-y-2011.html https://www.quut.com/c/ANSI-C-grammar-l-2011.html