0
votes

Can lex and yacc be used for making a programming language? and any recommendation for some books.

some references ?

So far i have found some like :

Build code with lex and yacc, Part 1: Introduction

1
Sure, just like if and else can be used to make an operating system. - user395760
Highly suggest you spend some time with a standard compiler book before you start down this course. - Ira Baxter

1 Answers

1
votes

Yes, you can certainly use lex and yacc to build a compiler/translator for a programming or scripting language. There are GNU variants of these tools, called flex and bison. John Levine's lex & yacc was for many years the gold standard for books about these tools. That book may be out of print, but I expect that the successor book, Flex & Bison, is just as good. To dig deeper into building a compiler, start with Aho et al., Compilers: Principles, Techniques, and Tools, 2/e. (Again, my recommendation is based on the first edition of this book.)