home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
gnu
/
info
/
m4.info-1
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-12-22
|
51KB
|
1,061 lines
This is Info file m4.info, produced by Makeinfo-1.55 from the input
file m4.texinfo.
START-INFO-DIR-ENTRY
* m4: (m4). A powerful macro processor.
END-INFO-DIR-ENTRY
This file documents the GNU `m4' utility.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994 Free Software
Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Foundation.
File: m4.info, Node: Top, Next: Preliminaries, Prev: (dir), Up: (dir)
GNU `m4'
********
GNU `m4' is an implementation of the traditional UNIX macro
processor. It is mostly SVR4 compatible, although it has some
extensions (for example, handling more than 9 positional parameters to
macros). `m4' also has builtin functions for including files, running
shell commands, doing arithmetic, etc. Autoconf needs GNU `m4' for
generating `configure' scripts, but not for running them.
GNU `m4' was originally written by Ren'e Seindal, with subsequent
changes by Franc,ois Pinard and other volunteers on the Internet. All
names and email addresses can be found in the file `THANKS' from the
GNU `m4' distribution.
This is release 1.4. It is now to be considered stable, future
releases are only meant to fix bugs, increase speed, or improve
documentation. However...
An experimental feature, which would improve `m4' usefulness, allows
for changing the syntax for what is a "word" in `m4'. You should use:
./configure --enable-changeword
if you want this feature compiled in. The current implementation slows
down `m4' considerably and is hardly acceptable. So, it might go away,
do not count on it yet.
* Menu:
* Preliminaries:: Introduction and preliminaries
* Syntax:: Lexical and syntactic conventions
* Macros:: How to invoke macros
* Definitions:: How to define new macros
* Conditionals:: Conditionals and loops
* Debugging:: How to debug macros and input
* Input Control:: Input control
* File Inclusion:: File inclusion
* Diversions:: Diverting and undiverting output
* Text handling:: Macros for text handling
* Arithmetic:: Macros for doing arithmetic
* UNIX commands:: Macros for running UNIX commands
* Miscellaneous:: Miscellaneous builtin macros
* Frozen files:: Fast loading of frozen states
* Compatibility:: Compatibility with other versions of m4
* Concept index:: Index for many concepts
* Macro index:: Index for all m4 macros
-- The Detailed Node Listing --
Introduction and preliminaries
* Intro:: Introduction to `m4'
* History:: Historical references
* Invoking m4:: Invoking `m4'
* Bugs:: Problems and bugs
* Manual:: Using this manual
Lexical and syntactic conventions
* Names:: Macro names
* Quoted strings:: Quoting input to m4
* Other tokens:: Other kinds of input tokens
* Comments:: Comments in m4 input
How to invoke macros
* Invocation:: Macro invocation
* Inhibiting Invocation:: Preventing macro invocation
* Macro Arguments:: Macro arguments
* Quoting Arguments:: On Quoting Arguments to macros
* Macro expansion:: Expanding macros
How to define new macros
* Define:: Defining a new macro
* Arguments:: Arguments to macros
* Pseudo Arguments:: Pseudo arguments to macros
* Undefine:: Deleting a macro
* Defn:: Renaming macros
* Pushdef:: Temporarily redefining macros
* Indir:: Indirect call of macros
* Builtin:: Indirect call of builtins
Conditionals, loops and recursion
* Ifdef:: Testing if a macro is defined
* Ifelse:: If-else construct, or multibranch
* Loops:: Loops and recursion in m4
How to debug macros and input
* Dumpdef:: Displaying macro definitions
* Trace:: Tracing macro calls
* Debug Levels:: Controlling debugging output
* Debug Output:: Saving debugging output
Input control
* Dnl:: Deleting whitespace in input
* Changequote:: Changing the quote characters
* Changecom:: Changing the comment delimiters
* Changeword:: Changing the lexical structure of words
* M4wrap:: Saving input until end of input
File inclusion
* Include:: Including named files
* Search Path:: Searching for include files
Diverting and undiverting output
* Divert:: Diverting output
* Undivert:: Undiverting output
* Divnum:: Diversion numbers
* Cleardiv:: Discarding diverted text
Macros for text handling
* Len:: Calculating length of strings
* Index:: Searching for substrings
* Regexp:: Searching for regular expressions
* Substr:: Extracting substrings
* Translit:: Translating characters
* Patsubst:: Substituting text by regular expression
* Format:: Formatting strings (printf-like)
Macros for doing arithmetic
* Incr:: Decrement and increment operators
* Eval:: Evaluating integer expressions
Running UNIX commands
* Syscmd:: Executing simple commands
* Esyscmd:: Reading the output of commands
* Sysval:: Exit codes
* Maketemp:: Making names for temporary files
Miscellaneous builtin macros
* Errprint:: Printing error messages
* M4exit:: Exiting from m4
Compatibility with other versions of `m4'
* Extensions:: Extensions in GNU m4
* Incompatibilities:: Facilities in System V m4 not in GNU m4
* Other Incompat:: Other incompatibilities
File: m4.info, Node: Preliminaries, Next: Syntax, Prev: Top, Up: Top
Introduction and preliminaries
******************************
This first chapter explains what is GNU `m4', where `m4' comes from,
how to read and use this documentation, how to call the `m4' program
and how to report bugs about it. It concludes by giving tips for
reading the remainder of the manual.
The following chapters then detail all the features of the `m4'
language.
* Menu:
* Intro:: Introduction to `m4'
* History:: Historical references
* Invoking m4:: Invoking `m4'
* Bugs:: Problems and bugs
* Manual:: Using this manual
File: m4.info, Node: Intro, Next: History, Prev: Preliminaries, Up: Preliminaries
Introduction to `m4'
====================
`m4' is a macro processor, in the sense that it copies its input to
the output, expanding macros as it goes. Macros are either builtin or
user-defined, and can take any number of arguments. Besides just doing
macro expansion, `m4' has builtin functions for including named files,
running UNIX commands, doing integer arithmetic, manipulating text in
various ways, recursion, etc... `m4' can be used either as a front-end
to a compiler,