Tutorial on using lex and yacc

This tutorial introduces the basic concepts of lex and yacc and describes how you can use the programs to produce a simple desk calculator. New users should work through the tutorial to get a feel for how to use lex and yacc.

Those who are already familiar with the concepts of input analysis and interpretation may decide to skip this topic and go directly to Generating a lexical analyzer using lex and Generating a parser using yacc. These topics give full details of all aspects of the programs.

All documentation for lex and yacc assumes that you are familiar with the C programming language. To use the two programs, you need to be able to write C code.