A translation is provided when the resulting scrap is not merely a
juxtaposition of the scraps it comes from. An asterisk* next to a scrap
means that its first identifier gets an underlined entry in the index,
via the function |make_underlined|. Two asterisks** means that both
|make_underlined| and |make_reserved| are called; that is, the
identifier's ilk becomes |int_like|. We use
in,
out,
back and
bsp as shorthands for |indent|, |outdent|, |backup| and
|break_space|, respectively.
=4pt
=0
toby1
�pt plus 200pt& #& #0pt
& LHS & RHS Translation & Example
&
any
any
any
any
any
any
|insert| &
any
any
any
any
any
any
& stmt; /* comment */
& |exp| |lbrace| |int_like| |decl|
& |fn_decl| |lbrace| |int_like| |decl|
F = E* | in| | in| &
main(){
main
(
ac,
av) &int
ac;
& |exp| |unop| & |exp| & |x++|
& |exp| |binop| |unorbinop| |exp| & |exp| & |x+y| |x*y|
& |exp| |comma| |exp| & |exp|
E1C | opt| 9 E2& |f(x,y)|
& |exp| |exp| & |exp| & |time()|
& |exp| |semi| & |stmt| & |x=0;|
& |exp| |colon| & |tag| E*C & |found:|
& |lpar| |exp| |rpar| & |exp| & |(x+y)|
& |lpar| |rpar| & |exp| L˙
, R & functions, declarations
& |lpar| |decl_head| |int_like| |rpar| & |cast| & |(char*)|
& |lpar| |stmt| & |lpar| LS&̇nbsp; & |for| constructions
& |question| |exp| |colon| & |binop| & |x==y?x+1:0|
& |unop| |exp| & |exp| & |!x|
& |unorbinop| |exp| |int_like| & |exp|
İ<>U˙E & |*x|
& |unorbinop| |binop| & |binop|
| mathrel| Uİ<>B˙}̇ & |*=|
& |binop| |binop| & |binop|
| mathrel| İ<>B1˙İ<>B2˙}̇ & |x»=y|
& |cast| |exp| & |exp| C&̇nbsp;E & |(double)x|
& |sizeof_like| |cast| & |exp| & |sizeof (double)|
& |sizeof_like| |exp| & |exp| S&̇nbsp;E & |sizeof x|
& |int_like| |int_like| |struct_like| &
|int_like| |struct_like| I&̇nbsp;I S
& |extern char|
& |int_like| |exp| |unorbinop| |semi| & |decl_head|
|exp| |unorbinop| |semi|
D = I˙ ˙ & |int x|
& |decl_head| |comma| & |decl_head| DC&̇nbsp; & |int x,y|
& |decl_head| |unorbinop| & |decl_head|
Dİ<>U˙ & |int *x|
& |decl_head| |exp| & |decl_head| DE* & |int x|
& |decl_head| |binop| |colon| |exp| |comma| |semi| &
|decl_head| |comma| |semi|
D = DB C E & initialization fields
& |decl_head| |int_like| |lbrace| |decl| & |fn_decl|
|int_like| |lbrace| |decl|
F = D | in| | in|
& |long time () |
& |decl_head| |semi| & |decl| & |int n;|
& |decl| |decl| & |decl|
D1 | force| D2 & |int n;double x;|
& |decl| |stmt| |function| & |stmt| |function|
D | bigforce| S F & &extern n;
main ()||
& |typedef_like| |decl_head| |exp| |int_like| & |typedef_like| |decl_head|
D = DE** & &typedef &char &ch;
& |typedef_like| |decl_head| |semi| & |decl| T&̇nbsp;D &
&typedef &int &x,&y;
& |struct_like| |lbrace| & |struct_head| S&̇nbsp;L & |struct |
& |struct_like| |exp| |int_like|
|lbrace| & |struct_head|
S&̇nbsp;E*&̇nbsp;L
& &struct &name_info {
& |struct_like| |exp| |int_like| & |int_like| S&̇nbsp;E
& &struct &name_info z;
& |struct_head| |decl| |stmt| |rbrace| & |int_like|
S
in | force| D
out | force| R &
|struct | declaration ||
& |fn_decl| |decl| & |fn_decl|
F | force| D
& f (z) &double z;
& |fn_decl| |stmt| & |function|
F | out| | out| | force| S
&
main() ...
& |function| |decl| |function| & |decl| |function|
F | bigforce| D F & outer block
& |lbrace| |rbrace| & |stmt| L˙
, R & empty statement
& |lbrace| |stmt| |rbrace| & |stmt|
&&
| force| L
in | force| S | force|
back R
out | force| & compound statement
& |lbrace| |exp| [|comma|] |rbrace| & |exp| & initializer
& |if_like| |exp| & |else_like| I&̇nbsp;E & |if (z)|
& |else_like| |lbrace| & |if_head| |lbrace| & compound statement
& |else_like| |stmt| |exp| |else_like| & |else_like|
&&
| force| E
in
bsp S
out | force| E &̇nbsp; | cancel| &
|if|-|else| clause
& |else_like| |stmt| & |stmt|
| force| E
in
bsp S
out | force| & |else|-less |if|
& |if_head| |stmt| |exp| |else_like| & |else_like|
&&
| force| I
bsp | noop| | cancel| S
bsp E &̇nbsp; | cancel| &
|if|-|else| clause
& |if_head| |stmt| & |stmt|
| force| I
bsp | noop| | cancel| S | force| & |else|-less |if|
& |do_like| |stmt| |else_like| |semi| & |stmt|
D
bsp S
bsp E S & |do| statement
& |case_like| |semi| & |stmt| & |return;|
& |case_like| |exp| |semi| & |stmt| C&̇nbsp;ES & |return 0;|
& |case_like| |colon| & |tag| & |default:|
& |case_like| |exp| |colon| & |tag| C&̇nbsp;EC & |case 0:|
& |tag| |tag| & |tag|
T1
bsp T2 & |case 0: case 1:|
& |tag| |stmt| & |stmt|
| force|
back T
bsp S & |case 0: z=0;|
& |stmt| |stmt| & |stmt|
S1 | force| S2 & compound statement
& |semi| & |stmt| ˙ S& empty statement
& |lproc| |if_like| |else_like| |define_like| & |lproc| &
#include #else #define
& |lproc| |rproc| & |insert| & #endif
& |lproc| |exp| [|exp|] |function| |rproc| & |insert|
I˙
E[&̇nbsp;
5E] F &
#define a 1 #define a
{ b; }
& |mod_scrap| |semi| & |stmt|MS |force|
&〈 mod name 〉;
& |mod_scrap| & |exp| &〈 mod name 〉
& |insert| |any| & |any| & &̇#711;#includeˇ
& |begin_arg| |end_arg| & |exp| & @̇@[&char*@̇@]
& |any_other| |end_arg| & |end_arg| & &char*@̇@]
& |int_like| |comma| |exp| & |int_like| & &struct |t|, |f|
The |force| in rule 55 becomes
bsp if the -̇f option
is used when invoking ĊWEAVE.
The |define_like| case of production 57 also calls
|make_underlined| on the following scrap.
The |exp| in rules 24 and 30 should not be immediately followed by
|lpar| or |exp|.