diff --git a/src/parser.y b/src/parser.y index b29f9f3..122a232 100644 --- a/src/parser.y +++ b/src/parser.y @@ -4,7 +4,7 @@ * Date created: March 16, 1999 (Tuesday, 17:17h) * Author: Copyright (C) 1999 Thomas Jensen * tsjensen@stud.informatik.uni-erlangen.de - * Version: $Id: parser.y,v 1.17 1999/07/22 12:27:16 tsjensen Exp tsjensen $ + * Version: $Id: parser.y,v 1.18 1999/07/23 16:14:17 tsjensen Exp tsjensen $ * Language: yacc (ANSI C) * Purpose: Yacc parser for boxes configuration files * @@ -24,6 +24,10 @@ * Revision History: * * $Log: parser.y,v $ + * Revision 1.18 1999/07/23 16:14:17 tsjensen + * Added computation of height of highest shape in design (maxshapeheight) + * Options -l and -d together now call quickinfo mode -> parse only 1 design + * * Revision 1.17 1999/07/22 12:27:16 tsjensen * Added GNU GPL disclaimer * Renamed parser.h include to lexer.h (same file) @@ -104,16 +108,16 @@ const char rcsid_parser_y[] = - "$Id: parser.y,v 1.17 1999/07/22 12:27:16 tsjensen Exp tsjensen $"; + "$Id: parser.y,v 1.18 1999/07/23 16:14:17 tsjensen Exp tsjensen $"; static int pflicht = 0; static int time_for_se_check = 0; +static int anz_shapespec = 0; /* number of user-specified shapes */ int speeding = 0; /* true if we're skipping designs, */ /* but no error */ -int yylex(); /* defined in lex.yy.c */ - +static int skipping = 0; /* used to limit "skipping" msgs */ @@ -190,7 +194,6 @@ static int check_sizes() static int corner_check() /* - * Check that all corners are explicitly specified in the config file. * Check that no corners are elastic. * * RETURNS: == 0 no problem detected @@ -206,11 +209,6 @@ static int corner_check() #endif for (c=0; cheight = 1; + else + c->height = c[nshape].height; + c->width = designs[design_idx].shape[fshape].width; + } + else { + if (nshape == SHAPES_PER_SIDE) + c->width = 1; + else + c->width = c[nshape].width; + c->height = designs[design_idx].shape[fshape].height; + } + c->elastic = 0; + rc = genshape (c->width, c->height, &(c->chars)); + if (rc) + YYABORT; + } + + fshape = sides[side][SHAPES_PER_SIDE-1]; + } + + /* + * For all sides whose side shapes have not been defined, generate + * an elastic middle side shape. + */ + for (side=0; sidewidth = designs[design_idx].shape[sides[side][0]].width; + c->height = 1; + } + else { + c->width = 1; + c->height = designs[design_idx].shape[sides[side][0]].height; + } + c->elastic = 1; + rc = genshape (c->width, c->height, &(c->chars)); + if (rc) + YYABORT; + } + } + if (check_sizes()) YYERROR; @@ -826,6 +896,8 @@ slist_entry: SHAPE shape_def if (isempty (designs[design_idx].shape + $1)) { designs[design_idx].shape[$1] = $2; + if (!isdeepempty(&($2))) + ++anz_shapespec; } else { yyerror ("duplicate specification for %s shape", shape_name[$1]); @@ -837,24 +909,11 @@ slist_entry: SHAPE shape_def shape_def: '(' shape_lines ')' { - sentry_t rval = $2; - - if (rval.width == 0 || rval.height == 0) { - - size_t i; - - for (i=0; i