This compiler design and implementation site aims to provide book reviews and free ebook on compiler design handbook, advanced compiler design, modern compiler design, compiler design tools like lex, yaac, flex, Automata techniques and practical design using c++.

How to Write a Simple Parser

by Ashim Gupta
This is a simple tutorial which gives certain simple yet necessary steps required to write a Parser. It won't cover too much details about Programming Languages constructs.The Compiler Design Tools used in this tutorial are LEX (Lexical Analysis) YACC (Yet another Compiler Compiler).
Certain Basic Concepts and Definitions:
What is a Parser ?
A Parser for a Grammar is a program which takes in the Language string as it's input and produces either a corresponding Parse tree or an Error.
What is the Syntax of a Language?
The Rules which tells whether a string is a valid Program or not are called the Syntax.
What is the Semantics of a Language?
The Rules which gives meaning to programs are called the Semantics of a Language.......

Followers