bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Documentation for Named References


From: Akim Demaille
Subject: Re: Documentation for Named References
Date: Mon, 4 Jan 2010 09:40:34 +0100

Le 23 nov. 2009 à 19:15, Joel E. Denny a écrit :

Hi all!

> I've only recently begun to understand the difference between @samp and 
> @code (because I saw Akim correct some of my poor usage), and I'm not sure 
> I completely understand it.

Well, I would not pretend I know the rule :)  The one I follow is basically to 
use @code for single tokens, and to use @samp for compound statemnts.  The 
Texinfo documentation is not very clear cut either, but it says:

> Use the address@hidden' command to indicate text that is a piece of a program
> and which consists of entire syntactic tokens.  Enclose the text in
> braces.
> 
>  Thus, you should use address@hidden' for an expression in a program, for the
> name of a variable or function used in a program, or for a keyword in a
> programming language.

and

> Use the address@hidden' command to indicate text that is a literal example or
> `sample' of a sequence of characters in a file, string, pattern, etc.
> Enclose the text in braces.  The argument appears within single
> quotation marks in both the Info file and the printed manual; in
> addition, it is printed in a fixed-width font.
> 
>     To match @samp{foo} at the end of the line,
>     use the regexp @samp{foo$}.
> 
> produces
> 
>     To match `foo' at the end of the line, use the regexp `foo$'.
> 
>  Any time you are referring to single characters, you should use
> address@hidden' unless address@hidden' or address@hidden' is more 
> appropriate.  Also, you may use
> address@hidden' for entire statements in C and for entire shell commands--in
> this case, address@hidden' often looks better than address@hidden'.  
> Basically, address@hidden'
> is a catchall for whatever is not covered by address@hidden', 
> address@hidden', or address@hidden'.

There are more examples in the documentation. 


> However, I'm pretty sure @code{.suffix} 
> should be @samp{.suffix} because it discusses a string of text instead of, 
> for example, a variable name.

Definitely.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]