Commit 6251188c by Zack Weinberg

cpp.texi: Minor update.

1999-06-14   Zack Weinberg   <zack@rabi.columbia.edu>
	* cpp.texi: Minor update.
	* cpp.1: Regenerate from cpp.texi, using...
	* contrib/texi2pod.pl: ...this (new file) plus some hand tweaks.

From-SVN: r27525
parent 00af55a2
#! /usr/bin/perl -w
# This does trivial (and I mean _trivial_) conversion of Texinfo
# markup to Perl POD format. It's intended to be used to extract
# something suitable for a manpage from a Texinfo document.
$in = $ARGV[0];
$out = "x";
die "usage: $0 infile outfile\n" unless defined $in && defined $out;
close STDIN;
open(IN,$in);
$output = 0;
$ignore = 0;
%sects = ();
$section = "";
@icstack = ();
@endwstack = ();
$shift = "";
while(<IN>)
{
chomp;
/^\@end ignore/ and $ignore = 0, next;
next if $ignore;
/^\@c man begin ([A-Z]+)/ and $sect = $1, $output = 1, next;
/^\@c man end/ and do {
$_ = $section;
s/</&lt;/g;
s/>/&gt;/g;
s/\@(?:dfn|var|emph|cite)\{([^\}]*)\}/I<$1>/g;
s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g;
s/\@(?:samp|strong|key)\{([^\}]*)\}/B<$1>/g;
s/\@file\{([^\}]*)\}/F<$1>/g;
s/\@(?:url|email)\{([^\}]*)\}/E<lt>C<$1>E<rt>/g;
s/\@[a-z]?ref\{(?:[^\}]*)\}.?//g;
s/\(\@p[a-z]?ref\{(?:[^\}]*)\}\).?//g;
s/\@copyright\{\}//g;
s/\@noindent\s*//g;
s/\@refill//g;
s/\@\././g;
s/&lt;/E<lt>/g;
s/&gt;/E<gt>/g;
s/&LT;/</g;
s/&GT;/>/g;
$sects{$sect} = $_;
$section = "";
$output = 0;
next;
};
/^\@(c|[a-z]+index)\b/ and next;
/^\@setfilename\s+([^.]+)/ and $fn = $1, next;
/^\@settitle\s+([^.]+)/ and $tl = $1, next;
next unless $output;
/^\@ignore/ and $ignore = 1, next;
/^\@itemize (\@[a-z]+)/ and do {
push @endwstack, $endw;
push @icstack, $ic;
$ic = $1;
$ic =~ s/\@bullet/*/;
$ic =~ s/\@minus/-/;
$_ = "\n=over 4\n";
$endw = "itemize";
};
/^\@enumerate\s+([A-Z0-9]+)/ and do {
push @endwstack, $endw;
push @icstack, $ic;
$ic = $1 . ".";
$_ = "\n=over 4\n";
$endw = "enumerate";
};
/^\@table\s+(\@[a-z]+)/ and do {
push @endwstack, $endw;
push @icstack, $ic;
$ic = $1;
$ic =~ s/\@(?:samp|strong|key)/B/;
$ic =~ s/\@(?:code|kbd)/C/;
$ic =~ s/\@(?:dfn|var|emph|cite)/I/;
$ic =~ s/\@(?:file)/F/;
$_ = "\n=over 4\n";
$endw = "table";
};
/^\@((?:small)?example)/ and do {
push @endwstack, $endw;
$endw = $1;
$shift = "\t";
next;
};
/^\@end\s+([a-z]+)/ and do {
if(defined $endw)
{
die "\@$endw ended by \@end $1 at line $.\n"
unless $1 eq $endw;
if($endw =~ /example$/)
{
$shift = "";
$_ = "";
}
else
{
$_ = "\n=back\n";
undef $endw;
$ic = pop @icstack;
}
$endw = pop @endwstack;
}
};
/^\@itemx?\s*(.+)?$/ and do {
if(defined $1)
{
$_ = "=item $ic\&LT;$1\&GT;\n";
}
else
{
$_ = "=item $ic\n";
$ic =~ y/A-Ya-y1-8/B-Zb-z2-9/;
}
};
$section .= $shift.$_."\n";
}
$sects{NAME} = "$fn \- $tl\n";
for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS ENVIRONMENT FILES
BUGS NOTES SEEALSO AUTHOR COPYRIGHT))
{
if(exists $sects{$sect})
{
$head = $sect;
$head =~ s/SEEALSO/SEE ALSO/;
print "=head1 $head\n\n";
print $sects{$sect};
print "\n";
}
}
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
@ifinfo @ifinfo
This file documents the GNU C Preprocessor. This file documents the GNU C Preprocessor.
Copyright 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999 Copyright 1987, 1989, 1991-1999 Free Software Foundation, Inc.
Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice this manual provided the copyright notice and this permission notice
...@@ -42,7 +41,7 @@ into another language, under the above conditions for modified versions. ...@@ -42,7 +41,7 @@ into another language, under the above conditions for modified versions.
@titlepage @titlepage
@c @finalout @c @finalout
@title The C Preprocessor @title The C Preprocessor
@subtitle Last revised September 1998 @subtitle Last revised May 1999
@subtitle for GCC version 2 @subtitle for GCC version 2
@author Richard M. Stallman @author Richard M. Stallman
@page @page
...@@ -51,7 +50,8 @@ This booklet is eventually intended to form the first chapter of a GNU ...@@ -51,7 +50,8 @@ This booklet is eventually intended to form the first chapter of a GNU
C Language manual. C Language manual.
@vskip 0pt plus 1filll @vskip 0pt plus 1filll
Copyright @copyright{} 1987, 1989, 1991-1998 @c man begin COPYRIGHT
Copyright @copyright{} 1987, 1989, 1991-1999
Free Software Foundation, Inc. Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of Permission is granted to make and distribute verbatim copies of
...@@ -65,11 +65,13 @@ permission notice identical to this one. ...@@ -65,11 +65,13 @@ permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions. into another language, under the above conditions for modified versions.
@c man end
@end titlepage @end titlepage
@page @page
@node Top, Global Actions,, (DIR) @node Top, Global Actions,, (DIR)
@chapter The C Preprocessor @chapter The C Preprocessor
@c man begin DESCRIPTION
The C preprocessor is a @dfn{macro processor} that is used automatically by The C preprocessor is a @dfn{macro processor} that is used automatically by
the C compiler to transform your program before actual compilation. It is the C compiler to transform your program before actual compilation. It is
...@@ -117,6 +119,7 @@ problems if you apply it to other kinds of languages, because it assumes ...@@ -117,6 +119,7 @@ problems if you apply it to other kinds of languages, because it assumes
that it is dealing with C@. For example, the C preprocessor sometimes that it is dealing with C@. For example, the C preprocessor sometimes
outputs extra white space to avoid inadvertent C token concatenation, outputs extra white space to avoid inadvertent C token concatenation,
and this may cause problems with other languages. and this may cause problems with other languages.
@c man end
@menu @menu
* Global Actions:: Actions made uniformly on all input files. * Global Actions:: Actions made uniformly on all input files.
...@@ -2516,15 +2519,35 @@ Most often when you use the C preprocessor you will not have to invoke it ...@@ -2516,15 +2519,35 @@ Most often when you use the C preprocessor you will not have to invoke it
explicitly: the C compiler will do so automatically. However, the explicitly: the C compiler will do so automatically. However, the
preprocessor is sometimes useful on its own. preprocessor is sometimes useful on its own.
@ignore
@c man begin SYNOPSIS
cpp [@samp{-P}] [@samp{-C}] [@samp{-gcc}] [@samp{-traditional}]
[@samp{-undef}] [@samp{-trigraphs}] [@samp{-pedantic}]
[@samp{-W}@var{warn}...] [@samp{-I}@var{dir}...]
[@samp{-D}@var{macro}[=@var{defn}]...] [@samp{-U}@var{macro}]
[@samp{-A}@var{predicate}(@var{answer})]
[@samp{-M}|@samp{-MM}|@samp{-MD}|@samp{-MMD} [@samp{-MG}]]
[@samp{-x} @var{language}] [@samp{-std=}@var{standard}]
@var{infile} @var{outfile}
Only the most useful options are listed here; see below for the remainder.
@c man end
@c man begin SEEALSO
gcc(1), as(1), ld(1), and the Info entries for @file{cpp}, @file{gcc}, and
@file{binutils}.
@c man end
@end ignore
@c man begin OPTIONS
The C preprocessor expects two file names as arguments, @var{infile} and The C preprocessor expects two file names as arguments, @var{infile} and
@var{outfile}. The preprocessor reads @var{infile} together with any other @var{outfile}. The preprocessor reads @var{infile} together with any other
files it specifies with @samp{#include}. All the output generated by the files it specifies with @samp{#include}. All the output generated by the
combined input files is written in @var{outfile}. combined input files is written in @var{outfile}.
Either @var{infile} or @var{outfile} may be @samp{-}, which as @var{infile} Either @var{infile} or @var{outfile} may be @samp{-}, which as
means to read from standard input and as @var{outfile} means to write to @var{infile} means to read from standard input and as @var{outfile}
standard output. Also, if @var{outfile} or both file names are omitted, means to write to standard output. Also, if either file is omitted, it
the standard output and standard input are used for the omitted file names. means the same as if @samp{-} had been specified for that file.
@cindex options @cindex options
Here is a table of command options accepted by the C preprocessor. Here is a table of command options accepted by the C preprocessor.
...@@ -2751,8 +2774,8 @@ effect. ...@@ -2751,8 +2774,8 @@ effect.
@item -U @var{name} @item -U @var{name}
@findex -U @findex -U
Do not predefine @var{name}. If both @samp{-U} and @samp{-D} are Do not predefine @var{name}. If both @samp{-U} and @samp{-D} are
specified for one name, the @samp{-U} beats the @samp{-D} and the name specified for one name, whichever one appears later on the command line
is not predefined. wins.
@item -undef @item -undef
@findex -undef @findex -undef
...@@ -2952,8 +2975,8 @@ above. In a future release, this option will be replaced by ...@@ -2952,8 +2975,8 @@ above. In a future release, this option will be replaced by
@findex -$ @findex -$
Forbid the use of @samp{$} in identifiers. The C standard does not Forbid the use of @samp{$} in identifiers. The C standard does not
permit this, but it is a common extension. permit this, but it is a common extension.
@end table @end table
@c man end
@node Concept Index, Index, Invocation, Top @node Concept Index, Index, Invocation, Top
@unnumbered Concept Index @unnumbered Concept Index
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment