home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / info / m4.info-1 (.txt) < prev    next >
GNU Info File  |  1994-12-22  |  51KB  |  1,061 lines

  1. This is Info file m4.info, produced by Makeinfo-1.55 from the input
  2. file m4.texinfo.
  3. START-INFO-DIR-ENTRY
  4. * m4: (m4).            A powerful macro processor.
  5. END-INFO-DIR-ENTRY
  6.    This file documents the GNU `m4' utility.
  7.    Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994 Free Software
  8. Foundation, Inc.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that
  14. the entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Foundation.
  20. File: m4.info,  Node: Top,  Next: Preliminaries,  Prev: (dir),  Up: (dir)
  21. GNU `m4'
  22. ********
  23.    GNU `m4' is an implementation of the traditional UNIX macro
  24. processor.  It is mostly SVR4 compatible, although it has some
  25. extensions (for example, handling more than 9 positional parameters to
  26. macros).  `m4' also has builtin functions for including files, running
  27. shell commands, doing arithmetic, etc.  Autoconf needs GNU `m4' for
  28. generating `configure' scripts, but not for running them.
  29.    GNU `m4' was originally written by Ren'e Seindal, with subsequent
  30. changes by Franc,ois Pinard and other volunteers on the Internet.  All
  31. names and email addresses can be found in the file `THANKS' from the
  32. GNU `m4' distribution.
  33.    This is release 1.4.  It is now to be considered stable, future
  34. releases are only meant to fix bugs, increase speed, or improve
  35. documentation.  However...
  36.    An experimental feature, which would improve `m4' usefulness, allows
  37. for changing the syntax for what is a "word" in `m4'.  You should use:
  38.      ./configure --enable-changeword
  39. if you want this feature compiled in.  The current implementation slows
  40. down `m4' considerably and is hardly acceptable.  So, it might go away,
  41. do not count on it yet.
  42. * Menu:
  43. * Preliminaries::               Introduction and preliminaries
  44. * Syntax::                      Lexical and syntactic conventions
  45. * Macros::                      How to invoke macros
  46. * Definitions::                 How to define new macros
  47. * Conditionals::                Conditionals and loops
  48. * Debugging::                   How to debug macros and input
  49. * Input Control::               Input control
  50. * File Inclusion::              File inclusion
  51. * Diversions::                  Diverting and undiverting output
  52. * Text handling::               Macros for text handling
  53. * Arithmetic::                  Macros for doing arithmetic
  54. * UNIX commands::               Macros for running UNIX commands
  55. * Miscellaneous::               Miscellaneous builtin macros
  56. * Frozen files::                Fast loading of frozen states
  57. * Compatibility::               Compatibility with other versions of m4
  58. * Concept index::               Index for many concepts
  59. * Macro index::                 Index for all m4 macros
  60.  -- The Detailed Node Listing --
  61. Introduction and preliminaries
  62. * Intro::                       Introduction to `m4'
  63. * History::                     Historical references
  64. * Invoking m4::                 Invoking `m4'
  65. * Bugs::                        Problems and bugs
  66. * Manual::                      Using this manual
  67. Lexical and syntactic conventions
  68. * Names::                       Macro names
  69. * Quoted strings::              Quoting input to m4
  70. * Other tokens::                Other kinds of input tokens
  71. * Comments::                    Comments in m4 input
  72. How to invoke macros
  73. * Invocation::                  Macro invocation
  74. * Inhibiting Invocation::       Preventing macro invocation
  75. * Macro Arguments::             Macro arguments
  76. * Quoting Arguments::           On Quoting Arguments to macros
  77. * Macro expansion::             Expanding macros
  78. How to define new macros
  79. * Define::                      Defining a new macro
  80. * Arguments::                   Arguments to macros
  81. * Pseudo Arguments::            Pseudo arguments to macros
  82. * Undefine::                    Deleting a macro
  83. * Defn::                        Renaming macros
  84. * Pushdef::                     Temporarily redefining macros
  85. * Indir::                       Indirect call of macros
  86. * Builtin::                     Indirect call of builtins
  87. Conditionals, loops and recursion
  88. * Ifdef::                       Testing if a macro is defined
  89. * Ifelse::                      If-else construct, or multibranch
  90. * Loops::                       Loops and recursion in m4
  91. How to debug macros and input
  92. * Dumpdef::                     Displaying macro definitions
  93. * Trace::                       Tracing macro calls
  94. * Debug Levels::                Controlling debugging output
  95. * Debug Output::                Saving debugging output
  96. Input control
  97. * Dnl::                         Deleting whitespace in input
  98. * Changequote::                 Changing the quote characters
  99. * Changecom::                   Changing the comment delimiters
  100. * Changeword::                  Changing the lexical structure of words
  101. * M4wrap::                      Saving input until end of input
  102. File inclusion
  103. * Include::                     Including named files
  104. * Search Path::                 Searching for include files
  105. Diverting and undiverting output
  106. * Divert::                      Diverting output
  107. * Undivert::                    Undiverting output
  108. * Divnum::                      Diversion numbers
  109. * Cleardiv::                    Discarding diverted text
  110. Macros for text handling
  111. * Len::                         Calculating length of strings
  112. * Index::                       Searching for substrings
  113. * Regexp::                      Searching for regular expressions
  114. * Substr::                      Extracting substrings
  115. * Translit::                    Translating characters
  116. * Patsubst::                    Substituting text by regular expression
  117. * Format::                      Formatting strings (printf-like)
  118. Macros for doing arithmetic
  119. * Incr::                        Decrement and increment operators
  120. * Eval::                        Evaluating integer expressions
  121. Running UNIX commands
  122. * Syscmd::                      Executing simple commands
  123. * Esyscmd::                     Reading the output of commands
  124. * Sysval::                      Exit codes
  125. * Maketemp::                    Making names for temporary files
  126. Miscellaneous builtin macros
  127. * Errprint::                    Printing error messages
  128. * M4exit::                      Exiting from m4
  129. Compatibility with other versions of `m4'
  130. * Extensions::                  Extensions in GNU m4
  131. * Incompatibilities::           Facilities in System V m4 not in GNU m4
  132. * Other Incompat::              Other incompatibilities
  133. File: m4.info,  Node: Preliminaries,  Next: Syntax,  Prev: Top,  Up: Top
  134. Introduction and preliminaries
  135. ******************************
  136.    This first chapter explains what is GNU `m4', where `m4' comes from,
  137. how to read and use this documentation, how to call the `m4' program
  138. and how to report bugs about it.  It concludes by giving tips for
  139. reading the remainder of the manual.
  140.    The following chapters then detail all the features of the `m4'
  141. language.
  142. * Menu:
  143. * Intro::                       Introduction to `m4'
  144. * History::                     Historical references
  145. * Invoking m4::                 Invoking `m4'
  146. * Bugs::                        Problems and bugs
  147. * Manual::                      Using this manual
  148. File: m4.info,  Node: Intro,  Next: History,  Prev: Preliminaries,  Up: Preliminaries
  149. Introduction to `m4'
  150. ====================
  151.    `m4' is a macro processor, in the sense that it copies its input to
  152. the output, expanding macros as it goes.  Macros are either builtin or
  153. user-defined, and can take any number of arguments.  Besides just doing
  154. macro expansion, `m4' has builtin functions for including named files,
  155. running UNIX commands, doing integer arithmetic, manipulating text in
  156. various ways, recursion, etc...  `m4' can be used either as a front-end
  157. to a compiler,