home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 1
/
FFMCD01.bin
/
useful
/
info
/
m4.info-1
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1993-09-27
|
50KB
|
1,081 lines
This is Info file m4.info, produced by Makeinfo-1.47 from the input
file ./m4.texinfo.
This file documents the GNU m4 utility.
Copyright (C) 1989-1992 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 also
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.
File: m4.info, Node: Top, Next: Intro, Prev: (dir), Up: (dir)
This file documents GNU `m4', which is a simple macroprocessor. It
has been originally written by Rene' Seindal, from Denmark.
* Menu:
* Intro:: Introduction to m4
* Manual:: How to use this manual
* Bugs:: Reporting bugs in m4
* Invoking m4:: How to run the program
* 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 built-in macros
* Compatibility:: Compatibility with other versions of m4
* Concept Index:: Index for many concepts
* Macro Index:: Index for all m4 macros
-- The Detailed Node Listing --
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
* 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 built-ins
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
* 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 built-in 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: Intro, Next: Manual, Prev: Top, Up: Top
Introduction to `m4'
********************
`m4' is a macro processor, in the sense that in copies its input to
the output, expanding macros as it goes. Macros are either built-in or
user-defined, and can take any number of arguments. Besides just doing
macro expansion, `m4' has built-in 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, or as a macro
processor in its own right.
GNU `m4' is mostly compatible with the System V, Release 3 version,
except for some minor differences. *Note Compatibility:: for more
details.
File: m4.info, Node: Manual, Next: Bugs, Prev: Intro, Up: Top
Using this manual
*****************
This manual contains a number of examples of `m4' input and output,
and a simple notation is used to distinguish input, output and error
messages from `m4'. Examples are set out from the normal text, and
shown in a fixed width font, like this
This is an example of an example!
To distinguish input from output, all output from `m4' is prefixed
by the string `=>', and all error messages by the string `error-->'.
Example of input line
=>Output line from m4
error-->and an error message
As each of the predefined macros in `m4' is described, a prototype
call of the macro will be shown, giving descriptive names to the
arguments, e.g.,
regexp(STRING, REGEXP, opt REPLACEMENT)
All macro arguments in `m4' are strings, but some are given special
interpretation, e.g., as numbers, filenames, regular expressions, etc.
The `opt' before the third argument shows that this argument is
optional--if it is left out, it is taken to be the empty string. An
ellipsis (`...') last in the argument list indicates that any number of
arguments may follow.
File: m4.info, Node: Bugs, Next: Invoking m4, Prev: Manual, Up: Top
Problems and bugs
*****************
If you have problems with GNU `m4' or think you've found a bug,
please report it. Before reporting a bug, make sure you've actually
found a real bug. Carefully reread the documentation and see if it
really says you can do what you're trying to do. If it's not clear
whether you should be able to do something or not, report that too; it's
a bug in the documentation!
Before reporting a bug or trying to fix it yourself, try to isolate
it to the smallest possible input file that reproduces the problem.
Then send us the input file and the exact results `m4' gave you. Also
say what you expected to occur; this will help us decide whether the
problem was really in the documentation.
Once you've got a precise problem, send e-mail to (Internet)
`bug-gnu-utils@prep.ai.mit.edu' or (UUCP)
`mit-eddie!prep.ai.