Contents
Contents .......................................................................................................................................... 2
Preface ............................................................................................................................................ 3
Introduction...................................................................................................................................... 4
Lex................................................................................................................................................... 6
Theory.......................................................................................................................................... 6
Practice ........................................................................................................................................ 7
Yacc............................................................................................................................................... 12
Theory........................................................................................................................................ 12
Practice, Part I............................................................................................................................ 13
Practice, Part II........................................................................................................................... 16
Calculator....................................................................................................................................... 19
Description ................................................................................................................................. 19
Include File................................................................................................................................. 22
Lex Input .................................................................................................................................... 23
Yacc Input .................................................................................................................................. 24
Interpreter................................................................................................................................... 27
Compiler..................................................................................................................................... 28
Graph ......................................................................................................................................... 30
More Lex........................................................................................................................................ 34
Strings........................................................................................................................................ 34
Reserved Words ........................................................................................................................ 35
Debugging Lex........................................................................................................................... 35
More Yacc...................................................................................................................................... 36
Recursion................................................................................................................................... 36
If-Else Ambiguity ........................................................................................................................ 36
Error Messages.......................................................................................................................... 37
Inherited Attributes..................................................................................................................... 38
Embedded Actions..................................................................................................................... 38
Debugging Yacc......................................................................................................................... 39
Bibliography................................................................................................................................... 40
2
评论0