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 ?
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?
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.......