![]() ![]() The grammar is described by production rules. The acronym “yacc” stands for “yet another compiler-compiler.” It converts a context-free grammar into a set of tables for a simple automaton that executes a parsing algorithm. Each rule has one or more associated C or RATFOR action statements that are performed when a token is matched. The lex specifications themselves are written as rules for matching tokens. This routine reads a stream of characters and matches sequences that identify tokens (such as series of digits that constitute numbers). ![]() The authors explain that lex reads a specification file containing regular expressions for pattern matching and generates a C or RATFOR routine that performs lexical analysis. Readers with access to the UUNET network can obtain these programs by direct file transfer other readers will need to type them from the listings supplied.Ĭhapter 1 introduces the concept of lexical analysis. ![]() This book provides a graded series of case studies and uses the programs for these case studies as a basis for instruction. If you are seeking a simple explanation of what lex and yacc can do, you should look somewhere else. A working knowledge of the C programming language is assumed. They have written this book to assist others with similar needs in using the strangely-named “lex” and “yacc” programming tools provided on most UNIX systems. Both authors have had a need for programming tools that could help them write compilers and interpreters. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |