[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] Re: gpic bug
From: |
Russ Cox |
Subject: |
[Groff] Re: gpic bug |
Date: |
Tue, 14 May 2002 11:43:24 -0400 |
This is the rules for position and everything it depends
on except expr, which are just arithmetic expressions.
Both 0,0 and (0,0) work for me in
box with ___ at (0,0)
I also note that the AT&T pic grammar has 208 shift/reduce
conflicts, although with appropriate explicit precedence tags
I'm sure they could be removed. But since the default resolution
is apparently what we want, it hasn't been a problem.
Russ
position: /* absolute, not relative */
place
| '(' position ')' { $$ = $2; }
| expr ',' expr { $$ = makepos($1, $3); }
| position '+' expr ',' expr { $$ = fixpos($1, $3, $5); }
| position '-' expr ',' expr { $$ = fixpos($1, -$3, -$5); }
| position '+' '(' expr ',' expr ')' { $$ = fixpos($1, $4, $6); }
| position '-' '(' expr ',' expr ')' { $$ = fixpos($1, -$4, -$6); }
| position '+' place { $$ = addpos($1, $3); }
| position '-' place { $$ = subpos($1, $3); }
| '(' place ',' place ')' { $$ = makepos(getcomp($2,DOTX),
getcomp($4,DOTY)); }
| expr LT position ',' position GT { $$ = makebetween($1, $3, $5);
}
| expr BETWEEN position AND position { $$ = makebetween($1, $3, $5);
}
;
place:
PLACENAME { y = getvar($1); $$ = y.o; }
| PLACENAME CORNER { y = getvar($1); $$ = getpos(y.o, $2); }
| CORNER PLACENAME { y = getvar($2); $$ = getpos(y.o, $1); }
| HERE { $$ = gethere(); }
| last type { $$ = getlast($1, $2); }
| last type { $$ = getlast($1, $2); }
| last type CORNER { $$ = getpos(getlast($1, $2), $3); }
| CORNER last type { $$ = getpos(getlast($2, $3), $1); }
| NTH type { $$ = getfirst($1, $2); }
| NTH type CORNER { $$ = getpos(getfirst($1, $2), $3); }
| CORNER NTH type { $$ = getpos(getfirst($2, $3), $1); }
| blockname
| blockname CORNER { $$ = getpos($1, $2); }
| CORNER blockname { $$ = getpos($2, $1); }
;
blockname:
last BLOCK '.' PLACENAME { $$ = getblock(getlast($1,$2), $4); }
| NTH BLOCK '.' PLACENAME { $$ = getblock(getfirst($1,$2), $4); }
| PLACENAME '.' PLACENAME { y = getvar($1); $$ = getblock(y.o,
$3); }
;
last:
last LAST { $$ = $1 + 1; }
| NTH LAST { $$ = $1; }
| LAST { $$ = 1; }
| LAST { $$ = 1; }
;
type:
BOX
| CIRCLE
| ELLIPSE
| ARC
| LINE
| ARROW
| SPLINE
| BLOCK
;
[Groff] Re: GNU pic grammar, Werner LEMBERG, 2002/05/06
[Groff] Re: gpic bug, Werner LEMBERG, 2002/05/02
[Groff] Re: gpic bug, Russ Cox, 2002/05/02
[Groff] Re: gpic bug, Werner LEMBERG, 2002/05/14
[Groff] Re: gpic bug,
Russ Cox <=
[Groff] Re: gpic bug, Werner LEMBERG, 2002/05/17