Programming Utilities Guide
この本のみを検索
PDF 文書ファイルをダウンロードする

............................Contents


Preface
xv

1. lex
1
...Introduction 1
...Generating a Lexical Analyzer Program 2
...Writing lex Source 4
......The Fundamentals of lex Rules 4
...... Advanced lex Features 11
...C++ Mangled Symbols 22
...Using lex and yacc Together 23
...Automaton 26
...Summary of Source Format 27

2. yacc -- A Compiler Compiler
31
...Introduction 31
...Basic Specifications 34
......Actions 37
......Lexical Analysis 41
...Parser Operation 43
...Ambiguity and Conflicts 49
...Precedence 54
...Error Handling 59
...The yacc Environment 62
...Hints for Preparing Specifications 64
......Input Style 64
......Left Recursion 64
...C++ Mangled Symbols 66
......Lexical Tie-Ins 66
......Reserved Words 67
...Advanced Topics 67
......Simulating error and accept in Actions 67
......Accessing Values in Enclosing Rules 68
......Support for Arbitrary Value Types 69
......yacc Input Syntax 71
...Examples 75
......A Simple Example 75
......An Advanced Example 80

3. make Utility
93
...Overview 93
......Dependency Checking: make vs. Shell Scripts 94
......Writing a Simple Makefile 95
......Basic Use of Implicit Rules 98
......Processing Dependencies 99
......Null Rules 102
......Special Targets 103
......Unknown Targets 103
......Duplicate Targets 104
......Reserved make Words 104
......Running Commands Silently 105
......Automatic Retrieval of SCCS Files 106
......Passing Parameters: Simple make Macros 107
.......KEEP_STATE and Command Dependency Checking 109
.......KEEP_STATE and Hidden Dependencies . . . . . . . . . . . .
..................................................110
......Displaying Information About a make Run 112
...Using make to Compile Programs 114
......A Simple Makefile 114
......Using Predefined Macros 115
......Using Implicit Rules to Simplify a Makefile: Suffix Rules . 117
......When to Use Explicit Target Entries vs. Implicit Rules 118
......Implicit Rules and Dynamic Macros 119
......Adding Suffix Rules 122
......Pattern-Matching Rules:An Alternative to Suffix Rules 124
...Building Object Libraries 131
......Libraries, Members, and Symbols 131
......Library Members and Dependency Checking 132
...Using make to Maintain Libraries and Programs 133
......More about Macros 133
......Linking with System-Supplied Libraries 136
......Compiling Programs for Debugging and Profiling 137
......Compiling Debugging and Profiling Variants 139
......Maintaining Separate Program and Library Variants 140
......Maintaining a Directory of Header Files 145
......Compiling and Linking with Your Own Libraries 145
......Nested make Commands 146
......Passing Parameters to Nested make Commands 149
......Compiling Other Source Files 151
......Maintaining Shell Scripts with make and SCCS 154
......Running Tests with make 155
...Maintaining Software Projects 158
......Organizing a Project for Ease of Maintenance 158
......Building the Entire Project 161
......How to Maintain Directory Hierarchies with the Recursive
........Makefiles 162
......Recursive Targets 162
......How to Maintain a Large Library as a Hierarchy of
........Subsidiaries 164
......Reporting Hidden Dependencies to make 167
...make Enhancements Summary 167
......Default Makefile 167
......The State File .make.state 167
......Hidden-Dependency Checking 168
......Command-Dependency Checking 168
......Automatic Retrieval of SCCS Files 168
......Pattern-Matching Rules 168
......Pattern-Replacement Macro References 169
......New Options 171
......Support for C++ and Modula-2 171
......Naming Scheme for Predefined Macros 172
......New Special-Purpose Targets 172
......New Implicit lint Rule 173
......Macro Processing Changes 173
......Improved ar Library Support 175
......Target Groups 175
...Incompatibilities with Previous Versions 175
......New Meaning for -d Option 175
......Dynamic Macros 175
......Tilde Rules Not Supported 176
......Target Names Beginning with ./ are Treated as
........Local filenames 176

4. SCCS Source Code Control System
179
...Introduction 179
......The sccs Command 180
......The sccs create Command 180
......Basic sccs Subcommands 181
......Deltas and Versions 182
...sccs Subcommands 183
......Checking Files In and Out 183
......Incorporating Version-Dependent Information by Using
........ID Keywords 187
......Making Inquiries 188
......Deleting the Committed Changes 192
...Version Control for Binary Files 195
...Maintaining Source Directories 196
...Branches 198
......Using Branches 202
...Administering SCCS Files 203
......Interpreting Error Messages: sccs help . . . . . . . . . . . . . .
..................................................203
......Altering History File Defaults: sccs admin . . . . . . . . . . . .
..................................................203
......Validating the History File 204
......Restoring the History File 205
...Reference Tables 206

5. m4 Macro Processor
211
...Overview 211
...m4 Macros 213
......Defining Macros 213
......Quoting 214
......Arguments 216
......Arithmetic Built-Ins 219
......File Inclusion 220
......Diversions 220
......System Commands 221
......Conditional Testing 221
......String Manipulation 222
......Printing 224
......Summary of Built-In m4 Macros 225

A. A System V make
227
...Introduction 227
...Basic Features 228
...Description Files and Substitutions 233
......Comments 233
......Continuation Lines 233
......Macro Definitions 234
......General Form 234
......Dependency Information 234
......Executable Commands 235
......Extensions of $*, $@, and $< 236
......Output Translations 236
......Recursive Makefiles 237
......Suffixes and Transformation Rules 237
......Implicit Rules 238
......Archive Libraries 240
......Source Code Control System (SCCS) Filenames 243
......The Null Suffix 244
......Included Files 245
......SCCS Makefiles 245
......Dynamic-Dependency Parameters 245
...Command Usage 246
......The make Command 246
......Environment Variables 248
...Suggestions and Warnings 249
...Internal Rules 250
......Special Rules 251

Index
257