X-Git-Url: https://git.distorted.org.uk/~mdw/mup/blobdiff_plain/cdb3c0882392596f814cf939cbfbd38adc6f2bfe..ddf6330b56bcfb657e0186b24b9b1422c51d3424:/mup/mup/ytab.c diff --git a/mup/mup/ytab.c b/mup/mup/ytab.c new file mode 100644 index 0000000..e3536b0 --- /dev/null +++ b/mup/mup/ytab.c @@ -0,0 +1,8414 @@ +/* A Bison parser, made from gram.y, by GNU bison 1.75. */ + +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + T_SCORE = 258, + T_STAFF = 259, + T_VOICE = 260, + T_GRIDS = 261, + T_BLOCKHEAD = 262, + T_NUMBER = 263, + T_EQUAL = 264, + T_SEMICOLON = 265, + T_NEWLINE = 266, + T_COLON = 267, + T_COMMA = 268, + T_LBRACKET = 269, + T_RBRACKET = 270, + T_LBRACE = 271, + T_RBRACE = 272, + T_VARIABLE = 273, + T_DASH = 274, + T_PLUS = 275, + T_PLACE = 276, + T_ALL = 277, + T_WITH = 278, + T_CUE = 279, + T_GRACE = 280, + T_XNOTE = 281, + T_DIAM = 282, + T_DOT = 283, + T_MULTIWHOLE = 284, + T_LET_M = 285, + T_LET_R = 286, + T_LET_S = 287, + T_LET_U = 288, + T_PITCH = 289, + T_SHARP = 290, + T_AMPERSAND = 291, + T_LET_N = 292, + T_LET_X = 293, + T_DBLFLAT = 294, + T_LETTER = 295, + T_LYRICS = 296, + T_PAD = 297, + T_LPAREN = 298, + T_RPAREN = 299, + T_LVAR = 300, + T_MUSIC = 301, + T_HEADSHAPES = 302, + T_HS = 303, + T_SWINGUNIT = 304, + T_POSTSCRIPT = 305, + T_SCOREFEED = 306, + T_BARTYPE = 307, + T_HAT = 308, + T_TILDE = 309, + T_QUESTION = 310, + T_LINETYPE = 311, + T_LINE = 312, + T_TO = 313, + T_STAR = 314, + T_BULGE = 315, + T_CURVE = 316, + T_TIE = 317, + T_PRINTTYPE = 318, + T_NL = 319, + T_STAFFLINES = 320, + T_FFAMILY = 321, + T_PARAGRAPH = 322, + T_PARATYPE = 323, + T_NUMVAR = 324, + T_FNUMVAR = 325, + T_2FNUMVAR = 326, + T_RATNUMLISTVAR = 327, + T_RANGELISTVAR = 328, + T_TIMEUNIT = 329, + T_FONTVAR = 330, + T_STRVAR = 331, + T_CLEFVAR = 332, + T_VVAR = 333, + T_BARSTLISTVAR = 334, + T_SCORESEP = 335, + T_FONT = 336, + T_SLASH = 337, + T_KEY = 338, + T_TIME = 339, + T_CUT = 340, + T_COMMON = 341, + T_CLEF = 342, + T_MULTIREST = 343, + T_YESNOVAR = 344, + T_BM = 345, + T_ESBM = 346, + T_EBM = 347, + T_INVISBAR = 348, + T_OCTAVE = 349, + T_ROLL = 350, + T_VISVAR = 351, + T_WHEREUSED = 352, + T_UNSET = 353, + T_VCOMBINE = 354, + T_VCOMBVAL = 355, + T_SCOREPAD = 356, + T_WORD = 357, + T_UP = 358, + T_DOWN = 359, + T_ENDING = 360, + T_ENDENDING = 361, + T_FAMILY = 362, + T_ENDSTYLE = 363, + T_ENDTYPE = 364, + T_SLASHMARK = 365, + T_ALT = 366, + T_TITLE = 367, + T_REHEARSAL = 368, + T_NUM = 369, + T_LET = 370, + T_MNUM = 371, + T_TRANSPOSE = 372, + T_XPOS_INT = 373, + T_PEDAL = 374, + T_PHRASE = 375, + T_MUSSYM = 376, + T_L_ANGLE = 377, + T_MODIFIER = 378, + T_R_ANGLE = 379, + T_TIL = 380, + T_MIDI = 381, + T_PEDSTYLE = 382, + T_PEDSTAR = 383, + T_HIDECHANGES = 384, + T_SLUR = 385, + T_UNITS = 386, + T_CENTIMETERS = 387, + T_UNITTYPE = 388, + T_TAB = 389, + T_TICKS = 390, + T_NOWHERE_SLIDE = 391, + T_LEN = 392, + T_EXCLAM = 393, + T_OTHERTEXT = 394, + T_ORDER = 395, + T_GRIDPLACE = 396, + T_GRPLVALUE = 397, + T_DRUM = 398, + T_RPT = 399, + T_STRING = 400, + T_HO = 401, + T_REH_STYLE = 402, + T_REHTYPE = 403, + T_L_DBLANGLE = 404, + T_R_DBLANGLE = 405, + T_SLOPE = 406, + T_PSVAR = 407, + T_PAGESIZE = 408, + T_ORIENTATION = 409 + }; +#endif +#define T_SCORE 258 +#define T_STAFF 259 +#define T_VOICE 260 +#define T_GRIDS 261 +#define T_BLOCKHEAD 262 +#define T_NUMBER 263 +#define T_EQUAL 264 +#define T_SEMICOLON 265 +#define T_NEWLINE 266 +#define T_COLON 267 +#define T_COMMA 268 +#define T_LBRACKET 269 +#define T_RBRACKET 270 +#define T_LBRACE 271 +#define T_RBRACE 272 +#define T_VARIABLE 273 +#define T_DASH 274 +#define T_PLUS 275 +#define T_PLACE 276 +#define T_ALL 277 +#define T_WITH 278 +#define T_CUE 279 +#define T_GRACE 280 +#define T_XNOTE 281 +#define T_DIAM 282 +#define T_DOT 283 +#define T_MULTIWHOLE 284 +#define T_LET_M 285 +#define T_LET_R 286 +#define T_LET_S 287 +#define T_LET_U 288 +#define T_PITCH 289 +#define T_SHARP 290 +#define T_AMPERSAND 291 +#define T_LET_N 292 +#define T_LET_X 293 +#define T_DBLFLAT 294 +#define T_LETTER 295 +#define T_LYRICS 296 +#define T_PAD 297 +#define T_LPAREN 298 +#define T_RPAREN 299 +#define T_LVAR 300 +#define T_MUSIC 301 +#define T_HEADSHAPES 302 +#define T_HS 303 +#define T_SWINGUNIT 304 +#define T_POSTSCRIPT 305 +#define T_SCOREFEED 306 +#define T_BARTYPE 307 +#define T_HAT 308 +#define T_TILDE 309 +#define T_QUESTION 310 +#define T_LINETYPE 311 +#define T_LINE 312 +#define T_TO 313 +#define T_STAR 314 +#define T_BULGE 315 +#define T_CURVE 316 +#define T_TIE 317 +#define T_PRINTTYPE 318 +#define T_NL 319 +#define T_STAFFLINES 320 +#define T_FFAMILY 321 +#define T_PARAGRAPH 322 +#define T_PARATYPE 323 +#define T_NUMVAR 324 +#define T_FNUMVAR 325 +#define T_2FNUMVAR 326 +#define T_RATNUMLISTVAR 327 +#define T_RANGELISTVAR 328 +#define T_TIMEUNIT 329 +#define T_FONTVAR 330 +#define T_STRVAR 331 +#define T_CLEFVAR 332 +#define T_VVAR 333 +#define T_BARSTLISTVAR 334 +#define T_SCORESEP 335 +#define T_FONT 336 +#define T_SLASH 337 +#define T_KEY 338 +#define T_TIME 339 +#define T_CUT 340 +#define T_COMMON 341 +#define T_CLEF 342 +#define T_MULTIREST 343 +#define T_YESNOVAR 344 +#define T_BM 345 +#define T_ESBM 346 +#define T_EBM 347 +#define T_INVISBAR 348 +#define T_OCTAVE 349 +#define T_ROLL 350 +#define T_VISVAR 351 +#define T_WHEREUSED 352 +#define T_UNSET 353 +#define T_VCOMBINE 354 +#define T_VCOMBVAL 355 +#define T_SCOREPAD 356 +#define T_WORD 357 +#define T_UP 358 +#define T_DOWN 359 +#define T_ENDING 360 +#define T_ENDENDING 361 +#define T_FAMILY 362 +#define T_ENDSTYLE 363 +#define T_ENDTYPE 364 +#define T_SLASHMARK 365 +#define T_ALT 366 +#define T_TITLE 367 +#define T_REHEARSAL 368 +#define T_NUM 369 +#define T_LET 370 +#define T_MNUM 371 +#define T_TRANSPOSE 372 +#define T_XPOS_INT 373 +#define T_PEDAL 374 +#define T_PHRASE 375 +#define T_MUSSYM 376 +#define T_L_ANGLE 377 +#define T_MODIFIER 378 +#define T_R_ANGLE 379 +#define T_TIL 380 +#define T_MIDI 381 +#define T_PEDSTYLE 382 +#define T_PEDSTAR 383 +#define T_HIDECHANGES 384 +#define T_SLUR 385 +#define T_UNITS 386 +#define T_CENTIMETERS 387 +#define T_UNITTYPE 388 +#define T_TAB 389 +#define T_TICKS 390 +#define T_NOWHERE_SLIDE 391 +#define T_LEN 392 +#define T_EXCLAM 393 +#define T_OTHERTEXT 394 +#define T_ORDER 395 +#define T_GRIDPLACE 396 +#define T_GRPLVALUE 397 +#define T_DRUM 398 +#define T_RPT 399 +#define T_STRING 400 +#define T_HO 401 +#define T_REH_STYLE 402 +#define T_REHTYPE 403 +#define T_L_DBLANGLE 404 +#define T_R_DBLANGLE 405 +#define T_SLOPE 406 +#define T_PSVAR 407 +#define T_PAGESIZE 408 +#define T_ORIENTATION 409 + + + + +/* Copy the first part of user declarations. */ +#line 2 "gram.y" + + +/* Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + * 2005, 2006 by Arkkra Enterprises */ +/* All rights reserved */ + +/* parser for music publication program. Uses lex to get tokens. */ + + +#include "rational.h" +#include "globals.h" +#include "defines.h" +#include "structs.h" + +#define YYDEBUG 1 + + +/* how many items to allocate at a time for + * "with" list, and location lists, etc */ +#define ITEMS (4) + + +static struct MAINLL *Currstruct_p; /* main list struct being filled in */ +static struct BLOCKHEAD *Currblock_p; /* current block, if non-zero */ + +static struct INPCOORD *Curr_loc_info_p; /* location info being collected */ + + +static short Gotheader, Gotfooter; /* boolean: to make sure each is defined only once */ +static short Gothead2, Gotfoot2; +static short Getting_tup_dur; /* YES if currently collection tuplet + * duration rather than GRPSYL dur */ + +static struct GRPSYL *Curr_grpsyl_p; /* current GRPSYL struct being filled in */ +static struct GRPSYL *Last_grpsyl_p; /* previous GRPSYL struct filled in (contains + * defaults for the current one */ +static struct TIMELIST *Extra_time_p; /* If user enters times to be added + * together, like 2.+16 this points to + * a linked list of the extra times */ +static struct TIMELIST *Curr_timelist_p;/* current additive time, used to know + * where to link items to the list */ +static struct TIMELIST *Last_alloced_timelist_p; /* Most recently allocated + * list. Keeping track of this lets us + * avoid trying to free the list + * when Extra_time_p is pointing + * to a list from an SSV. */ +static struct GRPSYL *Prev_grpsyl_p; /* Like Last_grpsyl_p except in the + * case of additive times, + * in which case it points to the + * first group. This is needed in case + * the following group is to get its + * time value by defaulting to that + * of its previous group. */ +static int Extra_basictime; /* for saving basictime, when doing + * additive times */ +static int Doing_timeunit = NO; /* YES if gathering timeunit param */ +static struct GRPSYL *Lyrics_p; /* pointer to current list of lyrics */ +static char **Curr_marklist; /* current "with" list */ +static struct PRINTDATA **Next_print_link_p_p; /* points to where to attach next + * print command that we get */ +static int Item_count; /* items in current list */ +static int Max_items; /* current amount of space in lists + * "with" list, curve locations, etc) */ + +static int Plus_minus; /* if 1 add, if -1 subtract offset */ +static int Defining_multiple = NO; /* if defining multiple voices at once */ +static int Chord_at_a_time = NO; /* YES for chord-at-a-time, + * NO for voice-at-a-time */ +static short Endingloc; /* if current bar starts or ends an + * ending, etc (STARTITEM, ENDITEM, etc) */ +static short Got_ending; /* YES if got ending on this bar */ + +static int Til_bars; /* number of bars in "til" clause */ +static int Dist; /* dist for a specific STUFF */ +static int Dist_usage; /* meaning of Dist field */ +static short User_meas_time; /* YES if user specified a time for + * an 'm' item. Only valid on mr */ +static int Order_place; /* PL_* for markorder in SSV */ +static int Order_prio; /* value in markorder in SSV */ +static int Gracebackup; /* how many grace notes to back up + * before starting a "stuff" */ +static float Til_offset; /* beat count in "til" clause */ +static int Slurstyle; /* L_DOTTED, L_DASHED, or L_NORMAL */ + +static char *String1, *String2; /* to temporarily keep track + * of labels and other temporary + * strings */ +static char Tmpbuff[20]; /* temporary buffer for converting + * float numbers */ +static char Stringbuff[100]; /* temporary string storage */ +static int Titlefont, Titlesize; /* font/size for title command */ +static double Extra; /* extra vertical space for prints */ +static short Good_till_canceled = NO; /* if [] things should be continued + * until turned off */ +static short Curr_paratype = J_JUSTPARA; /* current paragraph type */ +static struct TIMEDSSV *Curr_tssv_p; /* current mid-measure param change */ +static char Timerep[MAXTSLEN]; /* Internal representation of time + * signature being collected */ +static int Tsig_offset; /* Current place in Timerep while + * collecting a time signature */ +static char *Alt_timesig_list; /* If user specified alternating + * time signatures, this points to + * the beginning of the list, for + * when we need to wrap around */ +static char *Next_alt_timesig; /* If user specified alternating + * time signatures, this points to + * the one for the next measure */ +static short Tsig_visibility; /* If EACHMEAS, alternating + * time signatures will be done + * by explicitly printing + * the appropriate time signature at + * the beginning of every measure, + * rather than printing them all just + * once at the beginning of the run + * of measures that alternate. */ + +/* Row index values must match the PS_* value definitions in defines.h. + * Column [0] is height in portrait mode, and column [1] is height. */ +double pagesztbl[7][2] = { + { 8.5, 11.0 }, /* PS_LETTER */ + { 8.5, 14.0 }, /* PS_LEGAL */ + { 8.5, 13.0 }, /* PS_FLSA */ + { 5.5, 8.5 }, /* PS_HALFLETTER */ + { 8.26, 11.69 }, /* PS_A4 */ + { 5.84, 8.26 }, /* PS_A5 */ + { 4.12, 5.84 } /* PS_A6 */ +}; + + + +/* static functions */ +static char *stripquotes P((char *string)); /* rmv double quotes + * from string */ +static void chkdup_headfoot P((int flag, char *which)); +static void end_prev_context P((void)); +static void var_valid P((void)); /* check if okay to set location var */ +static void proc_printcmd P((int justifytype, struct INPCOORD *inpc_p, + char *str, int font, int size, int got_nl, + int isPostScript, double extra)); +static double extra_needed P((int font, int size, char *string)); +static void keyword_notes P((char *str)); +static void free_extra_time P((void)); +static void tsig_item P((int item)); + + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +#ifndef YYSTYPE +#line 152 "gram.y" +typedef union { +int intval; /* for tokens/nonterminals that return int values */ +char *stringval; /* for tokens/nonterminals that return strings */ +float floatval; /* for nonterminals that return floats */ +RATIONAL ratval; /* for nonterminals that return rational numbers */ +struct INPCOORD *inpcoord_p; /* for nonterminals that return coord info */ +} yystype; +/* Line 193 of /usr/share/bison/yacc.c. */ +#line 536 "y.tab.c" +# define YYSTYPE yystype +# define YYSTYPE_IS_TRIVIAL 1 +#endif + +#ifndef YYLTYPE +typedef struct yyltype +{ + int first_line; + int first_column; + int last_line; + int last_column; +} yyltype; +# define YYLTYPE yyltype +# define YYLTYPE_IS_TRIVIAL 1 +#endif + +/* Copy the second part of user declarations. */ + + +/* Line 213 of /usr/share/bison/yacc.c. */ +#line 557 "y.tab.c" + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# if YYSTACK_USE_ALLOCA +# define YYSTACK_ALLOC alloca +# else +# ifndef YYSTACK_USE_ALLOCA +# if defined (alloca) || defined (_ALLOCA_H) +# define YYSTACK_ALLOC alloca +# else +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# else +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +# define YYSTACK_ALLOC malloc +# define YYSTACK_FREE free +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAX) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 167 +#define YYLAST 1149 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 155 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 273 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 618 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 914 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 409 + +#define YYTRANSLATE(X) \ + ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned short yyprhs[] = +{ + 0, 0, 3, 5, 8, 10, 12, 14, 16, 19, + 22, 24, 28, 30, 33, 35, 37, 39, 41, 44, + 47, 51, 56, 58, 59, 61, 63, 65, 69, 71, + 73, 75, 77, 80, 82, 84, 89, 92, 96, 102, + 107, 108, 113, 118, 123, 129, 134, 139, 143, 147, + 151, 155, 159, 163, 167, 171, 175, 178, 179, 184, + 188, 193, 198, 202, 206, 210, 216, 220, 224, 226, + 228, 230, 231, 233, 235, 236, 237, 239, 241, 243, + 247, 251, 252, 257, 262, 264, 265, 267, 268, 271, + 274, 276, 278, 279, 280, 282, 286, 290, 291, 294, + 295, 300, 301, 304, 306, 307, 308, 310, 314, 317, + 319, 321, 325, 329, 331, 333, 335, 337, 339, 341, + 343, 345, 347, 350, 352, 353, 357, 359, 360, 365, + 367, 369, 373, 377, 379, 381, 385, 387, 388, 390, + 391, 393, 397, 401, 404, 407, 409, 414, 416, 419, + 424, 425, 427, 428, 430, 432, 434, 436, 437, 440, + 443, 444, 448, 450, 453, 454, 456, 457, 460, 461, + 463, 465, 467, 469, 471, 472, 474, 476, 479, 481, + 483, 490, 493, 494, 496, 497, 499, 500, 504, 506, + 509, 513, 521, 522, 524, 526, 528, 530, 532, 534, + 536, 538, 540, 542, 544, 546, 548, 550, 552, 554, + 556, 558, 560, 562, 564, 566, 568, 570, 572, 574, + 576, 578, 580, 582, 586, 591, 595, 597, 598, 600, + 602, 604, 607, 611, 613, 615, 617, 621, 623, 627, + 629, 631, 634, 636, 638, 642, 645, 646, 649, 652, + 657, 658, 661, 663, 666, 668, 674, 675, 677, 679, + 682, 687, 689, 691, 693, 695, 699, 703, 707, 710, + 712, 717, 724, 725, 729, 730, 735, 736, 737, 739, + 741, 745, 749, 751, 753, 755, 757, 761, 764, 767, + 770, 773, 775, 777, 780, 781, 783, 784, 786, 788, + 792, 794, 798, 801, 804, 807, 808, 809, 811, 813, + 817, 819, 821, 823, 825, 827, 829, 831, 833, 835, + 837, 839, 841, 843, 846, 848, 850, 851, 853, 854, + 858, 860, 862, 863, 866, 871, 872, 873, 875, 876, + 879, 881, 885, 886, 888, 890, 892, 895, 898, 899, + 901, 904, 907, 911, 914, 917, 919, 920, 923, 926, + 927, 931, 933, 934, 938, 940, 942, 944, 947, 949, + 951, 953, 955, 957, 959, 961, 965, 968, 974, 980, + 984, 990, 998, 1003, 1008, 1015, 1020, 1026, 1031, 1032, + 1034, 1036, 1037, 1039, 1040, 1042, 1044, 1046, 1048, 1050, + 1052, 1054, 1056, 1058, 1060, 1063, 1065, 1068, 1073, 1075, + 1076, 1078, 1080, 1082, 1085, 1088, 1091, 1093, 1095, 1097, + 1099, 1101, 1103, 1105, 1107, 1109, 1118, 1119, 1121, 1123, + 1125, 1127, 1129, 1130, 1132, 1133, 1136, 1141, 1145, 1147, + 1148, 1150, 1152, 1154, 1158, 1161, 1162, 1165, 1168, 1169, + 1170, 1176, 1178, 1180, 1182, 1186, 1189, 1190, 1193, 1194, + 1197, 1198, 1200, 1202, 1205, 1208, 1212, 1214, 1220, 1221, + 1223, 1225, 1228, 1231, 1237, 1240, 1242, 1244, 1245, 1249, + 1251, 1252, 1255, 1259, 1260, 1262, 1263, 1265, 1267, 1269, + 1273, 1274, 1278, 1279, 1282, 1284, 1287, 1289, 1291, 1295, + 1299, 1303, 1311, 1314, 1316, 1317, 1319, 1321, 1323, 1325, + 1332, 1333, 1336, 1338, 1342, 1344, 1346, 1348, 1350, 1351, + 1354, 1357, 1359, 1361, 1363, 1366, 1369, 1371, 1375, 1377, + 1379, 1381, 1382, 1385, 1388, 1390, 1392, 1396, 1399, 1400, + 1402, 1404, 1406, 1414, 1415, 1416, 1418, 1419, 1424, 1432, + 1433, 1436, 1439, 1441, 1445, 1447, 1451, 1454, 1456, 1460, + 1467, 1474, 1477, 1479, 1481, 1483, 1485, 1488, 1490, 1492, + 1494, 1496, 1498, 1499, 1503, 1504, 1506, 1507, 1510, 1513, + 1517, 1518, 1520, 1522, 1525, 1531, 1534, 1535, 1540, 1541, + 1546, 1547, 1549, 1551, 1552, 1555, 1558, 1559, 1562, 1563, + 1566, 1572, 1573, 1575, 1577, 1580, 1582, 1585, 1586, 1589, + 1593, 1596, 1600, 1604, 1608, 1610, 1612, 1613, 1615 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const short yyrhs[] = +{ + 156, 0, -1, 157, -1, 156, 157, -1, 158, -1, + 170, -1, 229, -1, 235, -1, 239, 11, -1, 359, + 11, -1, 165, -1, 353, 358, 11, -1, 11, -1, + 1, 11, -1, 159, -1, 162, -1, 164, -1, 166, + -1, 163, 161, -1, 3, 160, -1, 4, 167, 160, + -1, 5, 167, 168, 160, -1, 161, -1, -1, 7, + -1, 46, -1, 6, -1, 238, 238, 11, -1, 47, + -1, 169, -1, 169, -1, 8, -1, 172, 171, -1, + 10, -1, 11, -1, 69, 9, 296, 169, -1, 69, + 9, -1, 70, 9, 382, -1, 71, 9, 382, 13, + 382, -1, 152, 9, 220, 221, -1, -1, 99, 9, + 173, 222, -1, 42, 9, 296, 382, -1, 78, 9, + 169, 176, -1, 72, 9, 177, 178, 184, -1, 73, + 9, 185, 186, -1, 79, 9, 192, 193, -1, 195, + 9, 196, -1, 83, 9, 209, -1, 84, 9, 199, + -1, 65, 9, 210, -1, 75, 9, 81, -1, 107, + 9, 66, -1, 77, 9, 87, -1, 89, 9, 215, + -1, 96, 9, 175, -1, 98, 237, -1, -1, 74, + 9, 174, 182, -1, 49, 9, 183, -1, 80, 9, + 216, 217, -1, 101, 9, 218, 219, -1, 108, 9, + 224, -1, 147, 9, 148, -1, 127, 9, 227, -1, + 117, 9, 225, 228, 169, -1, 131, 9, 133, -1, + 76, 9, 238, -1, 97, -1, 40, -1, 37, -1, + -1, 34, -1, 40, -1, -1, -1, 179, -1, 182, + -1, 180, -1, 179, 13, 182, -1, 179, 13, 180, + -1, -1, 43, 181, 179, 44, -1, 288, 293, 289, + 292, -1, 30, -1, -1, 182, -1, -1, 31, 32, + -1, 32, 31, -1, 32, -1, 31, -1, -1, -1, + 187, -1, 186, 13, 187, -1, 169, 188, 189, -1, + -1, 19, 169, -1, -1, 43, 191, 190, 44, -1, + -1, 13, 191, -1, 238, -1, -1, -1, 194, -1, + 193, 13, 194, -1, 169, 188, -1, 140, -1, 197, + -1, 196, 13, 197, -1, 196, 36, 197, -1, 198, + -1, 121, -1, 94, -1, 139, -1, 123, -1, 41, + -1, 105, -1, 113, -1, 119, -1, 200, 207, -1, + 202, -1, -1, 200, 201, 202, -1, 204, -1, -1, + 202, 20, 203, 204, -1, 85, -1, 86, -1, 205, + 82, 169, -1, 205, 20, 29, -1, 29, -1, 206, + -1, 205, 20, 206, -1, 169, -1, -1, 215, -1, + -1, 37, -1, 169, 313, 226, -1, 310, 311, 226, + -1, 169, 208, -1, 169, 143, -1, 134, -1, 134, + 43, 211, 44, -1, 212, -1, 211, 212, -1, 310, + 213, 214, 312, -1, -1, 313, -1, -1, 135, -1, + 40, -1, 37, -1, 169, -1, -1, 13, 169, -1, + 296, 169, -1, -1, 13, 296, 169, -1, 153, -1, + 310, 169, -1, -1, 154, -1, -1, 254, 223, -1, + -1, 100, -1, 109, -1, 7, -1, 103, -1, 104, + -1, -1, 118, -1, 57, -1, 111, 128, -1, 128, + -1, 118, -1, 112, 230, 233, 234, 358, 11, -1, + 232, 231, -1, -1, 81, -1, -1, 66, -1, -1, + 43, 169, 44, -1, 238, -1, 238, 238, -1, 238, + 238, 238, -1, 236, 67, 230, 233, 238, 358, 11, + -1, -1, 68, -1, 69, -1, 89, -1, 80, -1, + 65, -1, 74, -1, 49, -1, 42, -1, 79, -1, + 70, -1, 71, -1, 131, -1, 108, -1, 147, -1, + 127, -1, 78, -1, 99, -1, 101, -1, 73, -1, + 140, -1, 83, -1, 84, -1, 117, -1, 72, -1, + 96, -1, 76, -1, 75, -1, 107, -1, 77, -1, + 145, -1, 238, 20, 145, -1, 240, 241, 250, 256, + -1, 88, 169, 358, -1, 330, -1, -1, 247, -1, + 242, -1, 243, -1, 242, 243, -1, 244, 246, 245, + -1, 14, -1, 15, -1, 247, -1, 246, 10, 247, + -1, 249, -1, 247, 248, 249, -1, 36, -1, 251, + -1, 251, 254, -1, 12, -1, 252, -1, 251, 13, + 252, -1, 167, 253, -1, -1, 19, 167, -1, 168, + 255, -1, 168, 19, 168, 255, -1, -1, 13, 254, + -1, 257, -1, 256, 257, -1, 324, -1, 258, 264, + 297, 274, 10, -1, -1, 259, -1, 260, -1, 259, + 260, -1, 149, 261, 262, 150, -1, 3, -1, 4, + -1, 5, -1, 263, -1, 262, 10, 263, -1, 77, + 9, 87, -1, 69, 9, 169, -1, 265, 286, -1, + 268, -1, 14, 19, 15, 268, -1, 14, 268, 269, + 15, 266, 267, -1, -1, 28, 28, 28, -1, -1, + 267, 14, 269, 15, -1, -1, -1, 270, -1, 271, + -1, 269, 10, 271, -1, 23, 277, 279, -1, 322, + -1, 283, -1, 294, -1, 284, -1, 69, 296, 169, + -1, 146, 272, -1, 48, 238, -1, 137, 382, -1, + 110, 169, -1, 20, -1, 19, -1, 273, 382, -1, + -1, 374, -1, -1, 275, -1, 276, -1, 275, 13, + 276, -1, 285, -1, 151, 296, 382, -1, 111, 169, + -1, 130, 278, -1, 62, 278, -1, -1, -1, 284, + -1, 280, -1, 279, 13, 280, -1, 281, -1, 282, + -1, 238, -1, 28, -1, 19, -1, 124, -1, 53, + -1, 24, -1, 25, -1, 27, -1, 26, -1, 103, + -1, 104, -1, 90, 287, -1, 91, -1, 92, -1, + -1, 182, -1, -1, 23, 4, 21, -1, 29, -1, + 169, -1, -1, 289, 290, -1, 374, 291, 288, 293, + -1, -1, -1, 30, -1, -1, 293, 28, -1, 295, + -1, 42, 296, 382, -1, -1, 19, -1, 303, -1, + 298, -1, 299, 302, -1, 300, 301, -1, -1, 55, + -1, 54, 278, -1, 9, 323, -1, 53, 310, 312, + -1, 53, 82, -1, 48, 238, -1, 317, -1, -1, + 302, 301, -1, 306, 304, -1, -1, 305, 306, 21, + -1, 23, -1, -1, 306, 307, 302, -1, 308, -1, + 31, -1, 32, -1, 33, 32, -1, 144, -1, 52, + -1, 25, -1, 109, -1, 68, -1, 73, -1, 87, + -1, 43, 308, 44, -1, 310, 309, -1, 310, 43, + 313, 44, 312, -1, 310, 43, 314, 44, 309, -1, + 310, 43, 310, -1, 310, 313, 214, 312, 309, -1, + 310, 313, 214, 43, 314, 44, 309, -1, 310, 313, + 43, 310, -1, 310, 135, 312, 309, -1, 310, 135, + 43, 314, 44, 309, -1, 310, 314, 311, 309, -1, + 310, 314, 43, 313, 44, -1, 310, 314, 43, 310, + -1, -1, 238, -1, 34, -1, -1, 313, -1, -1, + 314, -1, 35, -1, 36, -1, 37, -1, 38, -1, + 39, -1, 169, -1, 315, -1, 316, -1, 19, -1, + 315, 19, -1, 20, -1, 316, 20, -1, 318, 319, + 124, 278, -1, 122, -1, -1, 136, -1, 320, -1, + 321, -1, 320, 321, -1, 310, 312, -1, 9, 323, + -1, 40, -1, 34, -1, 30, -1, 31, -1, 32, + -1, 33, -1, 37, -1, 38, -1, 45, -1, 326, + 256, 327, 328, 169, 325, 329, 10, -1, -1, 37, + -1, 114, -1, 40, -1, 16, -1, 17, -1, -1, + 21, -1, -1, 13, 182, -1, 41, 331, 12, 344, + -1, 332, 334, 337, -1, 333, -1, -1, 21, -1, + 335, -1, 22, -1, 334, 13, 335, -1, 169, 336, + -1, -1, 19, 169, -1, 36, 169, -1, -1, -1, + 337, 10, 21, 338, 334, -1, 340, -1, 34, -1, + 341, -1, 340, 13, 341, -1, 169, 342, -1, -1, + 19, 169, -1, -1, 345, 351, -1, -1, 346, -1, + 347, -1, 346, 347, -1, 348, 10, -1, 343, 286, + 350, -1, 349, -1, 326, 346, 327, 169, 329, -1, + -1, 32, -1, 352, -1, 351, 352, -1, 238, 10, + -1, 14, 339, 15, 238, 10, -1, 360, 362, -1, + 386, -1, 390, -1, -1, 51, 354, 355, -1, 424, + -1, -1, 355, 356, -1, 70, 357, 382, -1, -1, + 9, -1, -1, 10, -1, 397, -1, 418, -1, 388, + 361, 52, -1, -1, 43, 52, 44, -1, -1, 362, + 363, -1, 295, -1, 9, 323, -1, 364, -1, 129, + -1, 116, 9, 169, -1, 115, 9, 238, -1, 114, + 9, 169, -1, 113, 365, 232, 231, 403, 366, 405, + -1, 105, 238, -1, 106, -1, -1, 238, -1, 116, + -1, 114, -1, 115, -1, 43, 368, 369, 13, 376, + 44, -1, -1, 370, 372, -1, 375, -1, 385, 28, + 371, -1, 373, -1, 40, -1, 38, -1, 34, -1, + -1, 372, 373, -1, 374, 375, -1, 20, -1, 19, + -1, 382, -1, 84, 382, -1, 377, 379, -1, 381, + -1, 385, 28, 378, -1, 37, -1, 32, -1, 40, + -1, -1, 379, 380, -1, 374, 381, -1, 382, -1, + 169, -1, 169, 28, 383, -1, 28, 384, -1, -1, + 384, -1, 8, -1, 323, -1, 388, 57, 387, 367, + 58, 367, 389, -1, -1, -1, 56, -1, -1, 23, + 230, 233, 238, -1, 388, 61, 391, 396, 58, 396, + 392, -1, -1, 58, 393, -1, 60, 394, -1, 396, + -1, 393, 58, 396, -1, 395, -1, 394, 13, 395, + -1, 296, 382, -1, 367, -1, 398, 12, 408, -1, + 401, 403, 404, 333, 334, 405, -1, 388, 120, 403, + 333, 334, 405, -1, 399, 400, -1, 126, -1, 247, + -1, 22, -1, 402, -1, 232, 81, -1, 122, -1, + 124, -1, 119, -1, 121, -1, 94, -1, -1, 43, + 169, 44, -1, -1, 123, -1, -1, 69, 406, -1, + 169, 407, -1, 19, 169, 407, -1, -1, 138, -1, + 409, -1, 408, 409, -1, 410, 412, 413, 414, 10, + -1, 382, 411, -1, -1, 43, 19, 169, 44, -1, + -1, 14, 374, 382, 15, -1, -1, 59, -1, 238, + -1, -1, 125, 415, -1, 382, 416, -1, -1, 30, + 417, -1, -1, 20, 382, -1, 95, 419, 420, 12, + 423, -1, -1, 103, -1, 104, -1, 421, 422, -1, + 167, -1, 167, 168, -1, -1, 58, 167, -1, 58, + 167, 168, -1, 382, 10, -1, 423, 382, 10, -1, + 426, 427, 238, -1, 425, 427, 238, -1, 50, -1, + 63, -1, -1, 64, -1, 367, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short yyrline[] = +{ + 0, 245, 245, 247, 251, 253, 256, 259, 262, 275, + 278, 281, 284, 290, 302, 308, 314, 318, 322, 338, + 343, 351, 361, 367, 374, 533, 538, 545, 560, 569, + 572, 578, 583, 586, 588, 592, 610, 625, 631, 637, + 647, 646, 650, 657, 663, 673, 679, 685, 693, 696, + 702, 707, 713, 719, 734, 740, 743, 773, 772, 785, + 795, 800, 805, 815, 826, 836, 867, 873, 879, 889, + 903, 912, 918, 931, 944, 950, 953, 957, 963, 966, + 972, 977, 976, 982, 1037, 1054, 1060, 1064, 1070, 1076, + 1082, 1088, 1094, 1101, 1104, 1107, 1111, 1119, 1125, 1137, + 1143, 1150, 1156, 1163, 1166, 1172, 1175, 1178, 1182, 1190, + 1209, 1217, 1225, 1233, 1244, 1250, 1256, 1262, 1281, 1287, + 1293, 1299, 1305, 1327, 1331, 1330, 1336, 1342, 1341, 1347, + 1353, 1359, 1382, 1394, 1402, 1405, 1409, 1426, 1432, 1438, + 1443, 1452, 1462, 1501, 1507, 1513, 1523, 1530, 1536, 1543, + 1551, 1556, 1564, 1570, 1582, 1591, 1597, 1609, 1627, 1638, + 1651, 1669, 1681, 1684, 1709, 1715, 1722, 1728, 1736, 1742, + 1749, 1755, 1765, 1770, 1776, 1781, 1798, 1803, 1809, 1815, + 1818, 1822, 1841, 1846, 1852, 1857, 1862, 1867, 1873, 1881, + 1901, 1920, 2010, 2018, 2025, 2028, 2031, 2034, 2037, 2040, + 2043, 2046, 2049, 2052, 2055, 2058, 2061, 2064, 2067, 2070, + 2073, 2076, 2079, 2082, 2085, 2088, 2091, 2094, 2097, 2100, + 2103, 2106, 2110, 2120, 2134, 2152, 2187, 2193, 2198, 2203, + 2210, 2212, 2216, 2219, 2224, 2229, 2234, 2241, 2247, 2251, + 2258, 2265, 2274, 2282, 2284, 2291, 2299, 2305, 2315, 2328, + 2350, 2353, 2359, 2361, 2365, 2368, 2412, 2415, 2419, 2422, + 2426, 2435, 2441, 2447, 2454, 2457, 2461, 2471, 2488, 2491, + 2506, 2512, 2517, 2522, 2528, 2532, 2540, 2547, 2554, 2558, + 2560, 2564, 2570, 2573, 2576, 2579, 2595, 2611, 2622, 2649, + 2660, 2683, 2689, 2695, 2709, 2715, 2721, 2723, 2727, 2730, + 2734, 2737, 2750, 2771, 2786, 2799, 2809, 2814, 2821, 2823, + 2827, 2841, 2849, 2853, 2860, 2867, 2874, 2881, 2891, 2904, + 2914, 2925, 2931, 2937, 2965, 2971, 3001, 3010, 3021, 3026, + 3043, 3069, 3108, 3114, 3118, 3132, 3154, 3159, 3172, 3177, + 3184, 3204, 3209, 3215, 3222, 3234, 3239, 3243, 3247, 3266, + 3282, 3300, 3332, 3350, 3363, 3382, 3386, 3388, 3392, 3398, + 3404, 3429, 3435, 3443, 3450, 3452, 3459, 3471, 3483, 3498, + 3518, 3525, 3537, 3548, 3560, 3572, 3578, 3588, 3597, 3606, + 3622, 3628, 3637, 3653, 3659, 3665, 3674, 3680, 3694, 3699, + 3717, 3723, 3729, 3734, 3740, 3745, 3751, 3757, 3764, 3771, + 3777, 3783, 3795, 3806, 3811, 3818, 3823, 3830, 3837, 3844, + 3853, 3860, 3864, 3867, 3871, 3883, 3893, 3898, 3906, 3913, + 3920, 3927, 3934, 3941, 3948, 3954, 3960, 3966, 3973, 3980, + 3992, 3998, 4003, 4008, 4017, 4024, 4030, 4034, 4039, 4043, + 4050, 4056, 4058, 4068, 4072, 4079, 4086, 4096, 4103, 4107, + 4106, 4110, 4115, 4126, 4131, 4136, 4144, 4150, 4156, 4166, + 4177, 4183, 4187, 4189, 4193, 4196, 4217, 4222, 4228, 4234, + 4241, 4243, 4247, 4258, 4264, 4356, 4359, 4364, 4362, 4436, + 4440, 4443, 4447, 4474, 4476, 4480, 4482, 4486, 4489, 4493, + 4545, 4551, 4561, 4563, 4567, 4575, 4586, 4618, 4629, 4636, + 4642, 4647, 4657, 4665, 4677, 4687, 4694, 4703, 4712, 4721, + 4726, 4736, 4742, 4744, 4756, 4761, 4769, 4775, 4785, 4787, + 4790, 4793, 4798, 4804, 4809, 4824, 4827, 4829, 4842, 4847, + 4853, 4863, 4865, 4869, 4873, 4880, 4885, 4891, 4897, 4903, + 4907, 4912, 4915, 4936, 4943, 4948, 4952, 4958, 4964, 4975, + 4988, 4991, 4995, 4997, 5001, 5004, 5008, 5025, 5062, 5069, + 5076, 5090, 5099, 5106, 5109, 5116, 5125, 5149, 5161, 5167, + 5173, 5179, 5186, 5192, 5198, 5203, 5209, 5215, 5228, 5234, + 5247, 5252, 5258, 5261, 5265, 5272, 5280, 5285, 5291, 5296, + 5302, 5307, 5319, 5325, 5329, 5334, 5352, 5357, 5363, 5368, + 5374, 5377, 5382, 5389, 5396, 5400, 5407, 5414, 5416, 5423, + 5430, 5436, 5442, 5452, 5463, 5469, 5472, 5479, 5486 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE +/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "T_SCORE", "T_STAFF", "T_VOICE", "T_GRIDS", + "T_BLOCKHEAD", "T_NUMBER", "T_EQUAL", "T_SEMICOLON", "T_NEWLINE", + "T_COLON", "T_COMMA", "T_LBRACKET", "T_RBRACKET", "T_LBRACE", + "T_RBRACE", "T_VARIABLE", "T_DASH", "T_PLUS", "T_PLACE", "T_ALL", + "T_WITH", "T_CUE", "T_GRACE", "T_XNOTE", "T_DIAM", "T_DOT", + "T_MULTIWHOLE", "T_LET_M", "T_LET_R", "T_LET_S", "T_LET_U", "T_PITCH", + "T_SHARP", "T_AMPERSAND", "T_LET_N", "T_LET_X", "T_DBLFLAT", "T_LETTER", + "T_LYRICS", "T_PAD", "T_LPAREN", "T_RPAREN", "T_LVAR", "T_MUSIC", + "T_HEADSHAPES", "T_HS", "T_SWINGUNIT", "T_POSTSCRIPT", "T_SCOREFEED", + "T_BARTYPE", "T_HAT", "T_TILDE", "T_QUESTION", "T_LINETYPE", "T_LINE", + "T_TO", "T_STAR", "T_BULGE", "T_CURVE", "T_TIE", "T_PRINTTYPE", "T_NL", + "T_STAFFLINES", "T_FFAMILY", "T_PARAGRAPH", "T_PARATYPE", "T_NUMVAR", + "T_FNUMVAR", "T_2FNUMVAR", "T_RATNUMLISTVAR", "T_RANGELISTVAR", + "T_TIMEUNIT", "T_FONTVAR", "T_STRVAR", "T_CLEFVAR", "T_VVAR", + "T_BARSTLISTVAR", "T_SCORESEP", "T_FONT", "T_SLASH", "T_KEY", "T_TIME", + "T_CUT", "T_COMMON", "T_CLEF", "T_MULTIREST", "T_YESNOVAR", "T_BM", + "T_ESBM", "T_EBM", "T_INVISBAR", "T_OCTAVE", "T_ROLL", "T_VISVAR", + "T_WHEREUSED", "T_UNSET", "T_VCOMBINE", "T_VCOMBVAL", "T_SCOREPAD", + "T_WORD", "T_UP", "T_DOWN", "T_ENDING", "T_ENDENDING", "T_FAMILY", + "T_ENDSTYLE", "T_ENDTYPE", "T_SLASHMARK", "T_ALT", "T_TITLE", + "T_REHEARSAL", "T_NUM", "T_LET", "T_MNUM", "T_TRANSPOSE", "T_XPOS_INT", + "T_PEDAL", "T_PHRASE", "T_MUSSYM", "T_L_ANGLE", "T_MODIFIER", + "T_R_ANGLE", "T_TIL", "T_MIDI", "T_PEDSTYLE", "T_PEDSTAR", + "T_HIDECHANGES", "T_SLUR", "T_UNITS", "T_CENTIMETERS", "T_UNITTYPE", + "T_TAB", "T_TICKS", "T_NOWHERE_SLIDE", "T_LEN", "T_EXCLAM", + "T_OTHERTEXT", "T_ORDER", "T_GRIDPLACE", "T_GRPLVALUE", "T_DRUM", + "T_RPT", "T_STRING", "T_HO", "T_REH_STYLE", "T_REHTYPE", "T_L_DBLANGLE", + "T_R_DBLANGLE", "T_SLOPE", "T_PSVAR", "T_PAGESIZE", "T_ORIENTATION", + "$accept", "song", "item", "context", "ssv_context", "alloc_ssv", + "new_context", "blockhead_context", "music_context", "grid_context", + "stringpair", "headshape_context", "staffnum", "voicenum", "num", + "assignment", "terminator", "assign", "@1", "@2", "visval", + "vschemetype", "allocbeamlist", "ratnumlist", "nonempty_ratnumlist", + "subbeam", "@3", "time_item", "swing_time", "opt_rs", "alloc_rangelist", + "rangelist", "rangeitem", "rangetail", "grplabel", "optlabel2", + "glabel", "alloc_barstlist", "barstlist", "barst_item", "mark_order", + "orderlist", "orderitem", "marktype", "timesig", "tsiglist", "@4", + "meas_tsig", "@5", "fraction", "numerator", "numerator_value", + "opt_ts_visibility", "opt_n", "keyspec", "stafflinedef", + "tab_string_list", "tab_item", "opt_str_acc", "opt_ticks", "flagval", + "minscsep", "maxscsep", "minscpad", "maxscpad", "pagesize", + "orientation", "vcombine_value", "opt_vcombine_qualifier", "end_type", + "updown", "majmin", "pedstyle", "transpose_interval", "title", "tfont", + "title_font", "font_family", "title_size", "titleA", "paragraph", + "opt_paratype", "paramname", "string", "noteinfo", "init_staff", + "sv_spec", "sv_map_list", "sv_map_entry", "map_start", "map_finish", + "sv_map_item_list", "voice_id", "sv_and", "sv_item", "notecolon", + "grp_stafflist", "grp_staff_item", "grp_staff_range", "voice_spec", + "voice_tail", "groupinfo", "groupdata", "mid_meas_param", + "mid_meas_list", "mid_meas_item", "mm_context", "mm_params", + "mm_param_item", "grp_attributes", "styleinfo", "gtc", + "extra_styleinfo", "alloc_grpsyl", "marklist", "marklistA", "markitem", + "hor_offset", "opt_plus_or_minus", "other_attr", "attr_list", + "attr_item", "alloc_marklist", "opt_dir", "marks", "mark", "mark_item", + "shorthand_mark", "notetype", "dir", "beammark", "time_val", + "crossbeam", "basic_time_val", "opt_more_time", "more_time_item", + "alloc_timelist", "opt_m", "dots", "padding", "padspec", "opt_minus", + "group", "special_group", "extra_attr", "spec_grp_alloc", "extra_item", + "note_opts", "notelist", "opt_other_staff", "css_with", "some_notes", + "notedata", "notedata1", "opt_bend", "pitch", "opt_accidental", + "opt_octave", "acc_symbol", "octave", "minuslist", "pluslist", + "slur_item", "start_slur", "slurlist", "fullslurlist", "slurnote", + "grp_locsave", "loc_variable", "ntuplet", "printtup", "start_tuplet", + "rbrace", "opt_side", "opt_time", "lyricinfo", "lyric_id", + "lyr_opt_place", "opt_place", "staff_list", "staff_item", "staff_range", + "more_lyric_ids", "@6", "verse_spec", "verselist", "verse_item", + "verse_range", "alloc_lyr_grpsyl", "lyricdata", "lyr_tlist", + "lyrics_timelist", "lyr_time_item", "lyr_tm", "lyrtuplet", "opt_space", + "lyr_verse", "verse_string", "os_directive", "@7", "opt_temp_margin", + "temp_margin", "opt_equals", "opt_semi", "directive", "barinfo", + "precbartype", "bar_items", "bar_opt", "ending_info", "chk_dup_reh", + "rehearsal_mark", "location", "alloc_loc", "xcoord", "xterm", + "east_or_west", "xoffsetlist", "xoffset", "plus_or_minus", "xoffsetval", + "ycoord", "yterm", "north_or_south", "yoffsetlist", "yoffset", + "yoffsetval", "floatnum", "opt_decimal_part", "numstr", "variable", + "line", "line_alloc", "linetype", "opt_line_str", "curve", + "curve_alloc", "curve_tail", "loc_list", "bulgelist", "bulge_value", + "curve_loc", "stuff_info", "stuff_header", "midi", "midi_staff", + "stuff_id", "stuff_type", "opt_size", "opt_modifier", "opt_dist", + "stuff_dist", "opt_exclam", "stufflist", "stuff_item", "beat_offset", + "gracebackup", "steps_offset", "opt_string", "til_clause", "til_val", + "til_suffix", "til_offset", "roll_cmd", "opt_roll_dir", "roll_extent", + "roll_start", "roll_end", "roll_offsetlist", "printcmd", "postscript", + "printtype", "opt_loc", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned short yyr1[] = +{ + 0, 155, 156, 156, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 158, 158, 158, 158, 158, 159, + 159, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 171, 172, 172, 172, 172, 172, + 173, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 174, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 175, 175, + 175, 176, 176, 176, 177, 178, 178, 179, 179, 179, + 179, 181, 180, 182, 182, 183, 183, 184, 184, 184, + 184, 184, 185, 186, 186, 186, 187, 188, 188, 189, + 189, 190, 190, 191, 192, 193, 193, 193, 194, 195, + 196, 196, 196, 197, 198, 198, 198, 198, 198, 198, + 198, 198, 199, 200, 201, 200, 202, 203, 202, 204, + 204, 204, 204, 204, 205, 205, 206, 207, 207, 208, + 208, 209, 209, 210, 210, 210, 210, 211, 211, 212, + 213, 213, 214, 214, 215, 215, 216, 217, 217, 218, + 219, 219, 220, 220, 221, 221, 222, 222, 223, 223, + 224, 224, 225, 225, 226, 226, 227, 227, 227, 228, + 229, 230, 231, 231, 232, 232, 233, 233, 234, 234, + 234, 235, 236, 236, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 238, 238, 239, 239, 239, 240, 241, 241, + 242, 242, 243, 244, 245, 246, 246, 247, 247, 248, + 249, 249, 250, 251, 251, 252, 253, 253, 254, 254, + 255, 255, 256, 256, 257, 257, 258, 258, 259, 259, + 260, 261, 261, 261, 262, 262, 263, 263, 264, 265, + 265, 265, 266, 266, 267, 267, 268, 269, 269, 270, + 270, 271, 271, 271, 271, 271, 271, 271, 271, 271, + 271, 272, 272, 272, 273, 273, 274, 274, 275, 275, + 276, 276, 276, 276, 276, 277, 278, 278, 279, 279, + 280, 281, 281, 282, 282, 282, 282, 283, 283, 283, + 283, 284, 284, 285, 285, 285, 286, 286, 287, 287, + 288, 288, 289, 289, 290, 291, 292, 292, 293, 293, + 294, 295, 296, 296, 297, 297, 298, 299, 300, 301, + 301, 301, 301, 301, 301, 301, 302, 302, 303, 304, + 304, 305, 306, 306, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, 309, 309, + 310, 311, 311, 312, 312, 313, 313, 313, 313, 313, + 314, 314, 314, 315, 315, 316, 316, 317, 318, 319, + 319, 319, 320, 320, 321, 322, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 324, 325, 325, 325, 325, + 326, 327, 328, 328, 329, 329, 330, 331, 332, 333, + 333, 334, 334, 334, 335, 336, 336, 336, 337, 338, + 337, 339, 339, 340, 340, 341, 342, 342, 343, 344, + 345, 345, 346, 346, 347, 348, 348, 349, 350, 350, + 351, 351, 352, 352, 353, 353, 353, 354, 353, 353, + 355, 355, 356, 357, 357, 358, 358, 359, 359, 360, + 361, 361, 362, 362, 363, 363, 363, 363, 363, 363, + 363, 363, 364, 364, 365, 366, 366, 366, 366, 367, + 368, 369, 370, 370, 370, 371, 371, 371, 372, 372, + 373, 374, 374, 375, 375, 376, 377, 377, 378, 378, + 378, 379, 379, 380, 381, 382, 382, 382, 383, 383, + 384, 385, 386, 387, 388, 388, 389, 389, 390, 391, + 392, 392, 393, 393, 394, 394, 395, 396, 397, 398, + 398, 398, 399, 400, 400, 401, 402, 402, 402, 402, + 402, 402, 403, 403, 404, 404, 405, 405, 406, 406, + 407, 407, 408, 408, 409, 410, 411, 411, 412, 412, + 413, 413, 413, 414, 414, 415, 416, 416, 417, 417, + 418, 419, 419, 419, 420, 421, 421, 422, 422, 422, + 423, 423, 424, 424, 425, 426, 427, 427, 427 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 1, 2, 1, 1, 1, 1, 2, 2, + 1, 3, 1, 2, 1, 1, 1, 1, 2, 2, + 3, 4, 1, 0, 1, 1, 1, 3, 1, 1, + 1, 1, 2, 1, 1, 4, 2, 3, 5, 4, + 0, 4, 4, 4, 5, 4, 4, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 2, 0, 4, 3, + 4, 4, 3, 3, 3, 5, 3, 3, 1, 1, + 1, 0, 1, 1, 0, 0, 1, 1, 1, 3, + 3, 0, 4, 4, 1, 0, 1, 0, 2, 2, + 1, 1, 0, 0, 1, 3, 3, 0, 2, 0, + 4, 0, 2, 1, 0, 0, 1, 3, 2, 1, + 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 1, 0, 3, 1, 0, 4, 1, + 1, 3, 3, 1, 1, 3, 1, 0, 1, 0, + 1, 3, 3, 2, 2, 1, 4, 1, 2, 4, + 0, 1, 0, 1, 1, 1, 1, 0, 2, 2, + 0, 3, 1, 2, 0, 1, 0, 2, 0, 1, + 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, + 6, 2, 0, 1, 0, 1, 0, 3, 1, 2, + 3, 7, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 4, 3, 1, 0, 1, 1, + 1, 2, 3, 1, 1, 1, 3, 1, 3, 1, + 1, 2, 1, 1, 3, 2, 0, 2, 2, 4, + 0, 2, 1, 2, 1, 5, 0, 1, 1, 2, + 4, 1, 1, 1, 1, 3, 3, 3, 2, 1, + 4, 6, 0, 3, 0, 4, 0, 0, 1, 1, + 3, 3, 1, 1, 1, 1, 3, 2, 2, 2, + 2, 1, 1, 2, 0, 1, 0, 1, 1, 3, + 1, 3, 2, 2, 2, 0, 0, 1, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 1, 1, 0, 1, 0, 3, + 1, 1, 0, 2, 4, 0, 0, 1, 0, 2, + 1, 3, 0, 1, 1, 1, 2, 2, 0, 1, + 2, 2, 3, 2, 2, 1, 0, 2, 2, 0, + 3, 1, 0, 3, 1, 1, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 3, 2, 5, 5, 3, + 5, 7, 4, 4, 6, 4, 5, 4, 0, 1, + 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 1, 2, 4, 1, 0, + 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 8, 0, 1, 1, 1, + 1, 1, 0, 1, 0, 2, 4, 3, 1, 0, + 1, 1, 1, 3, 2, 0, 2, 2, 0, 0, + 5, 1, 1, 1, 3, 2, 0, 2, 0, 2, + 0, 1, 1, 2, 2, 3, 1, 5, 0, 1, + 1, 2, 2, 5, 2, 1, 1, 0, 3, 1, + 0, 2, 3, 0, 1, 0, 1, 1, 1, 3, + 0, 3, 0, 2, 1, 2, 1, 1, 3, 3, + 3, 7, 2, 1, 0, 1, 1, 1, 1, 6, + 0, 2, 1, 3, 1, 1, 1, 1, 0, 2, + 2, 1, 1, 1, 2, 2, 1, 3, 1, 1, + 1, 0, 2, 2, 1, 1, 3, 2, 0, 1, + 1, 1, 7, 0, 0, 1, 0, 4, 7, 0, + 2, 2, 1, 3, 1, 3, 2, 1, 3, 6, + 6, 2, 1, 1, 1, 1, 2, 1, 1, 1, + 1, 1, 0, 3, 0, 1, 0, 2, 2, 3, + 0, 1, 1, 2, 5, 2, 0, 4, 0, 4, + 0, 1, 1, 0, 2, 2, 0, 2, 0, 2, + 5, 0, 1, 1, 2, 1, 2, 0, 2, 3, + 2, 3, 3, 3, 1, 1, 0, 1, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned short yydefact[] = +{ + 0, 0, 23, 0, 0, 26, 24, 12, 439, 0, + 25, 28, 0, 614, 477, 545, 615, 0, 185, 193, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 571, 601, 0, 0, + 0, 0, 0, 0, 184, 0, 569, 570, 567, 568, + 562, 0, 0, 109, 222, 0, 0, 0, 2, 4, + 14, 15, 23, 16, 10, 17, 5, 0, 0, 6, + 0, 7, 0, 0, 0, 0, 226, 485, 0, 492, + 475, 490, 476, 487, 0, 0, 572, 565, 488, 479, + 616, 616, 13, 19, 22, 31, 23, 29, 0, 440, + 0, 0, 438, 342, 85, 480, 0, 36, 0, 0, + 74, 92, 57, 0, 0, 0, 0, 104, 0, 0, + 0, 485, 0, 602, 603, 0, 0, 200, 199, 197, + 194, 202, 203, 216, 211, 198, 219, 218, 221, 208, + 201, 196, 213, 214, 195, 217, 209, 210, 220, 205, + 215, 207, 204, 212, 206, 56, 40, 342, 0, 0, + 186, 182, 0, 0, 0, 0, 0, 1, 3, 18, + 33, 34, 32, 0, 566, 184, 0, 0, 8, 233, + 246, 0, 229, 230, 0, 228, 237, 240, 243, 486, + 0, 9, 474, 0, 543, 549, 572, 0, 0, 564, + 563, 561, 0, 574, 510, 617, 618, 0, 0, 20, + 23, 30, 458, 442, 445, 448, 441, 343, 0, 330, + 84, 331, 86, 59, 338, 478, 145, 139, 50, 0, + 0, 535, 37, 0, 75, 93, 0, 51, 67, 53, + 71, 105, 156, 157, 390, 0, 48, 391, 133, 129, + 130, 136, 49, 124, 123, 126, 0, 134, 225, 155, + 154, 54, 605, 0, 607, 70, 69, 68, 55, 166, + 160, 0, 52, 171, 170, 62, 0, 0, 183, 181, + 172, 173, 0, 176, 0, 178, 64, 66, 63, 162, + 164, 0, 118, 115, 119, 120, 121, 114, 117, 116, + 47, 110, 113, 186, 223, 27, 0, 245, 242, 256, + 231, 0, 235, 239, 0, 0, 250, 241, 11, 0, + 342, 0, 503, 504, 0, 0, 0, 497, 494, 493, + 496, 0, 0, 0, 439, 489, 586, 558, 582, 588, + 0, 575, 439, 0, 613, 612, 21, 430, 458, 326, + 436, 0, 458, 462, 0, 466, 0, 0, 444, 0, + 437, 42, 332, 483, 481, 0, 140, 144, 143, 35, + 540, 537, 538, 0, 81, 87, 76, 78, 77, 97, + 45, 94, 58, 72, 73, 43, 97, 46, 106, 0, + 60, 395, 396, 397, 398, 399, 174, 174, 392, 0, + 122, 138, 127, 0, 0, 606, 0, 0, 604, 41, + 168, 342, 61, 159, 0, 485, 188, 179, 0, 177, + 165, 39, 163, 0, 0, 0, 247, 0, 256, 252, + 276, 257, 258, 254, 256, 0, 234, 232, 238, 244, + 0, 0, 248, 418, 419, 420, 421, 417, 422, 423, + 416, 424, 495, 0, 502, 184, 0, 0, 0, 491, + 0, 557, 0, 0, 0, 585, 583, 0, 590, 573, + 0, 522, 521, 0, 541, 0, 518, 514, 0, 512, + 523, 0, 458, 327, 468, 0, 0, 459, 470, 463, + 464, 446, 447, 443, 0, 339, 336, 484, 0, 0, + 147, 150, 536, 539, 38, 0, 91, 90, 44, 0, + 0, 99, 0, 108, 0, 158, 175, 141, 142, 125, + 0, 132, 135, 131, 0, 600, 608, 169, 167, 0, + 187, 0, 189, 65, 111, 112, 485, 261, 262, 263, + 0, 253, 276, 362, 326, 269, 259, 256, 236, 251, + 250, 341, 182, 500, 499, 498, 0, 0, 576, 0, + 0, 591, 592, 593, 576, 524, 0, 511, 520, 0, + 431, 0, 469, 465, 452, 456, 0, 451, 453, 472, + 471, 449, 337, 333, 83, 335, 482, 146, 148, 152, + 151, 0, 88, 89, 80, 79, 98, 0, 96, 95, + 107, 128, 610, 0, 609, 161, 180, 190, 0, 0, + 0, 0, 264, 0, 277, 296, 345, 356, 0, 344, + 359, 268, 432, 249, 572, 546, 0, 0, 560, 0, + 0, 0, 0, 559, 0, 531, 526, 534, 0, 519, + 517, 516, 515, 513, 434, 0, 455, 0, 0, 0, + 0, 153, 393, 82, 101, 103, 611, 191, 0, 0, + 0, 260, 276, 0, 305, 317, 318, 320, 319, 0, + 342, 321, 322, 0, 0, 294, 0, 278, 279, 283, + 285, 284, 340, 282, 306, 328, 324, 325, 0, 306, + 342, 0, 297, 298, 300, 346, 0, 0, 0, 306, + 349, 408, 347, 355, 409, 361, 370, 365, 366, 0, + 0, 369, 372, 373, 374, 371, 368, 358, 362, 356, + 364, 388, 433, 0, 0, 184, 542, 0, 342, 548, + 0, 580, 577, 587, 589, 596, 594, 584, 509, 525, + 0, 0, 467, 457, 0, 454, 450, 338, 403, 405, + 400, 149, 394, 401, 402, 0, 0, 267, 266, 265, + 270, 415, 0, 288, 0, 290, 289, 292, 291, 287, + 0, 295, 0, 272, 304, 307, 0, 323, 302, 303, + 0, 255, 0, 357, 351, 354, 353, 393, 350, 410, + 393, 0, 411, 412, 367, 0, 0, 363, 0, 393, + 389, 376, 152, 391, 426, 507, 508, 506, 505, 576, + 186, 550, 552, 0, 551, 554, 580, 581, 578, 598, + 595, 0, 532, 529, 528, 530, 527, 435, 473, 334, + 404, 406, 102, 100, 314, 313, 316, 315, 312, 281, + 308, 310, 311, 286, 293, 280, 0, 274, 0, 301, + 299, 352, 414, 306, 413, 375, 360, 379, 0, 0, + 0, 388, 0, 393, 0, 388, 427, 429, 428, 434, + 501, 0, 0, 556, 342, 579, 0, 597, 533, 0, + 0, 271, 329, 407, 393, 388, 0, 383, 382, 0, + 388, 387, 0, 385, 0, 547, 553, 555, 599, 309, + 273, 277, 377, 378, 388, 0, 380, 386, 425, 0, + 384, 388, 275, 381 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const short yydefgoto[] = +{ + -1, 57, 58, 59, 60, 93, 94, 61, 62, 63, + 64, 65, 180, 316, 231, 66, 172, 67, 269, 236, + 268, 385, 234, 375, 376, 377, 505, 378, 223, 508, + 235, 380, 381, 511, 598, 756, 654, 241, 387, 388, + 68, 300, 301, 302, 252, 253, 399, 254, 520, 255, + 256, 257, 400, 368, 246, 228, 499, 500, 589, 652, + 261, 243, 390, 270, 412, 290, 421, 409, 528, 275, + 282, 517, 286, 418, 69, 160, 279, 161, 277, 415, + 71, 72, 155, 800, 74, 75, 181, 182, 183, 184, + 437, 311, 185, 314, 186, 309, 187, 188, 307, 317, + 442, 428, 429, 430, 431, 432, 540, 611, 612, 543, + 544, 847, 881, 545, 676, 677, 678, 769, 770, 691, + 692, 693, 762, 774, 839, 840, 841, 842, 679, 775, + 694, 484, 777, 224, 496, 583, 650, 584, 362, 681, + 682, 813, 615, 616, 617, 618, 783, 695, 619, 717, + 718, 620, 719, 720, 801, 721, 397, 751, 398, 752, + 753, 754, 703, 704, 791, 792, 793, 683, 474, 433, + 869, 348, 571, 723, 742, 76, 100, 101, 102, 215, + 216, 358, 360, 649, 576, 577, 578, 646, 349, 350, + 351, 352, 353, 354, 355, 573, 487, 488, 77, 105, + 225, 364, 498, 190, 78, 79, 197, 192, 329, 330, + 455, 809, 461, 343, 475, 476, 643, 567, 477, 478, + 479, 634, 635, 826, 739, 822, 636, 336, 502, 371, + 481, 80, 332, 81, 726, 82, 333, 729, 811, 814, + 815, 462, 83, 84, 85, 201, 86, 87, 203, 342, + 628, 732, 818, 337, 338, 339, 465, 468, 563, 632, + 736, 820, 877, 88, 125, 263, 264, 408, 525, 89, + 90, 91, 207 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -693 +static const short yypact[] = +{ + 997, 49, -693, 101, 101, -693, -693, -693, 43, 116, + -693, -693, 143, -693, -693, -693, -693, 158, -693, -693, + 199, 215, 254, 284, 296, 315, 372, 401, 410, 419, + 421, 422, 424, 426, 101, 427, -693, 244, 431, 732, + 432, 433, 435, 436, 236, 438, -693, -693, -693, -693, + -693, 439, 440, -693, -693, 441, 443, 847, -693, -693, + -693, -693, -693, -693, -693, -693, -693, 378, 445, -693, + 123, -693, 324, 26, 384, 309, -693, 446, 447, -693, + -693, 69, -693, -693, 451, 245, 414, -693, -693, -693, + 32, 32, -693, -693, -693, -693, -693, -693, 101, -693, + 454, 278, -693, 449, 210, -693, 41, 190, 182, 182, + -693, -693, -693, 381, 314, 383, 101, -693, 101, 70, + 51, 446, 225, -693, -693, 101, 57, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, 449, 405, 44, + 430, 393, 295, 94, 344, 333, 29, -693, -693, -693, + -693, -693, -693, 371, -693, 236, 335, 68, -693, -693, + 464, 489, 490, -693, 101, 467, -693, 353, -693, -693, + 494, -693, 114, 456, -693, -693, 414, 462, 182, -693, + 467, -693, 101, 390, -693, -693, -693, 314, 314, -693, + -693, -693, 28, -693, 124, 502, -693, -693, 182, -693, + -693, -693, -693, -693, -693, 448, 473, 15, -693, 101, + 511, 493, -693, 507, 207, 101, 210, -693, 504, -693, + 293, 101, -693, 512, -693, 492, -693, 492, -693, -693, + -693, -693, -693, 332, 515, -693, 50, -693, -693, -693, + -693, -693, 101, 520, 479, -693, -693, -693, -693, 101, + 525, 101, -693, -693, -693, -693, 101, 314, -693, -693, + -693, -693, 425, -693, 411, -693, -693, -693, -693, -693, + 395, 101, -693, -693, -693, -693, -693, -693, -693, -693, + 56, -693, -693, 430, -693, -693, 101, -693, -693, 21, + -693, 358, 467, -693, 101, 101, 338, -693, -693, 575, + 449, 314, -693, -693, 544, 549, 551, -693, -693, -693, + -693, 519, 521, 521, 43, -693, 522, 182, -693, 552, + 526, -693, 43, 514, 504, 504, -693, -693, 553, 210, + -693, 24, 31, -693, 561, -693, 101, 101, -693, 101, + 562, -693, 545, 565, -693, 550, -693, -693, -693, -693, + -693, -693, 511, 182, -693, 377, 572, -693, -693, 567, + 581, -693, -693, -693, -693, -693, 567, 587, -693, 101, + -693, -693, -693, -693, -693, -693, 484, 484, -693, 51, + -693, -693, -693, 85, 101, -693, 182, 101, -693, -693, + 503, 449, -693, -693, 566, 446, 26, -693, 101, -693, + -693, -693, -693, 371, 371, 314, -693, 374, 25, -693, + 597, 465, -693, -693, 21, 101, -693, -693, -693, -693, + 101, 101, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, -693, 182, 504, 236, 101, 314, 101, -693, + 558, -693, 560, 278, 598, -693, -693, 386, -5, -693, + 278, -693, -693, 182, -693, 606, -693, -693, 103, -693, + -693, 594, 397, -693, 591, 73, 234, 24, -693, -693, + -693, -693, -693, -693, 604, -693, 289, -693, 182, 253, + -693, 492, -693, -693, -693, 207, 595, 599, -693, 207, + 101, 583, 101, -693, 101, -693, -693, -693, -693, 515, + 51, -693, -693, -693, 618, 182, 101, -693, -693, 101, + -693, 620, 26, -693, -693, -693, 286, -693, -693, -693, + 33, -693, 610, 80, 210, -693, -693, 17, 467, -693, + 619, -693, 393, -693, 504, -693, 521, 521, 52, 101, + 182, -693, 504, 508, 52, -693, 559, 386, -693, 336, + -693, 101, -693, -693, -693, 615, 621, 622, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, 505, + -693, 61, -693, -693, -693, -693, -693, 314, -693, -693, + -693, -693, -693, 627, -693, -693, -693, 504, 628, 629, + 632, 22, -693, 633, 138, 273, -693, -693, 91, -693, + 307, -693, 623, -693, 414, 630, 276, 198, -693, 608, + 635, 182, 644, -693, 612, -693, -693, -693, 631, -693, + -693, -693, -693, -693, 645, 101, -693, 314, 101, 278, + 100, -693, 227, -693, 647, 504, -693, -693, 101, 570, + 33, -693, -693, 575, -693, -693, -693, -693, -693, 314, + 449, -693, -693, 101, 182, 398, 375, -693, -693, -693, + -693, -693, -693, -693, 318, 638, -693, -693, 101, 318, + 449, 652, 650, -693, -693, 91, 575, 314, 37, 318, + -693, -693, -693, -693, 19, -693, -693, -693, -693, 634, + 550, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, 48, -693, 101, 162, 236, -693, 521, 449, -693, + 101, 527, -693, -693, -693, 637, -693, -693, -693, 386, + 312, 210, -693, -693, 308, -693, 502, -693, -693, -693, + -693, -693, -693, 649, 651, 314, 625, -693, -693, -693, + -693, -693, 71, 504, 101, -693, -693, 193, 195, -693, + 182, -693, 138, 636, -693, -693, 668, -693, -693, -693, + 182, -693, 273, -693, -693, 504, -693, 227, -693, -693, + 227, 554, 550, -693, -693, 639, 258, 91, 542, 237, + 504, -693, 14, 450, 36, -693, -693, -693, 504, 605, + 430, 617, -693, 182, 664, -693, 527, -693, -693, 660, + -693, 182, -693, -693, -693, -693, -693, -693, -693, 545, + -693, -693, -693, -693, -693, -693, -693, -693, 504, 671, + -693, -693, -693, -693, -693, -693, 653, -693, 665, -693, + -693, -693, -693, 318, -693, -693, -693, -693, 643, 646, + 227, 314, 550, 252, 461, 314, -693, -693, -693, 645, + -693, 314, 521, -693, 449, -693, 182, -693, -693, 71, + 663, 674, -693, -693, 227, 314, 648, -693, -693, 227, + 314, -693, 654, -693, 683, 504, -693, -693, -693, -693, + -693, 138, -693, -693, 314, 655, -693, -693, -693, 382, + -693, 314, -693, -693 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const short yypgoto[] = +{ + -693, -693, 640, -693, -693, -53, 641, -693, -693, -693, + -693, -693, 16, -83, -3, -693, -693, -693, -693, -693, + -693, -693, -693, -693, 189, 186, -693, -98, -693, -693, + -693, -693, 184, 316, -693, -693, -55, -693, -693, 191, + -693, -693, 3, -693, -693, -693, -693, 305, -693, 187, + -693, 303, -693, -693, -693, -693, -693, 209, -693, -93, + 457, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, 317, -693, -693, -693, -168, 159, 9, -298, -693, + -693, -693, -693, 4, -693, -693, -693, -693, 530, -693, + -693, -693, -64, -693, 399, -693, -693, 400, -693, -244, + 166, 283, -370, -693, -693, 288, -693, -693, 63, -693, + -693, -693, -693, -503, -180, -693, -48, -693, -693, -693, + -693, -57, -693, -659, -693, -153, -693, -693, -693, -587, + -693, 185, -693, 81, -693, -693, -693, -693, -15, -693, + 541, -95, -693, -693, -693, -693, 117, 18, -693, -693, + -693, 23, -693, 30, -591, -116, -69, -599, -243, -692, + -693, -693, -693, -693, -693, -693, -56, -693, -303, -693, + -693, -286, 192, -693, -127, -693, -693, -693, -13, -435, + 385, -693, -693, -693, -693, -693, 95, -693, -693, -693, + -693, 402, -304, -693, -693, -693, -693, 260, -693, -693, + -693, -693, -693, -111, -693, -693, -693, -693, -693, -693, + -693, -693, -77, -693, -693, -693, -693, -693, 178, -441, + 271, -693, -693, -693, -693, -693, -70, -91, -693, 380, + 188, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -121, -535, -693, -693, -693, -693, -693, -693, -185, -693, + -540, -693, -61, -693, 420, -693, -693, -693, -693, -693, + -693, -693, -693, -693, -693, -693, -693, -693, -693, -693, + -693, -693, 667 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, parse error. */ +#define YYTABLE_NINF -545 +static const short yytable[] = +{ + 97, 97, 396, 247, 73, 425, 222, 303, 218, 70, + 258, 334, 229, 206, 206, 210, 452, 232, 233, 96, + 98, 200, 626, 434, 633, 410, 560, 680, 558, 803, + 779, 121, 660, 347, 570, 564, -224, 347, 485, 614, + 788, 347, -460, 209, 347, -461, 176, 347, 489, 95, + 291, 273, 366, 244, 561, 585, 95, 862, 541, 95, + 92, 73, 271, 244, 99, 359, 70, 748, 749, 423, + 403, 244, 97, 866, 509, 204, 867, 177, 95, 305, + 248, 95, 97, 391, 392, 393, 394, 395, 176, -348, + 834, 798, 424, 95, 265, 211, 205, 266, 214, 835, + 696, 221, 609, 227, 244, 653, 859, 574, 95, 95, + 610, 95, 193, 240, 521, 242, 245, 251, 238, 786, + 312, 627, 97, 319, 836, 103, 194, 361, -348, 219, + 195, 230, 404, -348, -348, -348, 249, 250, 382, 697, + 54, 262, 434, 356, 698, 699, 700, 663, 434, 651, + 868, 283, 104, 274, 267, 789, 320, 346, 367, 760, + 357, 664, 665, 666, 667, 668, 427, 106, 886, 54, + 427, 54, 661, -460, 427, 226, -461, 541, 489, 405, + 320, 97, 289, 799, 211, 680, 669, 473, 851, 196, + 95, 852, 812, 54, 883, 837, 549, 905, -342, 340, + 861, -522, -348, -521, 174, 284, 95, 670, 107, 217, + 230, 344, 345, 701, 746, 95, 54, 730, 95, 321, + 322, -522, 285, -521, 108, 453, 369, 323, 324, 325, + 326, 221, 379, 221, 771, 95, 219, 220, 386, 219, + 220, 671, 672, 327, 579, 95, 748, 749, 673, 501, + 374, 483, 480, 95, 176, 460, 748, 749, 590, 211, + 95, 434, 259, 109, 890, 260, 211, 199, 413, 870, + 887, 748, 749, 414, 893, 674, 805, 806, 807, 856, + 860, 416, 504, 706, 675, 902, 95, 244, 422, 707, + 708, 709, 244, 110, 903, 889, 189, 587, 821, 906, + 213, 710, 18, 97, 531, 111, 176, 54, 471, 472, + 711, 97, 97, 910, 680, 524, 529, 95, 828, 582, + 913, 463, 426, 179, 112, 454, 712, 383, 176, 470, + 705, 713, 706, 384, 727, 684, 728, 896, 707, 708, + 709, 244, -137, -137, 823, 714, 221, 123, 124, 824, + 710, 440, 825, 491, 492, 486, 214, 441, 550, 711, + 761, 95, 551, 685, 686, 687, 315, 715, 435, 259, + 640, 548, 260, 436, 641, 712, 642, 537, 538, 539, + 713, 113, 565, 501, 688, 772, 515, 480, 170, 171, + 773, 175, 772, 784, 714, 178, 251, 912, 280, 281, + 251, 523, 716, 689, 97, 471, 472, 586, 506, 507, + 114, 595, 292, 347, 570, 533, 715, 767, 768, 115, + 532, 671, 672, 526, 690, 608, 534, 535, 116, 536, + 117, 118, 97, 119, 603, 120, 122, 211, 211, 724, + 126, 156, 157, 604, 158, 159, 483, 162, 163, 164, + 165, 716, 166, 553, 173, 555, 189, 202, 191, 54, + 214, 554, 237, 198, 552, 293, 212, 214, 217, 630, + 239, 272, 562, 276, 278, 637, 294, 287, 802, 625, + 304, 288, 575, 306, 295, 391, 392, 393, 394, 395, + 296, 486, 297, 864, 298, 244, 391, 392, 393, 394, + 395, 308, 221, 313, 179, 318, 221, 596, 331, 379, + 299, 386, 871, 341, 335, 359, 365, 251, 363, 370, + 373, 372, 95, 211, 176, 389, 605, 391, 392, 393, + 394, 395, 406, 471, 472, 402, 607, 407, 411, 419, + 735, 221, 230, 417, 443, 444, 445, 446, 447, 420, + 95, 448, 449, 456, 450, 858, 629, 810, 457, 451, + 458, 748, 749, 459, 204, 464, 467, 95, 644, 347, + 469, 490, 494, 495, 497, 764, 244, 391, 392, 393, + 394, 395, 787, 766, 244, 509, 510, 230, 790, 443, + 444, 445, 446, 447, 512, 780, 448, 449, 473, 450, + 514, 655, 516, 527, 451, 443, 444, 445, 446, 447, + 530, 542, 448, 449, 427, 450, 556, 559, 557, 566, + 451, 892, 569, 572, 731, 581, 597, 592, 602, 613, + 593, 606, 440, 631, 645, 648, 647, 656, 658, 657, + 651, 659, 743, 827, 722, 575, 214, 221, 662, 750, + 734, 744, 733, 725, 737, 757, 738, 758, 741, 740, + 755, 776, 781, 782, 846, 817, 794, 819, 830, 833, + 765, 831, 848, 763, 627, 872, 790, 874, 853, 844, + 876, 880, 857, 855, 879, 778, 882, 884, 901, 849, + 885, 900, 904, 908, 591, 594, 599, 168, 907, 911, + 832, 785, 513, 169, 519, 600, 522, 601, 588, 863, + 401, 624, 310, 438, 518, 439, 623, 547, 750, 546, + 804, 909, 873, 759, 845, 850, 899, 816, 808, 621, + 637, 747, 829, 328, 865, 702, 854, 797, 221, 622, + 795, 796, 894, 745, 493, 639, 888, 580, 891, 568, + 482, 878, 503, 897, 638, 875, 0, 466, 208, 655, + 0, 843, 0, 0, 0, 0, 838, 0, 0, 0, + 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 750, 898, 0, 750, 0, 0, + 0, 0, 0, 0, 0, 750, 750, 129, 0, 0, + 0, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 0, 0, 142, 143, 0, 0, 0, + 0, 144, 0, 0, 0, 0, 0, 0, 145, 0, + 0, 146, 0, 147, 0, 0, 0, 0, 0, 148, + 149, 0, 0, 0, 0, 0, 0, 167, 1, 150, + 2, 3, 4, 5, 6, -227, 0, 750, 7, 151, + 750, -227, 0, 152, 0, 0, 0, 0, 0, 0, + 0, 0, 153, 0, 0, 895, 0, 0, 0, 154, + 0, 750, 0, 838, 0, 0, 750, 0, 8, 9, + -544, 0, 0, 10, 11, 0, 12, 13, 14, -544, + 0, 0, 0, 15, -544, 0, 0, 0, -544, 0, + 16, 0, 17, 18, -192, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, -184, 0, + 32, 33, 0, 0, 0, 34, 35, 0, 0, 0, + 0, 36, 37, 38, 0, 39, 40, 0, 41, 0, + 0, 0, 0, 0, 42, 43, 0, 0, 0, 44, + 0, 0, 0, 0, 45, 0, 46, -544, 47, 48, + 0, 49, 0, 50, 51, 0, 0, 0, 52, 0, + 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, + 0, 0, 54, 0, 55, 0, 0, 0, 1, 56, + 2, 3, 4, 5, 6, -227, 0, 0, 7, 0, + 0, -227, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 8, 9, + -544, 0, 0, 10, 11, 0, 12, 13, 14, -544, + 0, 0, 0, 15, -544, 0, 0, 0, -544, 0, + 16, 0, 17, 18, -192, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, -184, 0, + 32, 33, 0, 0, 0, 34, 35, 0, 0, 0, + 0, 36, 37, 38, 0, 39, 40, 0, 41, 0, + 0, 0, 0, 0, 42, 43, 0, 0, 0, 44, + 0, 0, 0, 0, 45, 0, 46, -544, 47, 48, + 0, 49, 0, 50, 51, 0, 0, 0, 52, 0, + 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, + 0, 0, 54, 0, 55, 0, 0, 0, 0, 56 +}; + +static const short yycheck[] = +{ + 3, 4, 245, 119, 0, 303, 104, 175, 103, 0, + 121, 196, 107, 90, 91, 98, 319, 108, 109, 3, + 4, 85, 557, 309, 564, 269, 467, 614, 463, 721, + 689, 34, 10, 16, 17, 470, 11, 16, 14, 542, + 699, 16, 14, 96, 16, 14, 20, 16, 352, 8, + 166, 7, 37, 34, 59, 496, 8, 43, 428, 8, + 11, 57, 157, 34, 21, 13, 57, 19, 20, 13, + 20, 34, 75, 37, 13, 43, 40, 73, 8, 11, + 29, 8, 85, 35, 36, 37, 38, 39, 20, 9, + 19, 43, 36, 8, 37, 98, 64, 40, 101, 28, + 9, 104, 69, 106, 34, 44, 798, 34, 8, 8, + 77, 8, 43, 116, 29, 118, 119, 120, 114, 82, + 184, 69, 125, 9, 53, 9, 57, 218, 48, 29, + 61, 28, 82, 53, 54, 55, 85, 86, 236, 48, + 145, 125, 428, 19, 53, 54, 55, 9, 434, 135, + 114, 57, 9, 109, 97, 136, 42, 210, 143, 662, + 36, 23, 24, 25, 26, 27, 149, 9, 860, 145, + 149, 145, 150, 145, 149, 134, 145, 547, 482, 262, + 42, 184, 153, 135, 187, 772, 48, 84, 787, 120, + 8, 790, 727, 145, 853, 124, 440, 889, 8, 202, + 799, 8, 122, 8, 81, 111, 8, 69, 9, 19, + 28, 207, 208, 122, 649, 8, 145, 19, 8, 105, + 106, 28, 128, 28, 9, 320, 229, 113, 114, 115, + 116, 234, 235, 236, 675, 8, 29, 30, 241, 29, + 30, 103, 104, 129, 10, 8, 19, 20, 110, 365, + 43, 349, 343, 8, 20, 332, 19, 20, 501, 262, + 8, 547, 37, 9, 863, 40, 269, 22, 271, 809, + 861, 19, 20, 276, 865, 137, 114, 115, 116, 21, + 43, 277, 373, 25, 146, 884, 8, 34, 291, 31, + 32, 33, 34, 9, 885, 43, 10, 44, 739, 890, + 22, 43, 66, 306, 415, 9, 20, 145, 19, 20, + 52, 314, 315, 904, 901, 406, 411, 8, 10, 30, + 911, 334, 306, 14, 9, 321, 68, 34, 20, 342, + 23, 73, 25, 40, 58, 62, 60, 872, 31, 32, + 33, 34, 10, 11, 32, 87, 349, 103, 104, 37, + 43, 13, 40, 356, 357, 351, 359, 19, 441, 52, + 663, 8, 453, 90, 91, 92, 13, 109, 10, 37, + 34, 435, 40, 15, 38, 68, 40, 3, 4, 5, + 73, 9, 473, 499, 111, 10, 389, 478, 10, 11, + 15, 67, 10, 696, 87, 11, 399, 15, 103, 104, + 403, 404, 144, 130, 407, 19, 20, 498, 31, 32, + 9, 509, 41, 16, 17, 418, 109, 19, 20, 9, + 416, 103, 104, 407, 151, 536, 423, 424, 9, 425, + 9, 9, 435, 9, 525, 9, 9, 440, 441, 624, + 9, 9, 9, 526, 9, 9, 544, 9, 9, 9, + 9, 144, 9, 456, 9, 458, 10, 43, 11, 145, + 463, 457, 81, 12, 455, 94, 12, 470, 19, 560, + 87, 66, 468, 43, 81, 566, 105, 133, 721, 556, + 145, 148, 485, 19, 113, 35, 36, 37, 38, 39, + 119, 487, 121, 43, 123, 34, 35, 36, 37, 38, + 39, 12, 505, 36, 14, 11, 509, 510, 52, 512, + 139, 514, 810, 123, 52, 13, 43, 520, 70, 8, + 13, 28, 8, 526, 20, 13, 529, 35, 36, 37, + 38, 39, 12, 19, 20, 20, 532, 58, 13, 128, + 631, 544, 28, 118, 30, 31, 32, 33, 34, 154, + 8, 37, 38, 9, 40, 798, 559, 725, 9, 45, + 9, 19, 20, 44, 43, 43, 14, 8, 571, 16, + 44, 10, 10, 28, 9, 670, 34, 35, 36, 37, + 38, 39, 698, 674, 34, 13, 19, 28, 704, 30, + 31, 32, 33, 34, 13, 690, 37, 38, 84, 40, + 13, 597, 118, 100, 45, 30, 31, 32, 33, 34, + 44, 14, 37, 38, 149, 40, 58, 19, 58, 13, + 45, 864, 28, 32, 627, 21, 43, 32, 10, 19, + 31, 11, 13, 125, 19, 13, 15, 10, 9, 11, + 135, 9, 645, 741, 21, 648, 649, 650, 15, 652, + 15, 647, 44, 23, 10, 658, 44, 87, 13, 28, + 13, 23, 10, 13, 28, 138, 32, 30, 19, 44, + 673, 20, 4, 669, 69, 58, 792, 13, 124, 770, + 20, 28, 798, 44, 13, 688, 21, 44, 14, 780, + 44, 28, 44, 10, 505, 509, 512, 57, 44, 44, + 755, 697, 386, 62, 399, 514, 403, 520, 499, 802, + 253, 552, 182, 314, 397, 315, 550, 434, 721, 431, + 723, 901, 813, 660, 772, 782, 879, 730, 724, 544, + 821, 650, 747, 192, 803, 618, 792, 719, 741, 547, + 710, 718, 869, 648, 359, 567, 862, 487, 864, 478, + 348, 821, 372, 874, 566, 816, -1, 337, 91, 755, + -1, 764, -1, -1, -1, -1, 762, -1, -1, -1, + -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, + -1, 49, -1, -1, 787, 876, -1, 790, -1, -1, + -1, -1, -1, -1, -1, 798, 799, 65, -1, -1, + -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, -1, -1, 83, 84, -1, -1, -1, + -1, 89, -1, -1, -1, -1, -1, -1, 96, -1, + -1, 99, -1, 101, -1, -1, -1, -1, -1, 107, + 108, -1, -1, -1, -1, -1, -1, 0, 1, 117, + 3, 4, 5, 6, 7, 8, -1, 860, 11, 127, + 863, 14, -1, 131, -1, -1, -1, -1, -1, -1, + -1, -1, 140, -1, -1, 871, -1, -1, -1, 147, + -1, 884, -1, 879, -1, -1, 889, -1, 41, 42, + 43, -1, -1, 46, 47, -1, 49, 50, 51, 52, + -1, -1, -1, 56, 57, -1, -1, -1, 61, -1, + 63, -1, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, + 83, 84, -1, -1, -1, 88, 89, -1, -1, -1, + -1, 94, 95, 96, -1, 98, 99, -1, 101, -1, + -1, -1, -1, -1, 107, 108, -1, -1, -1, 112, + -1, -1, -1, -1, 117, -1, 119, 120, 121, 122, + -1, 124, -1, 126, 127, -1, -1, -1, 131, -1, + -1, -1, -1, -1, -1, -1, -1, 140, -1, -1, + -1, -1, 145, -1, 147, -1, -1, -1, 1, 152, + 3, 4, 5, 6, 7, 8, -1, -1, 11, -1, + -1, 14, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 41, 42, + 43, -1, -1, 46, 47, -1, 49, 50, 51, 52, + -1, -1, -1, 56, 57, -1, -1, -1, 61, -1, + 63, -1, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, -1, + 83, 84, -1, -1, -1, 88, 89, -1, -1, -1, + -1, 94, 95, 96, -1, 98, 99, -1, 101, -1, + -1, -1, -1, -1, 107, 108, -1, -1, -1, 112, + -1, -1, -1, -1, 117, -1, 119, 120, 121, 122, + -1, 124, -1, 126, 127, -1, -1, -1, 131, -1, + -1, -1, -1, -1, -1, -1, -1, 140, -1, -1, + -1, -1, 145, -1, 147, -1, -1, -1, -1, 152 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const unsigned short yystos[] = +{ + 0, 1, 3, 4, 5, 6, 7, 11, 41, 42, + 46, 47, 49, 50, 51, 56, 63, 65, 66, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 83, 84, 88, 89, 94, 95, 96, 98, + 99, 101, 107, 108, 112, 117, 119, 121, 122, 124, + 126, 127, 131, 140, 145, 147, 152, 156, 157, 158, + 159, 162, 163, 164, 165, 166, 170, 172, 195, 229, + 232, 235, 236, 238, 239, 240, 330, 353, 359, 360, + 386, 388, 390, 397, 398, 399, 401, 402, 418, 424, + 425, 426, 11, 160, 161, 8, 167, 169, 167, 21, + 331, 332, 333, 9, 9, 354, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 169, 9, 103, 104, 419, 9, 42, 49, 65, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 83, 84, 89, 96, 99, 101, 107, 108, + 117, 127, 131, 140, 147, 237, 9, 9, 9, 9, + 230, 232, 9, 9, 9, 9, 9, 0, 157, 161, + 10, 11, 171, 9, 81, 67, 20, 238, 11, 14, + 167, 241, 242, 243, 244, 247, 249, 251, 252, 10, + 358, 11, 362, 43, 57, 61, 120, 361, 12, 22, + 247, 400, 43, 403, 43, 64, 367, 427, 427, 160, + 168, 169, 12, 22, 169, 334, 335, 19, 296, 29, + 30, 169, 182, 183, 288, 355, 134, 169, 210, 296, + 28, 169, 382, 382, 177, 185, 174, 81, 238, 87, + 169, 192, 169, 216, 34, 169, 209, 310, 29, 85, + 86, 169, 199, 200, 202, 204, 205, 206, 358, 37, + 40, 215, 167, 420, 421, 37, 40, 97, 175, 173, + 218, 296, 66, 7, 109, 224, 43, 233, 81, 231, + 103, 104, 225, 57, 111, 128, 227, 133, 148, 153, + 220, 310, 41, 94, 105, 113, 119, 121, 123, 139, + 196, 197, 198, 230, 145, 11, 19, 253, 12, 250, + 243, 246, 247, 36, 248, 13, 168, 254, 11, 9, + 42, 105, 106, 113, 114, 115, 116, 129, 295, 363, + 364, 52, 387, 391, 403, 52, 382, 408, 409, 410, + 169, 123, 404, 368, 238, 238, 160, 16, 326, 343, + 344, 345, 346, 347, 348, 349, 19, 36, 336, 13, + 337, 382, 293, 70, 356, 43, 37, 143, 208, 169, + 8, 384, 28, 13, 43, 178, 179, 180, 182, 169, + 186, 187, 182, 34, 40, 176, 169, 193, 194, 13, + 217, 35, 36, 37, 38, 39, 313, 311, 313, 201, + 207, 215, 20, 20, 82, 168, 12, 58, 422, 222, + 254, 13, 219, 169, 169, 234, 238, 118, 228, 128, + 154, 221, 169, 13, 36, 233, 167, 149, 256, 257, + 258, 259, 260, 324, 326, 10, 15, 245, 249, 252, + 13, 19, 255, 30, 31, 32, 33, 34, 37, 38, + 40, 45, 323, 296, 238, 365, 9, 9, 9, 44, + 367, 367, 396, 333, 43, 411, 409, 14, 412, 44, + 333, 19, 20, 84, 323, 369, 370, 373, 374, 375, + 382, 385, 346, 182, 286, 14, 238, 351, 352, 347, + 10, 169, 169, 335, 10, 28, 289, 9, 357, 211, + 212, 310, 383, 384, 382, 181, 31, 32, 184, 13, + 19, 188, 13, 188, 13, 169, 118, 226, 226, 202, + 203, 29, 206, 169, 382, 423, 167, 100, 223, 296, + 44, 358, 238, 169, 197, 197, 238, 3, 4, 5, + 261, 257, 14, 264, 265, 268, 260, 256, 247, 254, + 168, 382, 232, 169, 238, 169, 58, 58, 334, 19, + 374, 59, 238, 413, 334, 382, 13, 372, 375, 28, + 17, 327, 32, 350, 34, 169, 339, 340, 341, 10, + 352, 21, 30, 290, 292, 374, 382, 44, 212, 213, + 313, 179, 32, 31, 180, 182, 169, 43, 189, 187, + 194, 204, 10, 382, 168, 169, 11, 238, 358, 69, + 77, 262, 263, 19, 268, 297, 298, 299, 300, 303, + 306, 286, 327, 255, 231, 367, 396, 69, 405, 169, + 382, 125, 414, 405, 376, 377, 381, 382, 385, 373, + 34, 38, 40, 371, 169, 19, 342, 15, 13, 338, + 291, 135, 214, 44, 191, 238, 10, 11, 9, 9, + 10, 150, 15, 9, 23, 24, 25, 26, 27, 48, + 69, 103, 104, 110, 137, 146, 269, 270, 271, 283, + 284, 294, 295, 322, 62, 90, 91, 92, 111, 130, + 151, 274, 275, 276, 285, 302, 9, 48, 53, 54, + 55, 122, 301, 317, 318, 23, 25, 31, 32, 33, + 43, 52, 68, 73, 87, 109, 144, 304, 305, 307, + 308, 310, 21, 328, 403, 23, 389, 58, 60, 392, + 19, 169, 406, 44, 15, 382, 415, 10, 44, 379, + 28, 13, 329, 169, 238, 341, 334, 288, 19, 20, + 169, 312, 314, 315, 316, 13, 190, 169, 87, 263, + 268, 323, 277, 238, 296, 169, 382, 19, 20, 272, + 273, 374, 10, 15, 278, 284, 23, 287, 169, 278, + 296, 10, 13, 301, 323, 238, 82, 310, 278, 136, + 310, 319, 320, 321, 32, 308, 306, 302, 43, 135, + 238, 309, 313, 314, 169, 114, 115, 116, 238, 366, + 230, 393, 396, 296, 394, 395, 169, 138, 407, 30, + 416, 374, 380, 32, 37, 40, 378, 182, 10, 293, + 19, 20, 191, 44, 19, 28, 53, 124, 238, 279, + 280, 281, 282, 169, 382, 271, 28, 266, 4, 382, + 276, 312, 312, 124, 321, 44, 21, 310, 313, 314, + 43, 312, 43, 214, 43, 311, 37, 40, 114, 325, + 405, 233, 58, 382, 13, 407, 20, 417, 381, 13, + 28, 267, 21, 278, 44, 44, 314, 309, 310, 43, + 312, 310, 313, 309, 329, 238, 396, 395, 382, 280, + 28, 14, 312, 309, 44, 314, 309, 44, 10, 269, + 309, 44, 15, 309 +}; + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror ("syntax error: cannot back up"); \ + YYERROR; \ + } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +/* YYLLOC_DEFAULT -- Compute the default location (before the actions + are run). */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current.first_line = Rhs[1].first_line; \ + Current.first_column = Rhs[1].first_column; \ + Current.last_line = Rhs[N].last_line; \ + Current.last_column = Rhs[N].last_column; +#endif + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#define YYLEX yylex () + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) +# define YYDSYMPRINT(Args) \ +do { \ + if (yydebug) \ + yysymprint Args; \ +} while (0) +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YYDSYMPRINT(Args) +#endif /* !YYDEBUG */ + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#if YYMAXDEPTH == 0 +# undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif +{ + register const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; +} +# endif +# endif + +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + register char *yyd = yydest; + register const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +#endif /* !YYERROR_VERBOSE */ + + + +#if YYDEBUG +/*-----------------------------. +| Print this symbol on YYOUT. | +`-----------------------------*/ + +static void +#if defined (__STDC__) || defined (__cplusplus) +yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue) +#else +yysymprint (yyout, yytype, yyvalue) + FILE* yyout; + int yytype; + YYSTYPE yyvalue; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvalue; + + if (yytype < YYNTOKENS) + { + YYFPRINTF (yyout, "token %s (", yytname[yytype]); +# ifdef YYPRINT + YYPRINT (yyout, yytoknum[yytype], yyvalue); +# endif + } + else + YYFPRINTF (yyout, "nterm %s (", yytname[yytype]); + + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyout, ")"); +} +#endif /* YYDEBUG. */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +#if defined (__STDC__) || defined (__cplusplus) +yydestruct (int yytype, YYSTYPE yyvalue) +#else +yydestruct (yytype, yyvalue) + int yytype; + YYSTYPE yyvalue; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvalue; + + switch (yytype) + { + default: + break; + } +} + + + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +# define YYPARSE_PARAM_DECL +# else +# define YYPARSE_PARAM_ARG YYPARSE_PARAM +# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +# endif +#else /* !YYPARSE_PARAM */ +# define YYPARSE_PARAM_ARG +# define YYPARSE_PARAM_DECL +#endif /* !YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +# ifdef YYPARSE_PARAM +int yyparse (void *); +# else +int yyparse (void); +# endif +#endif + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of parse errors so far. */ +int yynerrs; + + +int +yyparse (YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + + register int yystate; + register int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Lookahead token as an internal (translated) token number. */ + int yychar1 = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short yyssa[YYINITDEPTH]; + short *yyss = yyssa; + register short *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + register YYSTYPE *yyvsp; + + + +#define YYPOPSTACK (yyvsp--, yyssp--) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyoverflowlab; +# else + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + goto yyoverflowlab; + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; + + { + short *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyoverflowlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with. */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more. */ + + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yychar1 = YYTRANSLATE (yychar); + + /* We have to keep this `#if YYDEBUG', since we use variables + which are defined only if `YYDEBUG' is set. */ + YYDPRINTF ((stderr, "Next token is ")); + YYDSYMPRINT ((stderr, yychar1, yylval)); + YYDPRINTF ((stderr, "\n")); + } + + /* If the proper action on seeing token YYCHAR1 is to reduce or to + detect an error, take that action. */ + yyn += yychar1; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + YYDPRINTF ((stderr, "Shifting token %d (%s), ", + yychar, yytname[yychar1])); + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; + + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + +#if YYDEBUG + /* We have to keep this `#if YYDEBUG', since we use variables which + are defined only if `YYDEBUG' is set. */ + if (yydebug) + { + int yyi; + + YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", + yyn - 1, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + switch (yyn) + { + case 8: +#line 264 "gram.y" + { + (void) contextcheck(C_MUSIC, "music information"); + tssv_line(); + /* reset flags for next voice */ + Defining_multiple = NO; + Curr_grpsyl_p = (struct GRPSYL *) 0; + Good_till_canceled = NO; + free_extra_time(); + Prev_grpsyl_p = 0; + } + break; + + case 12: +#line 286 "gram.y" + { + /* for blank lines -- nothing to do */ + } + break; + + case 13: +#line 292 "gram.y" + { + /* to keep going after stumbling on an input error */ + Getting_tup_dur = NO; + Good_till_canceled = NO; + Defining_multiple = NO; + Curr_grpsyl_p = (struct GRPSYL *) 0; + Last_grpsyl_p = (struct GRPSYL *) 0; + Prev_grpsyl_p = (struct GRPSYL *) 0; + } + break; + + case 14: +#line 303 "gram.y" + { + /* fill in context field of the SSV struct */ + Currstruct_p->u.ssv_p->context = (short) Context; + } + break; + + case 15: +#line 310 "gram.y" + { + Curr_family = Score.fontfamily; + } + break; + + case 16: +#line 316 "gram.y" + {} + break; + + case 17: +#line 320 "gram.y" + {} + break; + + case 18: +#line 324 "gram.y" + { + /* have lots of separate structs in music context, so + * mark that we have no current struct */ + Currstruct_p = (struct MAINLL *) 0; + + /* make sure at least 1 staff is visible. Not good to + * check when user sets visible, because it would be + * nice to first set everything invisible and later + * turn one on. So if we wait till now to check, + * user doesn't have to switch back and forth from + * score to staff to get 1 voice visible. */ + check_at_least1visible(); + } + break; + + case 19: +#line 339 "gram.y" + { + Context = C_SCORE; + } + break; + + case 20: +#line 345 "gram.y" + { + (void) rangecheck(yyvsp[-1].intval, MINSTAFFS, Score.staffs, "staff number"); + Context = C_STAFF; + Currstruct_p->u.ssv_p->staffno = yyvsp[-1].intval; + } + break; + + case 21: +#line 353 "gram.y" + { + (void) rangecheck(yyvsp[-2].intval, MINSTAFFS, Score.staffs, "staff number"); + (void) rangecheck(yyvsp[-1].intval, MINVOICES, MAXVOICES, "voice number"); + Context = C_VOICE; + Currstruct_p->u.ssv_p->staffno = yyvsp[-2].intval; + Currstruct_p->u.ssv_p->voiceno = yyvsp[-1].intval; + } + break; + + case 22: +#line 362 "gram.y" + { + /* allocate an SSV struct */ + Currstruct_p = newMAINLLstruct(S_SSV, yylineno); + } + break; + + case 23: +#line 368 "gram.y" + { + /* entering new context, if we have a current struct, + * we were in a different context, so add its info to the list */ + end_prev_context(); + } + break; + + case 24: +#line 375 "gram.y" + { + struct FEED *feed_p; /* where to attach blocks */ + int calloced; /* YES if dynamically alloced */ + + end_prev_context(); + Currstruct_p = (struct MAINLL *) 0; + Context = yyvsp[0].intval; + calloced = NO; + + switch (yyvsp[0].intval) { + case C_HEADER: + /* We only allow one of these */ + chkdup_headfoot(Gotheader++, "header"); + Currblock_p = &Header; + break; + case C_HEAD2: + chkdup_headfoot(Gothead2++, "header2"); + Currblock_p = &Header2; + break; + case C_FOOTER: + chkdup_headfoot(Gotfooter++, "footer"); + Currblock_p = &Footer; + break; + case C_FOOT2: + chkdup_headfoot(Gotfoot2++, "foot2"); + Currblock_p = &Footer2; + break; + break; + case C_TOP: + case C_TOP2: + case C_BOT: + case C_BOT2: + case C_BLOCK: + CALLOC(BLOCKHEAD, Currblock_p, 1); + calloced = YES; + break; + default: + pfatal("Unknown block-type context"); + /*NOTREACHED*/ + break; + } + set_win_coord(Currblock_p->c); + /* Remember where to start attaching "print" commands */ + Next_print_link_p_p = &(Currblock_p->printdata_p); + + /* The dynamically allocated blocks + * (not the static head/foot blocks) + * need extra processing to populate + * the main list properly with FEEDs. + */ + if (calloced == YES) { + if (Mainlltc_p == 0 || Mainlltc_p->str != S_FEED) { + /* User had not specified a feed + * right before this block, so we need + * to add one for them implicitly. + * Create a new FEED and add it + * to the end of the main list. + */ + insertMAINLL(newMAINLLstruct(S_FEED, yylineno), + Mainlltc_p); + } + feed_p = Mainlltc_p->u.feed_p; + + /* Normally, top/top2/bot/bot2 result in a pagefeed. + * But we have a special case for backward + * compatiblity and for flexibility. + * User can get a separate + * "title" page if they really want to, + * by using an explicit newpage at the beginning. + * But in the normal case, they'd want to declare + * top/bot that will go on the first page without + * that causing a newpage. So if there hasn't been + * any music or block yet, we won't set newpage=YES + * for top/top2/bot/bot2, but otherwise we will. + */ + if (Context & (C_TOP|C_TOP2|C_BOT|C_BOT2)) { + struct MAINLL *m_p; + for (m_p = Mainlltc_p->prev; m_p != 0; + m_p = m_p->prev) { + if (m_p->str == S_BAR || + m_p->str == S_BLOCKHEAD) { + /* There was music or block, + * so this is not + * at very beginning, + * so no special case: + * there will be new page. + */ + feed_p->pagefeed = YES; + break; + } + } + } + + /* Now check for redefined blocks and + * attach the BLOCKHEAD onto the FEED or the + * main list, as appropriate. + */ + switch (Context) { + case C_TOP: + if (feed_p->top_p != 0) { + warning("top redefined before being used"); + } + feed_p->top_p = Currblock_p; + break; + case C_TOP2: + if (feed_p->top2_p != 0) { + warning("top2 redefined before being used"); + } + feed_p->top2_p = Currblock_p; + break; + case C_BOT: + if (feed_p->bot_p != 0) { + warning("bot redefined before being used"); + } + feed_p->bot_p = Currblock_p; + break; + case C_BOT2: + if (feed_p->bot2_p != 0) { + warning("bot2 redefined before being used"); + } + feed_p->bot2_p = Currblock_p; + break; + case C_BLOCK: + insertMAINLL(newMAINLLstruct(S_BLOCKHEAD, yylineno), + Mainlltc_p); + Mainlltc_p->u.blockhead_p = Currblock_p; + /* These blocks count like "music" for purposes + * of things that can only be set + * before any "music" + */ + Got_some_data = YES; + break; + case C_HEADER: + case C_HEAD2: + case C_FOOTER: + case C_FOOT2: + /* These are static, not in main list, + * so nothing needs to be done with them. + */ + break; + default: + pfatal("unexpected context (0x%x) for block", Context); + /*NOTREACHED*/ + break; + } + + /* We need a feed after a block. + * Use -1 as lineno to mark it as internally generated. + * That way if user puts their own explicit feed + * next in the input, we can know we can + * discard this internally generated one. + */ + if (Context & C_BLOCK) { + insertMAINLL(newMAINLLstruct(S_FEED, -1), Mainlltc_p); + } + } + } + break; + + case 25: +#line 534 "gram.y" + { + Context = C_MUSIC; + } + break; + + case 26: +#line 539 "gram.y" + { + end_prev_context(); + Currstruct_p = (struct MAINLL *) 0; + Context = C_GRIDS; + } + break; + + case 27: +#line 547 "gram.y" + { + if (Context == C_GRIDS) { + add_grid(yyvsp[-2].stringval, yyvsp[-1].stringval); + } + else if (Context == C_HEADSHAPES) { + /* skip past the font/size bytes */ + add_shape(yyvsp[-2].stringval + 2, yyvsp[-1].stringval + 2); + } + else { + yyerror("unexpected strings"); + } + } + break; + + case 28: +#line 562 "gram.y" + { + end_prev_context(); + Currstruct_p = (struct MAINLL *) 0; + Context = C_HEADSHAPES; + } + break; + + case 30: +#line 573 "gram.y" + { + yyval.intval = yyvsp[0].intval; + /* later on we check for being within current range */ + } + break; + + case 31: +#line 579 "gram.y" + { + yyval.intval = atoi(yytext); + } + break; + + case 35: +#line 593 "gram.y" + { + /* Only a few things are allowed to have a negative number. + * Other code assumes that that restriction is enforced here, + * so we only honor the minus if it is legal. */ + if (yyvsp[-1].intval == -1) { + if (yyvsp[-3].intval != STAFFPAD && yyvsp[-3].intval != SYLPOSITION) { + yyerror("negative value not allowed"); + } + else { + assign_int(yyvsp[-3].intval, -(yyvsp[0].intval), Currstruct_p); + } + } + else { + assign_int(yyvsp[-3].intval, yyvsp[0].intval, Currstruct_p); + } + } + break; + + case 36: +#line 612 "gram.y" + { + /* only restcombine and gridfret can be set to empty */ + if (yyvsp[-1].intval == RESTCOMBINE) { + assign_int(yyvsp[-1].intval, NORESTCOMBINE, Currstruct_p); + } + else if (yyvsp[-1].intval == GRIDFRET) { + assign_int(yyvsp[-1].intval, NOGRIDFRET, Currstruct_p); + } + else { + yyerror("parameter value required"); + } + } + break; + + case 37: +#line 627 "gram.y" + { + assign_float(yyvsp[-2].intval, yyvsp[0].floatval, Currstruct_p); + } + break; + + case 38: +#line 633 "gram.y" + { + assign_2floats(yyvsp[-4].intval, yyvsp[-2].floatval, yyvsp[0].floatval, Currstruct_p); + } + break; + + case 39: +#line 639 "gram.y" + { + double multiplier; + multiplier = (Score.units == INCHES ? 1.0 : CMPERINCH); + assign_float(PAGEWIDTH, pagesztbl[yyvsp[-1].intval][yyvsp[0].intval] * multiplier, Currstruct_p); + assign_float(PAGEHEIGHT, pagesztbl[yyvsp[-1].intval][yyvsp[0].intval ^ 1] * multiplier, Currstruct_p); + } + break; + + case 40: +#line 647 "gram.y" + { begin_range(PL_UNKNOWN); } + break; + + case 41: +#line 648 "gram.y" + { } + break; + + case 42: +#line 652 "gram.y" + { + /* specified in stepsizes, stored in inches */ + assign_float(PAD, yyvsp[-1].intval * yyvsp[0].floatval * STEPSIZE, Currstruct_p); + } + break; + + case 43: +#line 659 "gram.y" + { + assign_vscheme (yyvsp[-1].intval, yyvsp[0].intval, Currstruct_p); + } + break; + + case 44: +#line 665 "gram.y" + { + set_beamlist(Currstruct_p); + if (Currstruct_p != 0 && Currstruct_p->u.ssv_p != 0) { + Currstruct_p->u.ssv_p->beamrests = (yyvsp[0].intval & 0x1); + Currstruct_p->u.ssv_p->beamspaces = ((yyvsp[0].intval >> 1) & 0x1); + } + } + break; + + case 45: +#line 675 "gram.y" + { + set_staffset(yyvsp[-3].intval, Currstruct_p); + } + break; + + case 46: +#line 681 "gram.y" + { + set_barstlist(Currstruct_p); + } + break; + + case 47: +#line 687 "gram.y" + { + if (Currstruct_p != 0) { + chk_order(Currstruct_p->u.ssv_p, Order_place); + } + } + break; + + case 49: +#line 698 "gram.y" + { + /* all the work for this is done in timesig */ + } + break; + + case 50: +#line 704 "gram.y" + { + } + break; + + case 51: +#line 709 "gram.y" + { + set_font(yyvsp[-2].intval, yyvsp[0].intval, Currstruct_p); + } + break; + + case 52: +#line 715 "gram.y" + { + set_font(yyvsp[-2].intval, yyvsp[0].intval, Currstruct_p); + } + break; + + case 53: +#line 721 "gram.y" + { + if (contextcheck(C_SCORE|C_STAFF,"clef parameter") == YES) { + used_check(Currstruct_p, CLEF, "clef"); + if (Context == C_STAFF && + is_tab_staff(Currstruct_p->u.ssv_p->staffno)) { + yyerror("can't set clef on tab staff"); + } + Currstruct_p->u.ssv_p->clef = yyvsp[0].intval; + Currstruct_p->u.ssv_p->used[CLEF] = YES; + asgnssv(Currstruct_p->u.ssv_p); + } + } + break; + + case 54: +#line 736 "gram.y" + { + assign_int(yyvsp[-2].intval, yyvsp[0].intval, Currstruct_p); + } + break; + + case 56: +#line 745 "gram.y" + { + if (contextcheck(C_STAFF|C_VOICE, "unset") == YES) { + if (yyvsp[0].intval < 0 || yyvsp[0].intval >= NUMFLDS) { + pfatal("invalid parameter index %d", yyvsp[0].intval); + } + if (Currstruct_p->u.ssv_p->used[yyvsp[0].intval] == YES) { + warning("unsetting parameter overrides previous setting"); + } + /* Note that if user tries to unset something that + * can't be set in the current context, we silently + * ignore that. We figure that since it's already unset, + * it doesn't hurt anything to unset it again, + * and it's easier to not bother to check. + */ + + Currstruct_p->u.ssv_p->used[yyvsp[0].intval] = UNSET; + + /* special case: scoresep controls two fields */ + if (yyvsp[0].intval == MINSCSEP) { + Currstruct_p->u.ssv_p->used[MAXSCSEP] = UNSET; + } + + /* Assign, just in case there are new interactions */ + asgnssv(Currstruct_p->u.ssv_p); + } + } + break; + + case 57: +#line 773 "gram.y" + { Doing_timeunit = YES; } + break; + + case 58: +#line 774 "gram.y" + { + if ( contextcheck(C_SSV, "timeunit parameter") == YES ) { + used_check(Currstruct_p, TIMEUNIT, "timeunit"); + Currstruct_p->u.ssv_p->timeunit = yyvsp[0].ratval; + Currstruct_p->u.ssv_p->timelist_p = Extra_time_p; + Extra_time_p = 0; + Doing_timeunit = NO; + Currstruct_p->u.ssv_p->used[TIMEUNIT] = YES; + } + } + break; + + case 59: +#line 787 "gram.y" + { + if ( contextcheck(C_SSV, "swingunit parameter") == YES ) { + used_check(Currstruct_p, SWINGUNIT, "swingunit"); + Currstruct_p->u.ssv_p->swingunit = yyvsp[0].ratval; + Currstruct_p->u.ssv_p->used[SWINGUNIT] = YES; + } + } + break; + + case 60: +#line 797 "gram.y" + { + } + break; + + case 61: +#line 802 "gram.y" + { + } + break; + + case 62: +#line 807 "gram.y" + { + if ( contextcheck(C_SCORE, "endingstyle parameter") == YES ) { + used_check(Currstruct_p, ENDINGSTYLE, "endingstyle"); + Currstruct_p->u.ssv_p->endingstyle = yyvsp[0].intval; + Currstruct_p->u.ssv_p->used[ENDINGSTYLE] = YES; + } + } + break; + + case 63: +#line 817 "gram.y" + { + if (contextcheck(C_SCORE | C_STAFF, "rehstyle parameter") == YES ) { + used_check(Currstruct_p, REHSTYLE, "rehstyle"); + Currstruct_p->u.ssv_p->rehstyle = yyvsp[0].intval; + Currstruct_p->u.ssv_p->used[REHSTYLE] = YES; + } + + } + break; + + case 64: +#line 828 "gram.y" + { + if ( contextcheck(C_SCORE | C_STAFF, "pedstyle parameter") == YES ) { + used_check(Currstruct_p, PEDSTYLE, "pedstyle"); + Currstruct_p->u.ssv_p->pedstyle = yyvsp[0].intval; + Currstruct_p->u.ssv_p->used[PEDSTYLE] = YES; + } + } + break; + + case 65: +#line 838 "gram.y" + { + char *trans_name; + trans_name = (yyvsp[-4].intval == TRANSPOSITION ? + "transpose" : "addtranspose"); + if (contextcheck(C_SCORE|C_STAFF, trans_name) == YES) { + used_check(Currstruct_p, yyvsp[-4].intval, trans_name); + chk_interval(yyvsp[-1].intval, yyvsp[0].intval); + if (yyvsp[-4].intval == TRANSPOSITION) { + Currstruct_p->u.ssv_p->inttype = yyvsp[-1].intval; + Currstruct_p->u.ssv_p->intnum = yyvsp[-2].intval * yyvsp[0].intval; + } + else { + Currstruct_p->u.ssv_p->addinttype = yyvsp[-1].intval; + Currstruct_p->u.ssv_p->addintnum = yyvsp[-2].intval * yyvsp[0].intval; + } + Currstruct_p->u.ssv_p->used[yyvsp[-4].intval] = YES; + if (Context == C_STAFF && + is_tab_staff(Currstruct_p->u.ssv_p->staffno) + == YES) { + l_yyerror(Curr_filename, yylineno, + "%s not allowed on tablature staff", + trans_name); + } + else { + asgnssv(Currstruct_p->u.ssv_p); + } + } + } + break; + + case 66: +#line 869 "gram.y" + { + assign_unit(yyvsp[0].intval, Currstruct_p); + } + break; + + case 67: +#line 875 "gram.y" + { + assign_string(yyvsp[-2].intval, yyvsp[0].stringval, Currstruct_p); + } + break; + + case 68: +#line 881 "gram.y" + { + /* whereused is not allowed on voice, just score and staff */ + if (contextcheck(C_SCORE|C_STAFF, "visible=whereused") == YES) { + assign_int(VISIBLE, YES, Currstruct_p); + Currstruct_p->u.ssv_p->hidesilent = YES; + } + } + break; + + case 69: +#line 891 "gram.y" + { + /* only valid letter is y */ + if (*yytext != 'y') { + yyerror("visible value must be y, n, or whereused"); + } + else if (contextcheck(C_SSV, "visible parameter") + == YES) { + assign_int(VISIBLE, YES, Currstruct_p); + Currstruct_p->u.ssv_p->hidesilent = NO; + } + } + break; + + case 70: +#line 905 "gram.y" + { + if (contextcheck(C_SSV, "visible parameter") == YES) { + assign_int(VISIBLE, NO, Currstruct_p); + Currstruct_p->u.ssv_p->hidesilent = NO; + } + } + break; + + case 71: +#line 913 "gram.y" + { + /* none specified */ + yyval.intval = V_1; + } + break; + + case 72: +#line 920 "gram.y" + { + /* only valid value here is 'f' */ + if (*yytext == 'f') { + yyval.intval = V_2FREESTEM; + } + else { + yyerror("invalid voice qualifier: must be f or o"); + yyval.intval = V_1; + } + } + break; + + case 73: +#line 933 "gram.y" + { + /* only valid value here is 'o' */ + if (*yytext == 'o') { + yyval.intval = V_2OPSTEM; + } + else { + yyerror("invalid voice qualifier: must be f or o"); + yyval.intval = (int) V_1; + } + } + break; + + case 74: +#line 945 "gram.y" + { + /* NULL token for allocating a new beamlist */ + new_beamlist(); + } + break; + + case 77: +#line 959 "gram.y" + { + add_beamlist(yyvsp[0].ratval); + } + break; + + case 79: +#line 968 "gram.y" + { + add_beamlist(yyvsp[0].ratval); + } + break; + + case 81: +#line 977 "gram.y" + { begin_subbeam(); } + break; + + case 82: +#line 978 "gram.y" + { + end_subbeam(); + } + break; + + case 83: +#line 983 "gram.y" + { + yyval.ratval = calcfulltime(yyvsp[-3].ratval, yyvsp[-2].intval); + + /* if filling in a GRPSYL struct, need to fill in dots. + * Could also be here due to beamstyle + * or timeunit or location time offset, + * in which case the Curr_grpsyl_p will be NULL, + * or while getting tuplet duration. */ + if (Curr_grpsyl_p != (struct GRPSYL *) 0 + && Getting_tup_dur == NO) { + Curr_grpsyl_p->dots = yyvsp[-2].intval; + } + else { + struct TIMELIST *timelist_p; /* walk thru list */ + struct TIMELIST *next_p;/* save next to delete curr */ + RATIONAL totaltime; /* sum of extra times */ + + /* Start with first time value (which was calculated + * above and is now in $$), then add on the added + * times, if any. */ + totaltime = yyval.ratval; + for (timelist_p = Extra_time_p; timelist_p != 0; + timelist_p = next_p) { + next_p = timelist_p->next; + totaltime = radd(totaltime, timelist_p->fulltime); + if (Doing_timeunit == NO) { + /* For things like swingunit + * or tuplet time, we just need the + * resulting time, not the individual + * time units and arithmetic. */ + FREE(timelist_p); + } + } + if (Extra_time_p != 0 && LE(totaltime, Zero)) { + yyerror("Time values must add up to more than zero"); + } + /* Current timelist is finished; can't append any + * more items to it. */ + Curr_timelist_p = 0; + if (Doing_timeunit == YES) { + /* For timeunit, we return the initial + * timeunit, but also preserve + * Extra_time_p for putting in SSV. + */ + yyval.ratval = calcfulltime(yyvsp[-3].ratval, yyvsp[-2].intval); + } + else { + /* the list has been freed above */ + Extra_time_p = 0; + yyval.ratval = totaltime; + } + } + } + break; + + case 84: +#line 1039 "gram.y" + { + yyval.ratval.n = (svpath(1, TIME))->time.n; + yyval.ratval.d = (svpath(1, TIME))->time.d; + if (Curr_grpsyl_p != (struct GRPSYL *) 0 + && Getting_tup_dur == NO) { + /* use whole note symbol as default */ + Curr_grpsyl_p->basictime = 1; + Curr_grpsyl_p->is_meas = YES; + User_meas_time = NO; + } + else { + yyerror("'m' is not valid here"); + } + } + break; + + case 85: +#line 1056 "gram.y" + { + yyval.ratval = Zero; + } + break; + + case 87: +#line 1066 "gram.y" + { + yyval.intval = NO; + } + break; + + case 88: +#line 1072 "gram.y" + { + yyval.intval = (YES | (YES << 1)); + } + break; + + case 89: +#line 1078 "gram.y" + { + yyval.intval = ((YES << 1) | YES); + } + break; + + case 90: +#line 1084 "gram.y" + { + yyval.intval = (YES << 1); + } + break; + + case 91: +#line 1090 "gram.y" + { + yyval.intval = YES; + } + break; + + case 92: +#line 1095 "gram.y" + { + /* null token for the purpose of allocating a new rangelist + * to be filled in with user data */ + new_staffset(); + } + break; + + case 96: +#line 1112 "gram.y" + { + /* save information about this range in the list */ + /* if only a single number, not a range, rangetail will be + * 0, so use num as both beginning and end of range */ + add_staffset( yyvsp[-2].intval, (yyvsp[-1].intval > 0 ? yyvsp[-1].intval : yyvsp[-2].intval), String1, String2); + } + break; + + case 97: +#line 1120 "gram.y" + { + /* no end of range, so return 0 as flag that there was only 1 number */ + yyval.intval = 0; + } + break; + + case 98: +#line 1127 "gram.y" + { + /* make sure isn't 0, because that it illegal and would be used + * later as though there were no range. Other error checking + * on this number will be done later. */ + if (yyvsp[0].intval == 0) { + yyerror("second number of range may not be zero"); + } + yyval.intval = yyvsp[0].intval; + } + break; + + case 99: +#line 1138 "gram.y" + { + /* no labels */ + String1 = String2 = (char *) 0; + } + break; + + case 100: +#line 1145 "gram.y" + { + /* save label */ + String1 = yyvsp[-2].stringval; + } + break; + + case 101: +#line 1151 "gram.y" + { + /* no second label */ + String2 = (char *) 0; + } + break; + + case 102: +#line 1158 "gram.y" + { + /* save label2 for later use */ + String2 = yyvsp[0].stringval; + } + break; + + case 104: +#line 1167 "gram.y" + { + /* NULL token for allocating space for a bar style list */ + new_barstlist(); + } + break; + + case 108: +#line 1184 "gram.y" + { + /* if only 1 number, not range, rangetail will be 0, so use + * same number for beginning and end */ + add_barst(yyvsp[-1].intval, (yyvsp[0].intval == 0 ? yyvsp[-1].intval : yyvsp[0].intval) ); + } + break; + + case 109: +#line 1191 "gram.y" + { + Order_place = yyvsp[0].intval; + Order_prio = 1; + if (Currstruct_p != 0) { + switch (yyvsp[0].intval) { + case PL_ABOVE: + Currstruct_p->u.ssv_p->used[ABOVEORDER] = YES; + break; + case PL_BELOW: + Currstruct_p->u.ssv_p->used[BELOWORDER] = YES; + break; + case PL_BETWEEN: + Currstruct_p->u.ssv_p->used[BETWEENORDER] = YES; + break; + } + } + } + break; + + case 110: +#line 1211 "gram.y" + { + if (Currstruct_p != 0) { + Currstruct_p->u.ssv_p->markorder[Order_place][yyvsp[0].intval] = Order_prio; + } + } + break; + + case 111: +#line 1219 "gram.y" + { + if (Currstruct_p != 0) { + Currstruct_p->u.ssv_p->markorder[Order_place][yyvsp[0].intval] = ++Order_prio; + } + } + break; + + case 112: +#line 1227 "gram.y" + { + if (Currstruct_p != 0) { + Currstruct_p->u.ssv_p->markorder[Order_place][yyvsp[0].intval] = Order_prio; + } + } + break; + + case 113: +#line 1234 "gram.y" + { + if (Currstruct_p != 0) { + if (Currstruct_p->u.ssv_p->markorder[Order_place][yyvsp[0].intval] != 0) { + l_yyerror(Curr_filename, yylineno, + "order item %s specified more than once", yyvsp[0].intval); + } + } + yyval.intval = yyvsp[0].intval; + } + break; + + case 114: +#line 1246 "gram.y" + { + yyval.intval = MK_MUSSYM; + } + break; + + case 115: +#line 1252 "gram.y" + { + yyval.intval = MK_OCTAVE; + } + break; + + case 116: +#line 1258 "gram.y" + { + yyval.intval = MK_OTHERTEXT; + } + break; + + case 117: +#line 1264 "gram.y" + { + switch (yyvsp[0].intval) { + case TM_CHORD: + yyval.intval = MK_CHORD; + break; + case TM_DYN: + yyval.intval = MK_DYN; + break; + default: + yyerror("invalid text modifier in order list"); + /* set to something valid, since $$ will be used + * as an array subscript. */ + yyval.intval = MK_CHORD; + break; + } + } + break; + + case 118: +#line 1283 "gram.y" + { + yyval.intval = MK_LYRICS; + } + break; + + case 119: +#line 1289 "gram.y" + { + yyval.intval = MK_ENDING; + } + break; + + case 120: +#line 1295 "gram.y" + { + yyval.intval = MK_REHEARSAL; + } + break; + + case 121: +#line 1301 "gram.y" + { + yyval.intval = MK_PEDAL; + } + break; + + case 122: +#line 1307 "gram.y" + { + tsig_item(TSR_END); + if (Currstruct_p != 0 && Currstruct_p->u.ssv_p != 0) { + MALLOCA(char, Currstruct_p->u.ssv_p->timerep, Tsig_offset); + strcpy(Currstruct_p->u.ssv_p->timerep, Timerep); + assign_timesig(Currstruct_p, yyvsp[0].intval, &Next_alt_timesig); + Tsig_visibility = yyvsp[0].intval; + /* If there are alternating time signatures, + * need to save pointer to this list */ + if (Next_alt_timesig != 0) { + Alt_timesig_list = Timerep; + } + else { + Alt_timesig_list = 0; + } + } + /* Reset for next time signature usage, if any */ + Tsig_offset = 0; + } + break; + + case 124: +#line 1331 "gram.y" + { tsig_item(TSR_ALTERNATING); } + break; + + case 125: +#line 1332 "gram.y" + { + /* this is for alternating time signature */ + } + break; + + case 126: +#line 1338 "gram.y" + { + } + break; + + case 127: +#line 1342 "gram.y" + { tsig_item(TSR_ADD); } + break; + + case 128: +#line 1343 "gram.y" + { + /* This would be for things like 2/4 + 3/8 */ + } + break; + + case 129: +#line 1349 "gram.y" + { + tsig_item(TSR_CUT); + } + break; + + case 130: +#line 1355 "gram.y" + { + tsig_item(TSR_COMMON); + } + break; + + case 131: +#line 1361 "gram.y" + { + tsig_item(TSR_SLASH); + if (yyvsp[0].intval < MINDENOMINATOR) { + l_yyerror(Curr_filename, yylineno, + "time signature denominator cannot be less than %d", + MINDENOMINATOR); + yyvsp[0].intval = MINDENOMINATOR; + } + else if (yyvsp[0].intval > MAXDENOMINATOR) { + l_yyerror(Curr_filename, yylineno, + "time signature denominator cannot be greater than %d", + MAXDENOMINATOR); + yyvsp[0].intval = MAXDENOMINATOR; + } + else if (power_of2check(yyvsp[0].intval, "time signature denominator") == NO) { + yyvsp[0].intval = 1 << drmo(yyvsp[0].intval); + } + + tsig_item(yyvsp[0].intval); + } + break; + + case 132: +#line 1384 "gram.y" + { + /* this is something like 3+1/4 where the 1/4 get interpreted + * by lexer as quadwhole, but it's really 1 for numerator + * and 4 for denominator. + */ + tsig_item(1); + tsig_item(TSR_SLASH); + tsig_item(yyvsp[0].intval); + } + break; + + case 133: +#line 1396 "gram.y" + { + tsig_item(1); + tsig_item(TSR_SLASH); + tsig_item(yyvsp[0].intval); + } + break; + + case 136: +#line 1410 "gram.y" + { + if (yyvsp[0].intval < MINNUMERATOR) { + l_yyerror(Curr_filename, yylineno, + "time signature numerator cannot be less than %d", + MINNUMERATOR); + yyvsp[0].intval = MINNUMERATOR; + } + else if (yyvsp[0].intval > MAXNUMERATOR) { + l_yyerror(Curr_filename, yylineno, + "time signature numerator cannot be greater than %d", + MAXNUMERATOR); + yyvsp[0].intval = MAXNUMERATOR; + } + tsig_item(yyvsp[0].intval); + } + break; + + case 137: +#line 1428 "gram.y" + { + yyval.intval = PTS_ONCE; + } + break; + + case 138: +#line 1434 "gram.y" + { + yyval.intval = (yyvsp[0].intval == YES ? PTS_ALWAYS : PTS_NEVER); + } + break; + + case 139: +#line 1439 "gram.y" + { + yyval.intval = NO; + } + break; + + case 140: +#line 1445 "gram.y" + { + /* 'n' is used in various places to mean do NOT + * print something that would normally be printed, + * so YES means we do want to inhibit the normal printing. */ + yyval.intval = YES; + } + break; + + case 141: +#line 1453 "gram.y" + { + if ( (yyvsp[-1].intval != '#') && (yyvsp[-1].intval != '&') ) { + yyerror("key signature must include # or &"); + } + else { + assign_key(yyvsp[-2].intval, yyvsp[-1].intval, yyvsp[0].intval, Currstruct_p); + } + } + break; + + case 142: +#line 1464 "gram.y" + { + int sharps; + + /* Get number of sharps for the pitch letter */ + sharps = strchr(Circle, yyvsp[-2].intval) - Circle - 1; + + /* adjust for sharp/flat */ + if (yyvsp[-1].intval == '#') { + sharps += 7; + } + else if (yyvsp[-1].intval == '&') { + sharps -= 7; + } + else if (yyvsp[-1].intval != 0) { + yyerror("key letter can only be followed by # or &"); + /* set to some ridiculous value, so will fail below */ + sharps = 999; + } + + /* Adjust if needed for minor */ + if (yyvsp[0].intval == YES) { + sharps -= 3; + } + + /* disallow illegal keys, like f& */ + if (abs(sharps) > 7) { + /* print error unless already printed one above */ + if (sharps < 100) { + yyerror("invalid key--too many sharps or flats"); + } + } + else { + assign_key(abs(sharps), (sharps >= 0 ? '#' : '&'), + yyvsp[0].intval, Currstruct_p); + } + } + break; + + case 143: +#line 1503 "gram.y" + { + asgn_stafflines(yyvsp[-1].intval, yyvsp[0].intval == YES ? SS_NOTHING : SS_NORMAL, Currstruct_p); + } + break; + + case 144: +#line 1509 "gram.y" + { + asgn_stafflines(yyvsp[-1].intval, SS_DRUM, Currstruct_p); + } + break; + + case 145: +#line 1515 "gram.y" + { + /* use default tablature */ + if (Currstruct_p != 0) { + Currstruct_p->u.ssv_p->strinfo = Guitar; + asgn_stafflines(DEFTABLINES, NO, Currstruct_p); + } + } + break; + + case 146: +#line 1525 "gram.y" + { + /* user-specified tablature */ + asgn_stafflines(yyvsp[-1].intval, NO, Currstruct_p); + } + break; + + case 147: +#line 1532 "gram.y" + { + yyval.intval = 1; + } + break; + + case 148: +#line 1538 "gram.y" + { + /* count up the number of strings */ + yyval.intval = yyvsp[-1].intval + 1; + } + break; + + case 149: +#line 1544 "gram.y" + { + /* save info about this tablature string */ + if (Currstruct_p != 0) { + add_tab_string_info(yyvsp[-3].intval, yyvsp[-2].intval, yyvsp[-1].intval, yyvsp[0].intval, Currstruct_p->u.ssv_p); + } + } + break; + + case 150: +#line 1552 "gram.y" + { + yyval.intval = 0; + } + break; + + case 151: +#line 1558 "gram.y" + { + if (yyvsp[0].intval != '&' && yyvsp[0].intval != '#') { + yyerror("accidental on string can only be & or #"); + } + } + break; + + case 152: +#line 1565 "gram.y" + { + /* no ticks */ + yyval.intval = 0; + } + break; + + case 153: +#line 1572 "gram.y" + { + /* limit number of ticks. Has to match the number of bits + * used by TMP_NTICKS in grpsyl.c */ + if (yyvsp[0].intval > MAXTICKS) { + l_yyerror(Curr_filename, yylineno, + "too many ' marks (%d max)", MAXTICKS); + yyvsp[0].intval = MAXTICKS; + } + } + break; + + case 154: +#line 1583 "gram.y" + { + /* only valid letter is y */ + if (*yytext != 'y') { + yyerror("flag value must be y or n"); + } + yyval.intval = YES; + } + break; + + case 155: +#line 1593 "gram.y" + { + yyval.intval = NO; + } + break; + + case 156: +#line 1598 "gram.y" + { + if (Currstruct_p == 0) { + yyerror("wrong context for setting scoresep"); + } + else { + /* Assign the value of minimum vertical space + * between scores. */ + assign_int(MINSCSEP, yyvsp[0].intval, Currstruct_p); + } + } + break; + + case 157: +#line 1610 "gram.y" + { + if (Currstruct_p != 0) { + /* if user set minimum greater than default maximum, + * adjust maximum to equal the minimum + * they specified. */ + if (Currstruct_p->u.ssv_p->minscsep + > Currstruct_p->u.ssv_p->maxscsep) { + Currstruct_p->u.ssv_p->maxscsep + = Currstruct_p->u.ssv_p->minscsep; + } + else { + /* fill in default */ + assign_int(MAXSCSEP, DEFMAXSCSEP, Currstruct_p); + } + } + } + break; + + case 158: +#line 1629 "gram.y" + { + if (Currstruct_p != 0) { + if (Currstruct_p->u.ssv_p->minscsep > yyvsp[0].intval) { + yyerror("scoresep maximum smaller than minimum"); + } + assign_int(MAXSCSEP, yyvsp[0].intval, Currstruct_p); + } + } + break; + + case 159: +#line 1639 "gram.y" + { + if (Currstruct_p == 0) { + yyerror("wrong context for setting scorepad"); + } + else { + /* Assign the value of minimum vertical space + * between scores. */ + assign_int(MINSCPAD, yyvsp[-1].intval * yyvsp[0].intval, Currstruct_p); + } + } + break; + + case 160: +#line 1652 "gram.y" + { + if (Currstruct_p != 0) { + /* If user set minimum greater than default maximum, + * adjust maximum to equal the minimum + * they specified. */ + if (Currstruct_p->u.ssv_p->minscpad + > Currstruct_p->u.ssv_p->maxscpad) { + Currstruct_p->u.ssv_p->maxscpad + = Currstruct_p->u.ssv_p->minscpad; + } + else { + /* fill in default */ + assign_int(MAXSCPAD, DEFMAXSCPAD, Currstruct_p); + } + } + } + break; + + case 161: +#line 1671 "gram.y" + { + if (Currstruct_p != 0) { + if (Currstruct_p->u.ssv_p->minscpad > yyvsp[-1].intval * yyvsp[0].intval) { + yyerror("scorepad maximum smaller than minimum"); + } + assign_int(MAXSCPAD, yyvsp[-1].intval * yyvsp[0].intval, Currstruct_p); + } + } + break; + + case 163: +#line 1686 "gram.y" + { + if (yyvsp[-1].intval == (int) 'a' && yyvsp[0].intval >= 4 && yyvsp[0].intval <= 6) { + switch (yyvsp[0].intval) { + case 4: + yyval.intval = PS_A4; + break; + case 5: + yyval.intval = PS_A5; + break; + case 6: + yyval.intval = PS_A6; + break; + default: + pfatal("impossible pagesize"); + break; + } + } + else { + yyerror("unsupported pagesize"); + } + } + break; + + case 164: +#line 1711 "gram.y" + { + yyval.intval = 0; + } + break; + + case 165: +#line 1717 "gram.y" + { + yyval.intval = (yyvsp[0].intval == O_PORTRAIT ? 0 : 1); + } + break; + + case 166: +#line 1724 "gram.y" + { + assign_vcombine(VC_NOOVERLAP, Currstruct_p); + } + break; + + case 167: +#line 1730 "gram.y" + { + assign_vcombine(yyvsp[0].intval, Currstruct_p); + Defining_multiple = NO; + } + break; + + case 168: +#line 1738 "gram.y" + { + yyval.intval = VC_NOOVERLAP; + } + break; + + case 169: +#line 1744 "gram.y" + { + yyval.intval = yyvsp[0].intval; + } + break; + + case 170: +#line 1751 "gram.y" + { + yyval.intval = yyvsp[0].intval; + } + break; + + case 171: +#line 1757 "gram.y" + { + if (yyvsp[0].intval != C_TOP) { + l_yyerror(Curr_filename, yylineno, + "%s not valid here", yytext); + } + yyval.intval = ENDING_TOP; + } + break; + + case 172: +#line 1766 "gram.y" + { + yyval.intval = 1; + } + break; + + case 173: +#line 1772 "gram.y" + { + yyval.intval = -1; + } + break; + + case 174: +#line 1777 "gram.y" + { + yyval.intval = NO; + } + break; + + case 175: +#line 1783 "gram.y" + { + switch (yyvsp[0].intval) { + case MINOR: + yyval.intval = YES; + break; + case MAJOR: + yyval.intval = NO; + break; + default: + yyval.intval = NO; + yyerror("must be major or minor"); + break; + } + } + break; + + case 176: +#line 1799 "gram.y" + { + yyval.intval = P_LINE; + } + break; + + case 177: +#line 1805 "gram.y" + { + yyval.intval = P_ALTPEDSTAR; + } + break; + + case 178: +#line 1811 "gram.y" + { + yyval.intval = P_PEDSTAR; + } + break; + + case 180: +#line 1819 "gram.y" + { + } + break; + + case 181: +#line 1823 "gram.y" + { + if (yyvsp[0].intval == FONT_UNKNOWN) { + yyvsp[0].intval = Curr_font; + } + if (yyvsp[-1].intval == FAMILY_DFLT) { + /* user didn't specify a family. Use the current + * family, unless we don't have one yet, in which + * case look it up */ + if (Curr_family == FAMILY_DFLT) { + Curr_family = Score.fontfamily; + } + Titlefont = Curr_family + yyvsp[0].intval; + } + else { + Titlefont = yyvsp[-1].intval + yyvsp[0].intval; + } + } + break; + + case 182: +#line 1842 "gram.y" + { + yyval.intval = FONT_UNKNOWN; + } + break; + + case 183: +#line 1848 "gram.y" + { + yyval.intval = yyvsp[0].intval; + } + break; + + case 184: +#line 1853 "gram.y" + { + yyval.intval = FAMILY_DFLT; + } + break; + + case 185: +#line 1858 "gram.y" + { + yyval.intval = yyvsp[0].intval; + } + break; + + case 186: +#line 1863 "gram.y" + { + Titlesize = Curr_size; + } + break; + + case 187: +#line 1869 "gram.y" + { + Titlesize = yyvsp[-1].intval; + } + break; + + case 188: +#line 1875 "gram.y" + { + Extra = extra_needed(Titlefont, Titlesize, yyvsp[0].stringval); + proc_printcmd(J_CENTER, (struct INPCOORD *) 0, yyvsp[0].stringval, + Titlefont, Titlesize, YES, NO, Extra); + } + break; + + case 189: +#line 1883 "gram.y" + { + double tmp_extra; + + /* if one is taller than the default for the font/size, + * figure out how much more to add on */ + /* can't use MAX passing extra_needed() as arguments because + * it would get executed multiple times, which is a problem */ + Extra = extra_needed(Titlefont, Titlesize, yyvsp[-1].stringval); + tmp_extra = extra_needed(Titlefont, Titlesize, yyvsp[0].stringval); + Extra = MAX(Extra, tmp_extra); + + + proc_printcmd(J_LEFT, (struct INPCOORD *) 0, yyvsp[-1].stringval, + Titlefont, Titlesize, YES, NO, Extra); + proc_printcmd(J_RIGHT, (struct INPCOORD *) 0, yyvsp[0].stringval, + Titlefont, Titlesize, NO, NO, (double) 0.0); + } + break; + + case 190: +#line 1903 "gram.y" + { + double tmp_extra; + + Extra = extra_needed(Titlefont, Titlesize, yyvsp[-2].stringval); + tmp_extra = extra_needed(Titlefont, Titlesize, yyvsp[-1].stringval); + Extra = MAX(Extra, tmp_extra); + tmp_extra = extra_needed(Titlefont, Titlesize, yyvsp[0].stringval); + Extra = MAX(Extra, tmp_extra); + + proc_printcmd(J_LEFT, (struct INPCOORD *) 0, yyvsp[-2].stringval, + Titlefont, Titlesize, YES, NO, Extra); + proc_printcmd(J_CENTER, (struct INPCOORD *) 0, yyvsp[-1].stringval, + Titlefont, Titlesize, NO, NO, (double) 0.0); + proc_printcmd(J_RIGHT, (struct INPCOORD *) 0, yyvsp[0].stringval, + Titlefont, Titlesize, NO, NO, (double) 0.0); + } + break; + + case 191: +#line 1921 "gram.y" + { + char *p; /* pointer through the string */ + int backslash_count; /* how many backslashes in a row */ + int font, size; /* at end of \n-delimited segment */ + char *string_start; /* where current segment begins */ + + /* Convert unescaped input newlines to spaces. + * The +2 in the 'for' initialization is to skip font/size. + */ + backslash_count = 0; + string_start = yyvsp[-2].stringval; + /* If we are running on a file using \r or \r\n for + * line separator, normalize to \n instead */ + for (p = string_start + 2; *p != 0; p++) { + if (*p == '\r') { + if ( *(p+1) != '\n') { + /* \r by itself. Use \n instead */ + *p = '\n'; + } + else { + /* delete the \r */ + char *src, *dest; + for (src = p + 1, dest = p; ; src++, dest++) { + *dest = *src; + if (*src == '\0') { + break; + } + } + } + } + } + + font = Titlefont; + size = Titlesize; + for (p = string_start + 2; *p != 0; p++) { + /* Real newlines not preceeded by an odd number + * of backslashes are converted to spaces. */ + if (*p == '\n' && (backslash_count & 0x1) == 0) { + *p = ' '; + } + + /* Count up number of consecutive backslashes. + * Also, if user explicitly uses \n, split into + * a new paragraph + */ + if (*p == '\\') { + backslash_count++; + if (((backslash_count & 0x1) == 1) + && ( *(p+1) == 'n') ) { + /* Need to split. + * Terminate the current string + * where we are in it, and process it, + * then arrange to continue processing + * on the rest of the string. + */ + *p = '\0'; + (void) fix_string(string_start, + font, size, + Curr_filename, yylineno); + proc_printcmd(yyvsp[-6].intval, (struct INPCOORD*) 0, + string_start, font, size, + YES, NO, 0.0); + + /* The user could change font/size + * in mid-string with \f() and/or \s(). + * so we have to determine what they + * are at the end of the current segment + * and use that for making the copy + * of the remainder of the string. + * The original copy of the remainder + * of the string gets "memory leaked," + * but this is a rare case, so not + * worth worrying about. + */ + end_fontsize(string_start, &font, &size); + string_start = copy_string(p+2, font, size); + p = string_start + 2; + } + } + else { + backslash_count = 0; + } + } + (void) fix_string(string_start, font, size, + Curr_filename, yylineno); + proc_printcmd(yyvsp[-6].intval, (struct INPCOORD*) 0, string_start, + font, size, YES, NO, 0.0); + } + break; + + case 192: +#line 2012 "gram.y" + { + /* Use same paragraph time as last time (or default if + * this is the first paragraph ever in this song.) */ + yyval.intval = Curr_paratype; + } + break; + + case 193: +#line 2020 "gram.y" + { + Curr_paratype = yyvsp[0].intval; + yyval.intval = yyvsp[0].intval; + } + break; + + case 222: +#line 2111 "gram.y" + { + /* strip the quotes from the string and make a copy for later use */ + if (Curr_family == FAMILY_DFLT) { + Curr_family = Score.fontfamily; + } + yyval.stringval = copy_string(stripquotes(yytext), Curr_family + Curr_font, + Curr_size); + } + break; + + case 223: +#line 2122 "gram.y" + { + char *old_string; + + /* append new string part to existing part */ + old_string = yyvsp[-2].stringval; + /* new string part has quotes, so subtract 2 from needed length, + * but need space for null, so overall need 1 less. */ + MALLOCA(char, yyval.stringval, strlen(old_string) + strlen(yytext) - 1); + sprintf(yyval.stringval, "%s%s", old_string, stripquotes(yytext)); + FREE(old_string); + } + break; + + case 224: +#line 2135 "gram.y" + { + /* Here's the deal: the staff/voice specification + * could be lists of staff ranges and/or voices. + * We need a separate copy of the groupinfo + * for each staff/voice. So as we parse the sv_spec, + * we remember which staffs and voices are specified, + * and keep a pointer to the first STAFF in the measure. + * Then after collecting the groupinfo, + * we make copies of the group info for each staff/voice given. + * It has to be copies rather than just a pointer to the + * same stuff, because the coordinates will be different + * for each staff/voice. */ + + /* attach the groupinfo to each of the STAFF structs */ + link_groups(); + } + break; + + case 225: +#line 2154 "gram.y" + { + add_multirest(yyvsp[-1].intval); + /* If there are alternating time signatures, figure out + * which one should be in effect at the end of the multirest */ + if (Alt_timesig_list != 0) { + int m; + + /* The Next_alt_timesig is already pointing to + * the value for after the first measure in the + * multirest, so have to subtract 1 here */ + for (m = 0; m < yyvsp[-1].intval - 1; m++) { + if (Next_alt_timesig == 0) { + /* Shouldn't really ever get here, + * since other code should do the + * wrap-around, but just in case... */ + Next_alt_timesig = Alt_timesig_list; + continue; + } + do { + Next_alt_timesig++; + if (*Next_alt_timesig == TSR_END) { + Next_alt_timesig = Alt_timesig_list; + break; + } + } while (*Next_alt_timesig != TSR_ALTERNATING); + } + if (*Next_alt_timesig == TSR_ALTERNATING) { + Next_alt_timesig++; + } + } + Currstruct_p = (struct MAINLL *) 0; + } + break; + + case 226: +#line 2189 "gram.y" + { + free_staffrange(); + } + break; + + case 227: +#line 2194 "gram.y" + { + begin_range(PL_UNKNOWN); + } + break; + + case 228: +#line 2199 "gram.y" + { + Chord_at_a_time = NO; + } + break; + + case 229: +#line 2205 "gram.y" + { + Chord_at_a_time = YES; + } + break; + + case 233: +#line 2220 "gram.y" + { + begin_map(); + } + break; + + case 234: +#line 2225 "gram.y" + { + end_map(); + } + break; + + case 235: +#line 2230 "gram.y" + { + map_item(); + } + break; + + case 236: +#line 2236 "gram.y" + { + map_item(); + Defining_multiple = YES; + } + break; + + case 237: +#line 2242 "gram.y" + { + /* initialize grpsyl info */ + Curr_grpsyl_p = Last_grpsyl_p = (struct GRPSYL *) 0; + } + break; + + case 239: +#line 2252 "gram.y" + { + /* prepare for a new set of ranges */ + begin_range(Place); + Defining_multiple = YES; + } + break; + + case 240: +#line 2259 "gram.y" + { + /* data is for staff with only one voice */ + save_vno_range(1, 1); + add_to_sv_list(); + } + break; + + case 241: +#line 2267 "gram.y" + { + if (yyvsp[0].intval == YES) { + add_to_sv_list(); + } + } + break; + + case 242: +#line 2276 "gram.y" + { + /* set flag as to whether we are processing tab staff + * information or normal staff info */ + Doing_tab_staff = is_tab_range(); + } + break; + + case 244: +#line 2286 "gram.y" + { + /* several staffs have the same note data */ + Defining_multiple = YES; + } + break; + + case 245: +#line 2292 "gram.y" + { + /* remember which staffs we are currently getting data for */ + /* if only a single number, not a range, staff_range will be + * 0, so use staffnum as high and low of range */ + save_staff_range(yyvsp[-1].intval, (yyvsp[0].intval == 0 ? yyvsp[-1].intval : yyvsp[0].intval)); + } + break; + + case 246: +#line 2300 "gram.y" + { + /* empty - no range, just a single number */ + yyval.intval = 0; + } + break; + + case 247: +#line 2307 "gram.y" + { + Defining_multiple = YES; + yyval.intval = yyvsp[0].intval; + if (yyvsp[0].intval == 0) { + yyerror("staff of 0 is illegal"); + } + } + break; + + case 248: +#line 2317 "gram.y" + { + /* note data applies to a single voice */ + if (rangecheck(yyvsp[-1].intval, MINVOICES, MAXVOICES, "voice") == YES) { + save_vno_range(yyvsp[-1].intval, yyvsp[-1].intval); + yyval.intval = YES; + } + else { + yyval.intval = NO; + } + } + break; + + case 249: +#line 2330 "gram.y" + { + /* note data applies to range of voices */ + if (rangecheck(yyvsp[-3].intval, MINVOICES, MAXVOICES, "voice") == YES && + rangecheck(yyvsp[-1].intval, MINVOICES, MAXVOICES, "voice") == YES) { + if (yyvsp[-1].intval < yyvsp[-3].intval) { + l_yyerror(Curr_filename, yylineno, + "end of voice range is smaller than beginning"); + yyval.intval = NO; + } + else { + save_vno_range(yyvsp[-3].intval, yyvsp[-1].intval); + Defining_multiple = YES; + yyval.intval = YES; + } + } + else { + yyval.intval = NO; + } + } + break; + + case 251: +#line 2355 "gram.y" + { + Defining_multiple = YES; + } + break; + + case 255: +#line 2370 "gram.y" + { + /* Associate any TIMEDSSVs with this group */ + if (Curr_tssv_p != 0) { + tssv_setgrpsyl(Curr_grpsyl_p); + Curr_tssv_p = 0; + } + + /* if no custom beaming indicated, fill in based on previous. */ + if ( Curr_grpsyl_p->beamloc == NOITEM) { + setbeamloc(Curr_grpsyl_p, Last_grpsyl_p); + } + + /* later we check that if there is an 'm', it is + * the only thing in the measure */ + + link_notegroup(Curr_grpsyl_p, Last_grpsyl_p); + Curr_marklist = 0; + /* Save pointer to this group, in case there are additive + * times, and the next group gets its time value from this + * group. In that case, we need this group, not the last one + * of the added groups. */ + Prev_grpsyl_p = Curr_grpsyl_p; + /* Add groups if there were additive time values. */ + if (Extra_time_p != 0) { + Curr_grpsyl_p = expandgrp(Curr_grpsyl_p, Extra_time_p); + /* If there was a custom beam ebm on something with + * additive time, we need make sure ENDITEM is on only + * the last of the expanded groups. */ + if (Curr_grpsyl_p != Prev_grpsyl_p + && Prev_grpsyl_p->beamloc == ENDITEM) { + struct GRPSYL *g_p; + for (g_p = Prev_grpsyl_p; g_p != Curr_grpsyl_p; + g_p = g_p->next) { + g_p->beamloc = INITEM; + } + Curr_grpsyl_p->beamloc = ENDITEM; + } + Last_grpsyl_p = Curr_grpsyl_p->prev; + } + Curr_timelist_p = 0; + } + break; + + case 260: +#line 2428 "gram.y" + { + if (Chord_at_a_time == YES) { + yyerror("mid-measure changes not allowed on chord-at-a-time input"); + } + } + break; + + case 261: +#line 2437 "gram.y" + { + Curr_tssv_p = tssv_create(C_SCORE); + } + break; + + case 262: +#line 2443 "gram.y" + { + Curr_tssv_p = tssv_create(C_STAFF); + } + break; + + case 263: +#line 2449 "gram.y" + { + Curr_tssv_p = tssv_create(C_VOICE); + } + break; + + case 266: +#line 2463 "gram.y" + { + if (Curr_grpsyl_p != 0 && Curr_grpsyl_p->grpsyl == GS_GROUP + && Curr_grpsyl_p->grpvalue == GV_ZERO) { + yyerror("mid-measure clef change not allowed after grace note\n"); + } + tssv_update(Curr_tssv_p, yyvsp[-2].intval, yyvsp[0].intval); + } + break; + + case 267: +#line 2473 "gram.y" + { + switch (yyvsp[-2].intval) { + + case DEFOCT: + case RELEASE: + tssv_update(Curr_tssv_p, yyvsp[-2].intval, yyvsp[0].intval); + break; + + default: + yyerror("parameter type cannot be changed mid-measure"); + break; + } + } + break; + + case 269: +#line 2493 "gram.y" + { + if (Good_till_canceled == NO) { + /* use default attributes */ + Curr_grpsyl_p->grpvalue = GV_NORMAL; + Curr_grpsyl_p->grpsize = GS_NORMAL; + Curr_grpsyl_p->headshape = HS_UNKNOWN; + } + else { + /* re-use previous style */ + copy_attributes(Curr_grpsyl_p, Last_grpsyl_p); + } + } + break; + + case 270: +#line 2508 "gram.y" + { + Good_till_canceled = NO; + } + break; + + case 271: +#line 2514 "gram.y" + { + } + break; + + case 272: +#line 2518 "gram.y" + { + Good_till_canceled = NO; + } + break; + + case 273: +#line 2524 "gram.y" + { + Good_till_canceled = YES; + } + break; + + case 274: +#line 2529 "gram.y" + { + } + break; + + case 275: +#line 2534 "gram.y" + { + if (Good_till_canceled == YES) { + yyerror("can't use ... and more than one [] on same chord"); + } + } + break; + + case 276: +#line 2541 "gram.y" + { + /* NULL token to cause allocation of a GRPSYL struct */ + Last_grpsyl_p = Curr_grpsyl_p; + Curr_grpsyl_p = newGRPSYL(GS_GROUP); + } + break; + + case 277: +#line 2548 "gram.y" + { + /* an empty marklist means we should use + * the same attributes as the last time */ + copy_attributes(Curr_grpsyl_p, Last_grpsyl_p); + } + break; + + case 281: +#line 2565 "gram.y" + { + Curr_grpsyl_p->nwith = (short) Item_count; + Curr_grpsyl_p->withlist = Curr_marklist; + } + break; + + case 285: +#line 2581 "gram.y" + { + if (Curr_grpsyl_p->stemdir != UNKNOWN && + Curr_grpsyl_p->stemdir != yyvsp[0].intval) { + l_warning(Curr_filename, yylineno, + "both stem directions specified; using last instance"); + } + if (Doing_tab_staff == YES) { + yyerror("stem direction specification not allowed on tab staff"); + } + else { + Curr_grpsyl_p->stemdir = yyvsp[0].intval; + } + } + break; + + case 286: +#line 2597 "gram.y" + { + if (yyvsp[-2].intval != DIST) { + yyerror("unexpected parameter name"); + } + else { + if (Curr_grpsyl_p->restdist != NORESTDIST && + Curr_grpsyl_p->restdist != yyvsp[-1].intval * yyvsp[0].intval) { + l_warning(Curr_filename, yylineno, + "more than one dist value specified; using last instance"); + } + Curr_grpsyl_p->restdist = yyvsp[-1].intval * yyvsp[0].intval; + } + } + break; + + case 287: +#line 2613 "gram.y" + { + if (Curr_grpsyl_p->ho_usage != HO_NONE && + Curr_grpsyl_p->ho_usage != yyvsp[0].intval) { + l_warning(Curr_filename, yylineno, + "More than one ho type specified; last instance used"); + } + Curr_grpsyl_p->ho_usage = yyvsp[0].intval; + } + break; + + case 288: +#line 2624 "gram.y" + { + if (Curr_grpsyl_p != 0) { + if (Curr_grpsyl_p->headshape != HS_UNKNOWN) { + l_warning(Curr_filename, yylineno, + "multiple head shapes specified, using last"); + } + /* +2 to skip past extraneous font/size */ + if (Doing_tab_staff == YES && strcmp(yyvsp[0].stringval + 2, "allx") != 0) { + yyerror("allx is the only headshape allowed on tab staffs"); + } + if ((Curr_grpsyl_p->headshape = get_shape_num(yyvsp[0].stringval + 2)) + == HS_UNKNOWN) { + l_yyerror(Curr_filename, yylineno, + "'%s' is not a valid head shape name", + ascii_str(yyvsp[0].stringval, YES, NO, TM_NONE)); + } + } + else { + pfatal("Curr_grpsyl_p was null for setting hs"); + } + /* We don't need the name anymore; we have its corresponding + * number that we use internally. */ + FREE(yyvsp[0].stringval); + } + break; + + case 289: +#line 2651 "gram.y" + { + if (Curr_grpsyl_p->stemlen != STEMLEN_UNKNOWN && + fabs(Curr_grpsyl_p->stemlen - yyvsp[0].floatval * STEPSIZE) > 0.0001) { + l_warning(Curr_filename, yylineno, + "more than one len specified; using last instance"); + } + Curr_grpsyl_p->stemlen = yyvsp[0].floatval * STEPSIZE; + } + break; + + case 290: +#line 2662 "gram.y" + { + if (yyvsp[0].intval <= 0) { + yyerror("slash number must be > 0"); + } + else if (yyvsp[0].intval > 8) { + /* we decided 8 slashes would be at least 256th note + * or shorter, and 256th is the shortest note we + * support, 8 slashes is plenty */ + yyerror("slash number must be <= 8"); + } + if (Curr_grpsyl_p->slash_alt > 0 && + Curr_grpsyl_p->slash_alt != yyvsp[0].intval) { + l_warning(Curr_filename, yylineno, + "more than one slash value specified; using last instance"); + } + if (Curr_grpsyl_p->slash_alt < 0) { + yyerror("only one slash/alt allowed per group"); + } + Curr_grpsyl_p->slash_alt = yyvsp[0].intval; + } + break; + + case 291: +#line 2685 "gram.y" + { + yyval.intval = HO_RIGHT; + } + break; + + case 292: +#line 2691 "gram.y" + { + yyval.intval = HO_LEFT; + } + break; + + case 293: +#line 2697 "gram.y" + { + /* We want to silently accept identical values specified + * more than once, so use fuzzy compare to deal with roundoff */ + if (Curr_grpsyl_p->ho_usage == HO_VALUE && + fabs(Curr_grpsyl_p->ho_value - yyvsp[-1].intval * yyvsp[0].floatval) > 0.0001) { + l_warning(Curr_filename, yylineno, + "More than one ho value specified; last instance used"); + } + Curr_grpsyl_p->ho_value = yyvsp[-1].intval * yyvsp[0].floatval; + yyval.intval = HO_VALUE; + } + break; + + case 294: +#line 2711 "gram.y" + { + yyval.intval = 1; + } + break; + + case 295: +#line 2717 "gram.y" + { + yyval.intval = yyvsp[0].intval; + } + break; + + case 301: +#line 2739 "gram.y" + { + yyvsp[0].floatval *= yyvsp[-1].intval; + if (fabs(Curr_grpsyl_p->beamslope - NOBEAMANGLE) > 0.01) { + l_warning(Curr_filename, yylineno, + "multiple slope values specified; using last one"); + } + if (frangecheck(yyvsp[0].floatval, MINBEAMANGLE, MAXBEAMANGLE, "slope") == YES) { + Curr_grpsyl_p->beamslope = yyvsp[0].floatval; + } + } + break; + + case 302: +#line 2752 "gram.y" + { + if (yyvsp[0].intval <= 0) { + yyerror("alt number must be > 0"); + } + if (Curr_grpsyl_p->slash_alt != 0) { + yyerror("only one slash/alt allowed per group"); + } + if (Doing_tab_staff == YES) { + yyerror("alt not allowed on tablature staff"); + } + /* Keep small enough that 1 shifted left by this still + * fits in a 16-bit int. Should be more than enough! */ + if (yyvsp[0].intval > 15) { + warning("alt value too large"); + yyvsp[0].intval = 15; + } + Curr_grpsyl_p->slash_alt = -yyvsp[0].intval; + } + break; + + case 303: +#line 2773 "gram.y" + { + int n; + + /* add a slur to each note in the chord. Don't know + * which pitch to slur to yet, just that it will be to + * the "matching" note in the next chord, so use + * special magic pitch of 'M' to convey this */ + for (n = 0; n < Curr_grpsyl_p->nnotes; n++) { + add_slurto(Curr_grpsyl_p, 'M', USE_DFLT_OCTAVE, n, yyvsp[-1].intval); + set_slurdir(Curr_grpsyl_p, -1, yyvsp[0].intval); + } + } + break; + + case 304: +#line 2788 "gram.y" + { + int n; + + Curr_grpsyl_p->tie = YES; + for (n = 0; n < Curr_grpsyl_p->nnotes; n++) { + Curr_grpsyl_p->notelist[n].tie = YES; + Curr_grpsyl_p->notelist[n].tiestyle = yyvsp[-1].intval; + Curr_grpsyl_p->notelist[n].tiedir = yyvsp[0].intval; + } + } + break; + + case 305: +#line 2800 "gram.y" + { + if (Curr_marklist == 0) { + /* allocate space for a list of marks */ + MALLOCA(char *, Curr_marklist, ITEMS); + Item_count = 0; + Max_items = ITEMS; + } + } + break; + + case 306: +#line 2810 "gram.y" + { + yyval.intval = UNKNOWN; + } + break; + + case 307: +#line 2816 "gram.y" + { + yyval.intval = yyvsp[0].intval; + } + break; + + case 310: +#line 2828 "gram.y" + { + /* if too many items, get some more space */ + if (Item_count >= Max_items) { + Max_items += ITEMS; + if ((Curr_marklist = (char **) realloc(Curr_marklist, + Max_items * sizeof(char **))) + == (char **) 0) { + l_no_mem(__FILE__, __LINE__); + } + } + Curr_marklist[Item_count++] = yyvsp[0].stringval; + } + break; + + case 311: +#line 2842 "gram.y" + { + MALLOCA(char, yyval.stringval, strlen(yyvsp[0].stringval) + 3); + yyval.stringval[0] = FONT_TR; + yyval.stringval[1] = DFLT_SIZE; + sprintf(yyval.stringval + 2, yyvsp[0].stringval); + } + break; + + case 313: +#line 2855 "gram.y" + { + yyval.stringval = (Curr_grpsyl_p->grpsize == GS_NORMAL + ? "\\(dot)" : "\\(smdot)"); + } + break; + + case 314: +#line 2862 "gram.y" + { + yyval.stringval = (Curr_grpsyl_p->grpsize == GS_NORMAL + ? "\\(leg)" : "\\(smleg)"); + } + break; + + case 315: +#line 2869 "gram.y" + { + yyval.stringval = (Curr_grpsyl_p->grpsize == GS_NORMAL + ? "\\(acc_gt)" : "\\(smacc_gt)"); + } + break; + + case 316: +#line 2876 "gram.y" + { + yyval.stringval = (Curr_grpsyl_p->grpsize == GS_NORMAL + ? "\\(acc_hat)" : "\\(smacc_hat)"); + } + break; + + case 317: +#line 2882 "gram.y" + { + if (Curr_grpsyl_p->grpvalue == GV_ZERO) { + l_warning(Curr_filename, yylineno, + "both grace and cue specified; using last instance"); + } + Curr_grpsyl_p->grpvalue = GV_NORMAL; + Curr_grpsyl_p->grpsize = GS_SMALL; + } + break; + + case 318: +#line 2893 "gram.y" + { + if (Curr_grpsyl_p->grpsize == GS_SMALL + && Curr_grpsyl_p->grpvalue != GV_ZERO) { + l_warning(Curr_filename, yylineno, + "both cue and grace specified; using last instance"); + } + + Curr_grpsyl_p->grpsize = GS_SMALL; + Curr_grpsyl_p->grpvalue = GV_ZERO; + } + break; + + case 319: +#line 2906 "gram.y" + { + if (Curr_grpsyl_p->headshape != HS_UNKNOWN) { + l_warning(Curr_filename, yylineno, + "diam is overriding previous headshapes specification"); + } + Curr_grpsyl_p->headshape = get_shape_num("diam"); + } + break; + + case 320: +#line 2916 "gram.y" + { + if (Curr_grpsyl_p->headshape != HS_UNKNOWN) { + l_warning(Curr_filename, yylineno, + "xnote is overriding previous headshapes specification"); + } + Curr_grpsyl_p->headshape = get_shape_num( + Doing_tab_staff == YES ? "allx" : "x"); + } + break; + + case 321: +#line 2927 "gram.y" + { + yyval.intval = UP; + } + break; + + case 322: +#line 2933 "gram.y" + { + yyval.intval = DOWN; + } + break; + + case 323: +#line 2939 "gram.y" + { + /* custom beaming cannot be nested */ + struct GRPSYL *prev_like_gs_p; + /* Find previous group with same grace-ness. Can't use + * prevsimilar() here, since it looks at grpcont too. */ + for (prev_like_gs_p = Last_grpsyl_p; prev_like_gs_p != 0 && + prev_like_gs_p->grpvalue != Curr_grpsyl_p->grpvalue; + prev_like_gs_p = prev_like_gs_p->prev) { + ; + } + if (prev_like_gs_p != 0 && + ((prev_like_gs_p->beamloc == STARTITEM) + || (prev_like_gs_p->beamloc == INITEM)) ) { + yyerror("custom beaming may not be nested"); + } + /* Non-custom beaming, if any, is done later, in do_bar() */ + else { + /* begin custom beaming */ + Curr_grpsyl_p->beamloc = STARTITEM; + if (Curr_grpsyl_p->basictime < 8 && yyvsp[0].intval == CS_SAME) { + yyerror("beamed notes must be 8th or shorter"); + } + } + Curr_grpsyl_p->beamto = yyvsp[0].intval; + } + break; + + case 324: +#line 2967 "gram.y" + { + Curr_grpsyl_p->breakbeam = YES; + } + break; + + case 325: +#line 2973 "gram.y" + { + struct GRPSYL *last_nongrace_p; + + /* find the previous group, skipping grace groups */ + for (last_nongrace_p = Last_grpsyl_p; + last_nongrace_p != (struct GRPSYL *) 0 + && last_nongrace_p->grpvalue == GV_ZERO; + last_nongrace_p = last_nongrace_p->prev) { + ; + } + + /* check that a custom beam is in progress */ + if ((last_nongrace_p == (struct GRPSYL *) 0) + || ((last_nongrace_p != (struct GRPSYL *) 0) + && (last_nongrace_p->beamloc != STARTITEM) + && (last_nongrace_p->beamloc != INITEM) )) { + yyerror("'ebm' unexpected: no custom beaming in progress"); + } + else { + Curr_grpsyl_p->beamloc = ENDITEM; + Curr_grpsyl_p->beamto = last_nongrace_p->beamto; + if (Curr_grpsyl_p->basictime < 8 + && Last_grpsyl_p->beamto == CS_SAME) { + yyerror("beamed notes must be 8th or shorter"); + } + } + } + break; + + case 326: +#line 3002 "gram.y" + { + /* Use the same as last time or default timeunit. + * If that involves additive time values, + * save pointer to that info in Extra_time_p for later use. */ + Extra_time_p = copy_timeunit(Curr_grpsyl_p, Prev_grpsyl_p, + Extra_time_p); + } + break; + + case 327: +#line 3012 "gram.y" + { + if (Curr_grpsyl_p->is_meas == YES) { + Curr_grpsyl_p->fulltime = Score.time; + } + else { + Curr_grpsyl_p->fulltime = yyvsp[0].ratval; + } + } + break; + + case 328: +#line 3022 "gram.y" + { + yyval.intval = CS_SAME; + } + break; + + case 329: +#line 3028 "gram.y" + { + CSBused = YES; + switch (yyvsp[0].intval) { + case PL_ABOVE: + yyval.intval = CS_ABOVE; + break; + case PL_BELOW: + yyval.intval = CS_BELOW; + break; + default: + yyerror("bm with staff must be 'above' or 'below'"); + yyval.intval = CS_SAME; + } + } + break; + + case 330: +#line 3044 "gram.y" + { + yyval.ratval.n = yyvsp[0].intval; + yyval.ratval.d = 1; + + /* if filling in a GRPSYL struct, need to fill in basic time, + * could also be here due to beamstyle, in which case the + * Curr_grpsyl_p will be NULL, or when getting tuplet duration, + * in which case flag will be set */ + if (Curr_grpsyl_p != (struct GRPSYL *) 0 + && Getting_tup_dur == NO) { + /* If we are gathering basictime as part of a list + * of additive times, we will save the value a few + * lines down from here. But in the normal case, + * we set basictime in the current GRPSYL. */ + if (Extra_time_p == 0) { + /* 1/2 is 0 internally. 1/4 is -1 internally */ + Curr_grpsyl_p->basictime = (yyvsp[0].intval == 2 ? 0 : -1); + } + } + /* If doing additive times, need to save value. */ + if (Extra_time_p != 0) { + Extra_basictime = (yyvsp[0].intval == 2 ? 0 : -1); + } + } + break; + + case 331: +#line 3071 "gram.y" + { + /* check that a power of two from 1 to MAXBASICTIME */ + if (power_of2check(yyvsp[0].intval, "note basic time value") == NO) { + /* force to a power to two, so that other code + * (like in expandgrp) that expect a sane value + * to not blow up. This may lead to a somewhat + * misleading "time does not add up to time * signature message, but we don't know what + * time they really meant, and this is better + * than pfataling. */ + yyvsp[0].intval = 2; + } + /* can't use rangecheck here because the error message would + * say 0 and -1 are valid times, which is only true internally-- + * the user has to use 1/2, 1/4 or m. */ + if (yyvsp[0].intval < MINBASICTIME || yyvsp[0].intval > MAXBASICTIME) { + l_yyerror(Curr_filename, yylineno, + "time value must be between 1 and %d, or 1/2 or 1/4 or m", + MAXBASICTIME); + } + yyval.ratval.n = 1; + /* avoid division by zero */ + if (yyvsp[0].intval == 0) { + yyvsp[0].intval = 1; + } + yyval.ratval.d = yyvsp[0].intval; + if (Curr_grpsyl_p != (struct GRPSYL *) 0 + && Getting_tup_dur == NO) { + if (Curr_timelist_p == 0) { + Curr_grpsyl_p->basictime = yyvsp[0].intval; + } + } + /* If doing additive times, need to save value */ + if (Extra_time_p != 0) { + Extra_basictime = yyvsp[0].intval; + } + } + break; + + case 332: +#line 3110 "gram.y" + { + free_extra_time(); + } + break; + + case 334: +#line 3120 "gram.y" + { + /* Set basictime to what we saved in basic_time_val rule, + * then calculate fulltime from that and number of dots. */ + Curr_timelist_p->basictime = Extra_basictime; + Curr_timelist_p->fulltime = calcfulltime(yyvsp[-1].ratval, yyvsp[0].intval); + /* handle subtracted times by negating the fulltime */ + if (yyvsp[-3].intval == -1) { + Curr_timelist_p->fulltime = rneg(Curr_timelist_p->fulltime); + } + } + break; + + case 335: +#line 3134 "gram.y" + { + struct TIMELIST *timelist_p; + + MALLOC(TIMELIST, timelist_p, 1); + /* Add to end of linked list */ + timelist_p->next = 0; + /* Init fulltime to something to avoid garbage if there + * in a user input error */ + timelist_p->fulltime = Zero; + if (Extra_time_p == 0) { + Last_alloced_timelist_p = Extra_time_p = timelist_p; + } + else { + Curr_timelist_p->next = timelist_p; + } + /* Keep track of where to append next item to list, if any */ + Curr_timelist_p = timelist_p; + } + break; + + case 336: +#line 3155 "gram.y" + { + User_meas_time = NO; + } + break; + + case 337: +#line 3161 "gram.y" + { + if (Curr_grpsyl_p != (struct GRPSYL *) 0 + && Getting_tup_dur == NO) { + Curr_grpsyl_p->is_meas = YES; + User_meas_time = YES; + } + else { + yyerror("'m' is not valid here"); + } + } + break; + + case 338: +#line 3173 "gram.y" + { + yyval.intval = 0; + } + break; + + case 339: +#line 3179 "gram.y" + { + /* count up the number of dots */ + yyval.intval = yyvsp[-1].intval + 1; + } + break; + + case 340: +#line 3185 "gram.y" + { + /* We can't distinguish between the default 0.0 and + * if user explicitly sets to 0.0, so if they set to 0.0 + * then to something else, we won't catch that as setting + * twice, but that shouldn't be common. Besides, if they + * expect them to be additive, adding to zero will work + * as they expect... Because of roundoff, we can't do + * exact compare for specifying the same value more than once, + * so treat as identical if pretty close. */ + if (Curr_grpsyl_p->padding != 0.0 && + fabs(Curr_grpsyl_p->padding - (yyvsp[0].floatval * STEPSIZE)) + > 0.0001) { + l_warning(Curr_filename, yylineno, + "padding specified more than once; using last instance"); + } + Curr_grpsyl_p->padding = yyvsp[0].floatval * STEPSIZE; + } + break; + + case 341: +#line 3205 "gram.y" + { + yyval.floatval = (float) yyvsp[-1].intval * yyvsp[0].floatval; + } + break; + + case 342: +#line 3210 "gram.y" + { + /* no sign--must be a positive number */ + yyval.intval = 1; + } + break; + + case 343: +#line 3217 "gram.y" + { + /* user wants a negative number */ + yyval.intval = -1; + } + break; + + case 344: +#line 3223 "gram.y" + { + Curr_grpsyl_p->grpcont = GC_NOTES; + if (yyvsp[0].intval == 0) { + /* no notes listed, use same as previous group */ + copy_notes(Curr_grpsyl_p, Last_grpsyl_p); + } + else { + resize_notelist(Curr_grpsyl_p); + } + } + break; + + case 348: +#line 3248 "gram.y" + { + /* allocate GRPSYL for the case where everything is defaulted + * from the previous group, with just an extra attribute + * like ? or ~ specified. */ + if (Curr_grpsyl_p == (struct GRPSYL *) 0) { + /* shouldn't ever happen, but just in case... */ + Curr_grpsyl_p = newGRPSYL(GS_GROUP); + } + if (Last_grpsyl_p != (struct GRPSYL *) 0 && + Last_grpsyl_p->nnotes >= 1) { + copy_notes(Curr_grpsyl_p, Last_grpsyl_p); + } + else if (Last_grpsyl_p != (struct GRPSYL *) 0 && + Last_grpsyl_p->grpcont == GC_REST) { + Curr_grpsyl_p->grpcont = GC_REST; + } + } + break; + + case 349: +#line 3268 "gram.y" + { + if (Curr_grpsyl_p->grpcont == GC_NOTES && + Curr_grpsyl_p->nnotes > 0) { + Curr_grpsyl_p->notelist[Curr_grpsyl_p->nnotes - 1] + .notesize = GS_SMALL; + } + else if (Curr_grpsyl_p->grpcont == GC_REST) { + Curr_grpsyl_p->grpsize = GS_SMALL; + } + else { + yyerror("no note specified for '?'"); + } + } + break; + + case 350: +#line 3284 "gram.y" + { + if (Curr_grpsyl_p->grpcont != GC_NOTES) { + yyerror("can't tie a rest or space"); + } + else if (Curr_grpsyl_p->nnotes > 0) { + struct NOTE *n_p; + n_p = &(Curr_grpsyl_p->notelist[Curr_grpsyl_p->nnotes - 1]); + n_p->tie = YES; + n_p->tiestyle = yyvsp[-1].intval; + n_p->tiedir = yyvsp[0].intval; + } + else { + yyerror("no note specified for '~'"); + } + } + break; + + case 351: +#line 3302 "gram.y" + { + if (Curr_grpsyl_p->nnotes > 0) { + switch (Curr_grpsyl_p->notelist + [Curr_grpsyl_p->nnotes - 1].letter) { + case PP_REST: + case PP_SPACE: + case PP_RPT: + case PP_NO_PITCH: /* this one not really possible */ + addsym(yyvsp[0].stringval, Curr_grpsyl_p->c, CT_GRPSYL); + break; + default: + addsym(yyvsp[0].stringval, Curr_grpsyl_p->notelist + [Curr_grpsyl_p->nnotes - 1].c, CT_NOTE); + break; + } + var_valid(); + } + else if (Curr_grpsyl_p->grpcont == GC_REST) { + /* This should really never be hit anymore since + * chord-at-a-time code was added, but shouldn't + * hurt to leave it, just in case. */ + addsym(yyvsp[0].stringval, Curr_grpsyl_p->c, CT_GRPSYL); + var_valid(); + } + else { + l_yyerror(Curr_filename, yylineno, + "no note specified for location tag '%s'", yyvsp[0].stringval); + } + } + break; + + case 352: +#line 3334 "gram.y" + { + /* this is for bend on a non-tablature staff */ + if (Doing_tab_staff == YES) { + yyerror("^ bend not allowed on tablature staff; use quoted bend string"); + } + else { + add_slurto(Curr_grpsyl_p, yyvsp[-1].intval, yyvsp[0].intval, + Curr_grpsyl_p->nnotes - 1, L_NORMAL); + if (Curr_grpsyl_p->nnotes > 0) { + Curr_grpsyl_p->notelist + [Curr_grpsyl_p->nnotes - 1] + .is_bend = YES; + } + } + } + break; + + case 353: +#line 3352 "gram.y" + { + /* this is for a small bend (1/4 step) on a non-tab staff */ + if (Doing_tab_staff == YES) { + yyerror("^/ not allowed on tablature staff; use quoted bend string"); + } + else if (Curr_grpsyl_p != 0 && Curr_grpsyl_p->nnotes > 0) { + Curr_grpsyl_p->notelist[Curr_grpsyl_p->nnotes - 1] + .smallbend = YES; + } + } + break; + + case 354: +#line 3365 "gram.y" + { + if (Curr_grpsyl_p->grpcont == GC_NOTES && + Curr_grpsyl_p->nnotes > 0) { + if ((Curr_grpsyl_p->notelist[Curr_grpsyl_p->nnotes - 1] + .headshape = get_shape_num(yyvsp[0].stringval + 2)) + == HS_UNKNOWN) { + l_yyerror(Curr_filename, yylineno, + "'%s' is not a valid head shape name", + ascii_str(yyvsp[0].stringval, YES, NO, TM_NONE)); + } + } + else { + yyerror("no note specified for headshape"); + } + FREE(yyvsp[0].stringval); + } + break; + + case 358: +#line 3394 "gram.y" + { + yyval.intval = yyvsp[-1].intval + yyvsp[0].intval; /* total number of notes */ + } + break; + + case 359: +#line 3400 "gram.y" + { + yyval.intval = 0; + } + break; + + case 360: +#line 3406 "gram.y" + { + switch (yyvsp[0].intval) { + case PL_ABOVE: + Curr_grpsyl_p->stemto = CS_ABOVE; + break; + case PL_BELOW: + Curr_grpsyl_p->stemto = CS_BELOW; + break; + default: + yyerror("cross staff stem must be with 'above' or 'below'"); + Curr_grpsyl_p->stemto = CS_SAME; + } + if (yyvsp[-1].intval == 0) { + /* Maybe this wouldn't really hurt to allow, + * but it's rather silly--why would user bother to go + * to the trouble of saying there are cross staff stem + * notes, but then not list any? + */ + yyerror("cross-staff stem note list is empty"); + } + yyval.intval = yyvsp[-1].intval; + } + break; + + case 361: +#line 3430 "gram.y" + { + CSSused = YES; + Curr_grpsyl_p->stemto_idx = Curr_grpsyl_p->nnotes; + } + break; + + case 362: +#line 3436 "gram.y" + { + /* No notes. If this is for the list of "normal" staff notes, + * and there are no "other" staff notes (for cross-staff stems), + * this means use the same notes as the last group. */ + yyval.intval = 0; + } + break; + + case 363: +#line 3445 "gram.y" + { + /* return number of notes in notelist */ + yyval.intval = yyvsp[-2].intval + 1; + } + break; + + case 365: +#line 3454 "gram.y" + { + add_note(Curr_grpsyl_p, (int) PP_REST, 0, USE_DFLT_OCTAVE, + 0, NO, (char *) 0); + } + break; + + case 366: +#line 3461 "gram.y" + { + /* temporarily stash uncompressibility (NO in this case) + * in the octave field */ + add_note(Curr_grpsyl_p, (int) PP_SPACE, 0, NO, + 0, NO, (char *) 0); + if (Curr_grpsyl_p->is_meas == YES && User_meas_time == YES) { + yyerror("cannot specify time value on measure space"); + } + } + break; + + case 367: +#line 3473 "gram.y" + { + /* temporarily stash uncompressibility (YES in this case) + * in the octave field */ + add_note(Curr_grpsyl_p, (int) PP_SPACE, 0, YES, + 0, NO, (char *) 0); + if (Curr_grpsyl_p->is_meas == YES && User_meas_time == YES) { + yyerror("cannot specify time value on measure uncompressible space"); + } + } + break; + + case 368: +#line 3485 "gram.y" + { + if (Curr_grpsyl_p->is_meas == YES) { + if (User_meas_time == YES) { + yyerror("cannot specify time value on m rpt"); + } + } + else { + yyerror("rpt can only be used with m"); + } + add_note(Curr_grpsyl_p, (int) PP_RPT, 0, USE_DFLT_OCTAVE, + 0, NO, (char *) 0); + } + break; + + case 369: +#line 3500 "gram.y" + { + if (yyvsp[0].intval == SINGLEBAR) { + /* lexer thinks this is 'bar' + * but is really 'b' 'a' 'r' */ + keyword_notes(yytext); + } + else if (yyvsp[0].intval == ENDBAR) { + /* lexer thinks this is 'endbar' + * but is really 'en' 'd' 'b' 'a' 'r' */ + add_note(Curr_grpsyl_p, (int) 'e', 'n', + USE_DFLT_OCTAVE, 0, NO, (char *) 0); + keyword_notes(yytext + 2); + } + else { + yyerror("bar type not valid here"); + } + } + break; + + case 370: +#line 3520 "gram.y" + { + /* lexer thinks this is 'grace' but really 'g' 'r' 'a' 'c' 'e' */ + keyword_notes(yytext); + } + break; + + case 371: +#line 3527 "gram.y" + { + if (yyvsp[0].intval == ENDING_BARRED) { + keyword_notes(yytext); + } + else { + l_yyerror(Curr_filename, yylineno, + "%s not valid here", yytext); + } + } + break; + + case 372: +#line 3538 "gram.y" + { + if (yyvsp[0].intval == J_RAGPARA) { + keyword_notes(yytext); + } + else { + l_yyerror(Curr_filename, yylineno, + "%s not valid here", yytext); + } + } + break; + + case 373: +#line 3550 "gram.y" + { + if (yyvsp[0].intval == BRACELIST) { + keyword_notes(yytext); + } + else { + l_yyerror(Curr_filename, yylineno, + "%s not valid here", yytext); + } + } + break; + + case 374: +#line 3562 "gram.y" + { + if (yyvsp[0].intval == BASS) { + keyword_notes(yytext); + } + else { + l_yyerror(Curr_filename, yylineno, + "%s not valid here", yytext); + } + } + break; + + case 375: +#line 3574 "gram.y" + { + Curr_grpsyl_p->notelist[Curr_grpsyl_p->nnotes - 1].note_has_paren = YES; + } + break; + + case 376: +#line 3579 "gram.y" + { + if (Doing_tab_staff == YES) { + add_note(Curr_grpsyl_p, yyvsp[-1].intval, 0, NOFRET, 0, NO, yyvsp[0].stringval); + } + else { + add_note(Curr_grpsyl_p, yyvsp[-1].intval, 0, USE_DFLT_OCTAVE, 0, NO, yyvsp[0].stringval); + } + } + break; + + case 377: +#line 3590 "gram.y" + { + if (Doing_tab_staff == YES) { + yyerror("extraneous parentheses around accidental"); + } + add_note(Curr_grpsyl_p, yyvsp[-4].intval, yyvsp[-2].intval, yyvsp[0].intval, 0, YES, (char *) 0); + } + break; + + case 378: +#line 3599 "gram.y" + { + if (Doing_tab_staff == NO) { + yyerror("extraneous parentheses around octave"); + } + add_note(Curr_grpsyl_p, yyvsp[-4].intval, 0, yyvsp[-2].intval, 0, YES, yyvsp[0].stringval); + } + break; + + case 379: +#line 3608 "gram.y" + { + /* Whoops! The left paren was really for a new note, + * which happens to be parenthesized. But beause yacc only + * looks ahead one token, it finds out too late. So we + * catch it here, push the parenthesis and pitch back into + * the input and return back to the parent grammar rule, + * since we now have complete note. */ + pushback(yytext[0]); + pushback('('); + add_note(Curr_grpsyl_p, yyvsp[-2].intval, 0, + (Doing_tab_staff ? NOFRET : USE_DFLT_OCTAVE), + 0, NO, (char *) 0); + } + break; + + case 380: +#line 3624 "gram.y" + { + add_note(Curr_grpsyl_p, yyvsp[-4].intval, yyvsp[-3].intval, yyvsp[-1].intval, yyvsp[-2].intval, NO, yyvsp[0].stringval); + } + break; + + case 381: +#line 3630 "gram.y" + { + if (Doing_tab_staff == NO) { + yyerror("extraneous parentheses around octave"); + } + add_note(Curr_grpsyl_p, yyvsp[-6].intval, yyvsp[-5].intval, yyvsp[-2].intval, yyvsp[-4].intval, YES, yyvsp[0].stringval); + } + break; + + case 382: +#line 3639 "gram.y" + { + /* Whoops! The left paren was really for a new note, + * which happens to be parenthesized. But beause yacc only + * looks ahead one token, it finds out too late. So we + * catch it here, push the parenthesis and pitch back into + * the input and return back to the parent grammar rule, + * since we now have complete note. */ + pushback(yytext[0]); + pushback('('); + add_note(Curr_grpsyl_p, yyvsp[-3].intval, yyvsp[-2].intval, + (Doing_tab_staff ? NOFRET : USE_DFLT_OCTAVE), + 0, NO, (char *) 0); + } + break; + + case 383: +#line 3655 "gram.y" + { + add_note(Curr_grpsyl_p, yyvsp[-3].intval, 0, yyvsp[-1].intval, yyvsp[-2].intval, NO, yyvsp[0].stringval); + } + break; + + case 384: +#line 3661 "gram.y" + { + add_note(Curr_grpsyl_p, yyvsp[-5].intval, 0, yyvsp[-2].intval, yyvsp[-4].intval, YES, yyvsp[0].stringval); + } + break; + + case 385: +#line 3667 "gram.y" + { + if (Doing_tab_staff == YES && yyvsp[-1].intval != '\0') { + yyerror("accidental must be before fret number"); + } + add_note(Curr_grpsyl_p, yyvsp[-3].intval, yyvsp[-1].intval, yyvsp[-2].intval, 0, NO, yyvsp[0].stringval); + } + break; + + case 386: +#line 3676 "gram.y" + { + add_note(Curr_grpsyl_p, yyvsp[-4].intval, yyvsp[-1].intval, yyvsp[-3].intval, 0, YES, (char *) 0); + } + break; + + case 387: +#line 3682 "gram.y" + { + /* Whoops! The left paren was really for a new note, + * which happens to be parenthesized. But beause yacc only + * looks ahead one token, it finds out too late. So we + * catch it here, push the parenthesis and pitch back into + * the input and return back to the parent grammar rule, + * since we now have complete note. */ + pushback(yytext[0]); + pushback('('); + add_note(Curr_grpsyl_p, yyvsp[-3].intval, 0, yyvsp[-2].intval, 0, NO, (char *) 0); + } + break; + + case 388: +#line 3695 "gram.y" + { + yyval.stringval = (char *) 0; + } + break; + + case 389: +#line 3701 "gram.y" + { + if (Doing_tab_staff == NO) { + /* try to give helpful error message */ + if (get_shape_num(yyvsp[0].stringval + 2) != HS_UNKNOWN) { + yyerror("missing 'hs' before headshape string"); + } + else if (strcmp(yyvsp[0].stringval + 2, "full") == 0 || isdigit(yyvsp[0].stringval[2])) { + yyerror("bend string not allowed on non-tablature staff; use ^"); + } + else { + yyerror("unexpected string"); + } + yyval.stringval = (char *) 0; + } + } + break; + + case 390: +#line 3718 "gram.y" + { + /* return 'a' to 'g' value */ + yyval.intval = (int) *yytext; + } + break; + + case 391: +#line 3724 "gram.y" + { + /* no accidental */ + yyval.intval = 0; + } + break; + + case 392: +#line 3731 "gram.y" + { + } + break; + + case 393: +#line 3735 "gram.y" + { + /* no octave or fret designation */ + yyval.intval = (Doing_tab_staff ? NOFRET : USE_DFLT_OCTAVE); + } + break; + + case 394: +#line 3742 "gram.y" + { + } + break; + + case 395: +#line 3747 "gram.y" + { + yyval.intval = '#'; + } + break; + + case 396: +#line 3753 "gram.y" + { + yyval.intval = '&'; + } + break; + + case 397: +#line 3759 "gram.y" + { + /* natural */ + yyval.intval = 'n'; + } + break; + + case 398: +#line 3766 "gram.y" + { + /* double sharp */ + yyval.intval = 'x'; + } + break; + + case 399: +#line 3773 "gram.y" + { + yyval.intval = 'B'; + } + break; + + case 400: +#line 3779 "gram.y" + { + yyval.intval = yyvsp[0].intval; + } + break; + + case 401: +#line 3785 "gram.y" + { + /* we can't really fill in the actual octave yet, because + * it may be different on different staffs or voices, so + * we store the relative octave and fill in actual value + * later. + */ + /* this will be a negative number */ + yyval.intval = yyvsp[0].intval; + } + break; + + case 402: +#line 3797 "gram.y" + { + /* we can't really fill in the actual octave yet, because + * it may be different on different staffs or voices, so + * we store the relative octave and fill in actual value + * later. + */ + yyval.intval = USE_DFLT_OCTAVE + yyvsp[0].intval; + } + break; + + case 403: +#line 3807 "gram.y" + { + yyval.intval = -1; + } + break; + + case 404: +#line 3813 "gram.y" + { + /* count up the number of minus signs */ + yyval.intval = yyvsp[-1].intval - 1; + } + break; + + case 405: +#line 3819 "gram.y" + { + yyval.intval = 1; + } + break; + + case 406: +#line 3825 "gram.y" + { + /* count up the number of plus signs */ + yyval.intval = yyvsp[-1].intval + 1; + } + break; + + case 407: +#line 3832 "gram.y" + { + set_slurdir(Curr_grpsyl_p, Curr_grpsyl_p->nnotes - 1, yyvsp[0].intval); + } + break; + + case 408: +#line 3839 "gram.y" + { + Slurstyle = yyvsp[0].intval; + begin_slur(Curr_grpsyl_p, Curr_grpsyl_p->nnotes - 1); + } + break; + + case 409: +#line 3845 "gram.y" + { + /* empty list. Only allowed if only one note in following + * group. However, we don't know that yet, so marked pitch + * as 'U' for unknown */ + add_slurto(Curr_grpsyl_p, 'U', USE_DFLT_OCTAVE, + Curr_grpsyl_p->nnotes - 1, Slurstyle); + } + break; + + case 410: +#line 3855 "gram.y" + { + add_slurto(Curr_grpsyl_p, 0, yyvsp[0].intval, Curr_grpsyl_p->nnotes - 1, + Slurstyle); + } + break; + + case 414: +#line 3873 "gram.y" + { + if (Doing_tab_staff == YES) { + yyerror("cannot specify string inside <> on tab staffs"); + } + else { + add_slurto(Curr_grpsyl_p, yyvsp[-1].intval, yyvsp[0].intval, + Curr_grpsyl_p->nnotes - 1, Slurstyle); + } + } + break; + + case 415: +#line 3885 "gram.y" + { + /* save address associated with entire group */ + if ( yyvsp[0].stringval != (char *) 0) { + addsym(yyvsp[0].stringval, Curr_grpsyl_p->c, CT_GRPSYL); + var_valid(); + } + } + break; + + case 416: +#line 3894 "gram.y" + { + yyval.stringval = strcpy(Stringbuff, yytext); + } + break; + + case 417: +#line 3900 "gram.y" + { + /* a-g are usually pitches, but in this context, they + * are 1-character variable names. */ + yyval.stringval = strcpy(Stringbuff, yytext); + } + break; + + case 418: +#line 3908 "gram.y" + { + /* usually m means measure, but here it is the variable m */ + yyval.stringval = strcpy(Stringbuff, yytext); + } + break; + + case 419: +#line 3915 "gram.y" + { + /* usually rest, here variable r */ + yyval.stringval = strcpy(Stringbuff, yytext); + } + break; + + case 420: +#line 3922 "gram.y" + { + /* usually space, here variable s */ + yyval.stringval = strcpy(Stringbuff, yytext); + } + break; + + case 421: +#line 3929 "gram.y" + { + /* usually uncompressible, here variable u */ + yyval.stringval = strcpy(Stringbuff, yytext); + } + break; + + case 422: +#line 3936 "gram.y" + { + /* usually natural, here variable n */ + yyval.stringval = strcpy(Stringbuff, yytext); + } + break; + + case 423: +#line 3943 "gram.y" + { + /* usually double sharp, here variable x */ + yyval.stringval = strcpy(Stringbuff, yytext); + } + break; + + case 424: +#line 3949 "gram.y" + { + /* longer variable -- one with more than one character name */ + yyval.stringval = strcpy(Stringbuff, yytext); + } + break; + + case 425: +#line 3955 "gram.y" + { + end_tuplet(yyvsp[-3].intval, yyvsp[-1].ratval, yyvsp[-2].intval, yyvsp[-4].intval); + Getting_tup_dur = NO; + } + break; + + case 426: +#line 3961 "gram.y" + { + /* nothing -- use default of when to print tuplet number/bracket */ + yyval.intval = PT_DEFAULT; + } + break; + + case 427: +#line 3968 "gram.y" + { + /* don't print tuplet or bracket */ + yyval.intval = PT_NEITHER; + } + break; + + case 428: +#line 3975 "gram.y" + { + /* print number only */ + yyval.intval = PT_NUMBER; + } + break; + + case 429: +#line 3982 "gram.y" + { + if (*yytext == 'y') { + yyval.intval = PT_BOTH; + } + else { + yyerror("tuplet number/bracket qualifier must be y or n or num"); + } + } + break; + + case 430: +#line 3994 "gram.y" + { + begin_tuplet(); + } + break; + + case 431: +#line 3999 "gram.y" + { + Getting_tup_dur = YES; + } + break; + + case 432: +#line 4004 "gram.y" + { + yyval.intval = PL_UNKNOWN; + } + break; + + case 433: +#line 4010 "gram.y" + { + if (yylval.intval == PL_BETWEEN) { + yyerror("between not allowed for tuplet side"); + yyval.intval = PL_UNKNOWN; + } + } + break; + + case 434: +#line 4018 "gram.y" + { + /* optional time value is missing */ + yyval.ratval.n = 0; + yyval.ratval.d = 1; + } + break; + + case 435: +#line 4026 "gram.y" + { + yyval.ratval = yyvsp[0].ratval; + } + break; + + case 436: +#line 4031 "gram.y" + { + } + break; + + case 437: +#line 4035 "gram.y" + { + Last_grpsyl_p = Curr_grpsyl_p = (struct GRPSYL *) 0; + } + break; + + case 438: +#line 4040 "gram.y" + { + } + break; + + case 439: +#line 4044 "gram.y" + { + /* empty, use default */ + begin_range(PL_UNKNOWN); + yyval.intval = PL_UNKNOWN; + } + break; + + case 440: +#line 4052 "gram.y" + { + begin_range(yyvsp[0].intval); + } + break; + + case 442: +#line 4060 "gram.y" + { + /* means goes above or below all the staffs, regardless if + * some happen to be invisible at the moment, so find top + * or bottom visible staff as appropriate,and save that + * away as the staff range */ + all(); + } + break; + + case 444: +#line 4073 "gram.y" + { + /* if staff_range == 0, then only one staff specified, so + * use first staff number for both beginning and end of range */ + save_staff_range(yyvsp[-1].intval, (yyvsp[0].intval == 0 ? yyvsp[-1].intval : yyvsp[0].intval) ); + } + break; + + case 445: +#line 4080 "gram.y" + { + /* empty */ + chk_range_type(NO); + yyval.intval = 0; + } + break; + + case 446: +#line 4088 "gram.y" + { + chk_range_type(NO); + yyval.intval = yyvsp[0].intval; + if (yyvsp[0].intval == 0) { + yyerror("staff of 0 is illegal"); + } + } + break; + + case 447: +#line 4098 "gram.y" + { + chk_range_type(YES); + yyval.intval = yyvsp[0].intval; + } + break; + + case 449: +#line 4107 "gram.y" + { Place = yyvsp[0].intval; } + break; + + case 451: +#line 4112 "gram.y" + { + } + break; + + case 452: +#line 4117 "gram.y" + { + if (*yytext != 'c') { + yyerror("verse must be 'c' or number(s)"); + } + else { + save_vno_range(0, 0); + } + } + break; + + case 453: +#line 4128 "gram.y" + { + } + break; + + case 454: +#line 4133 "gram.y" + { + } + break; + + case 455: +#line 4138 "gram.y" + { + /* if end of range is 0, not really a range, use first number + * for both beginning and end */ + lyr_verse(yyvsp[-1].intval, (yyvsp[0].intval == 0 ? yyvsp[-1].intval : yyvsp[0].intval)); + } + break; + + case 456: +#line 4145 "gram.y" + { + /* empty */ + yyval.intval = 0; + } + break; + + case 457: +#line 4152 "gram.y" + { + yyval.intval = yyvsp[0].intval; + } + break; + + case 458: +#line 4157 "gram.y" + { + /* null token to allocate a GRPSYL for a lyric */ + Last_grpsyl_p = Curr_grpsyl_p; + Curr_grpsyl_p = newGRPSYL(GS_SYLLABLE); + if (Last_grpsyl_p == (struct GRPSYL *) 0) { + Lyrics_p = Curr_grpsyl_p; + } + } + break; + + case 459: +#line 4167 "gram.y" + { + /* If user didn't specify a place, fix that. */ + if (Place == PL_UNKNOWN) { + Place = PL_BELOW; + } + /* copies of the lyrics info has been made for all staffs/verses + * at this point, so get rid of master copy */ + free_grpsyls(Lyrics_p); + } + break; + + case 460: +#line 4178 "gram.y" + { + /* empty -- need to derive times from music */ + Lyrics_p = derive_lyrtime(); + } + break; + + case 465: +#line 4197 "gram.y" + { + link_notegroup(Curr_grpsyl_p, Last_grpsyl_p); + /* Save pointer to current GRPSYL in case the next + * group gets its time value based on this one, + * and there are additive times on this one. */ + Prev_grpsyl_p = Curr_grpsyl_p; + /* If there are additive times, add those in. + * We don't need to make extra groups for lyrics, because we + * don't need to tie groups together--the lyrics time + * can hold any legal RATIONAL, even those that aren't + * specifiable with a single time value. */ + if (Extra_time_p != 0) { + struct TIMELIST *timelist_p; + for (timelist_p = Extra_time_p; timelist_p != 0; + timelist_p = timelist_p->next) { + Curr_grpsyl_p->fulltime = radd(Curr_grpsyl_p->fulltime, timelist_p->fulltime); + } + } + } + break; + + case 466: +#line 4219 "gram.y" + { + } + break; + + case 467: +#line 4223 "gram.y" + { + end_tuplet(yyvsp[-1].intval, yyvsp[0].ratval, NO, PL_UNKNOWN); + Getting_tup_dur = NO; + } + break; + + case 468: +#line 4229 "gram.y" + { + /* empty, will fill in an actual syllable later */ + Curr_grpsyl_p->syl = (char *) 0; + } + break; + + case 469: +#line 4236 "gram.y" + { + /* space, not a lyric, so mark for later use */ + Curr_grpsyl_p->grpcont = GC_SPACE; + } + break; + + case 472: +#line 4249 "gram.y" + { + /* If no [verseno] is specified, use -1 as special flag + * to be resolved later to "one more than previous", + * or if there wasn't a previous, to verse 1. + */ + lyr_verse(-1, -1); + proc_lyrics(Lyrics_p, yyvsp[-1].stringval); + } + break; + + case 473: +#line 4260 "gram.y" + { + proc_lyrics(Lyrics_p, yyvsp[-1].stringval); + } + break; + + case 474: +#line 4265 "gram.y" + { + Currstruct_p = (struct MAINLL *) 0; + /* If there are alternating time signature, + * add an implicit time signature SSV for the + * next time signature in the list. + */ + if (Alt_timesig_list != 0) { + end_prev_context(); + Context = C_SCORE; + Currstruct_p = newMAINLLstruct(S_SSV, -1); + Currstruct_p->u.ssv_p->context = Context; + if (Tsig_visibility == PTS_ALWAYS && + Next_alt_timesig != Alt_timesig_list) { + /* If user wants alternating time signatures + * printed on every measure, if there is + * a multirest, we will print multiple + * time signatures there, and might have to + * wrap around to the beginning of the list. + * So make a copy of the entire list, + * starting from wherever we are now, + * wrapping around to the beginning, + * and ending just before where we are now. + * Most of the time, + * there probably won't be a multirest, + * so this will be a waste, but unfortunately, + * we don't know yet whether there will be + * one or not, so need to do the whole list + * just in case. + * + * Calculate length of the two pieces: + * from where we are to end, and from + * beginning to where we are. + */ + int remlength; + int wraplength; + remlength = strlen(Next_alt_timesig); + wraplength = strlen(Alt_timesig_list) + - remlength; + /* need one more for terminator. */ + MALLOCA(char, Currstruct_p->u.ssv_p->timerep, + remlength + wraplength + 1); + + /* copy remainder into beginning */ + strcpy(Currstruct_p->u.ssv_p->timerep, + Next_alt_timesig); + /* copy the wrap-around part of list, + * but move the TSR_ALTERNATING from the + * end of that part to between the two parts */ + Currstruct_p->u.ssv_p->timerep[remlength] + = TSR_ALTERNATING; + strncpy(Currstruct_p->u.ssv_p->timerep + + remlength + 1, Alt_timesig_list, + wraplength - 1); + /* Add the terminator */ + Currstruct_p->u.ssv_p->timerep + [remlength + wraplength] + = TSR_END; + + assign_timesig(Currstruct_p, PTS_ALWAYS, + &Next_alt_timesig); + + + /* Make this new copy the new + * head of the list */ + Alt_timesig_list = + Currstruct_p->u.ssv_p->timerep; + } + else { + /* make a copy of the remaining alternating + * signatures and assign that */ + MALLOCA(char, Currstruct_p->u.ssv_p->timerep, + strlen(Next_alt_timesig) + 1); + strcpy(Currstruct_p->u.ssv_p->timerep, + Next_alt_timesig); + assign_timesig(Currstruct_p, + (Tsig_visibility == PTS_ALWAYS ? + PTS_ALWAYS : PTS_NEVER), + &Next_alt_timesig); + + /* If we reached end of list, start over */ + if (Next_alt_timesig == 0) { + Next_alt_timesig = Alt_timesig_list; + } + } + + asgnssv(Currstruct_p->u.ssv_p); + end_prev_context(); + Context = C_MUSIC; + } + } + break; + + case 477: +#line 4364 "gram.y" + { + struct MAINLL * mll_p; + char *name; + + + name = (yylval.intval == YES ? "newpage" : "newscore"); + + (void) contextcheck(C_MUSIC | C_BLOCK, name); + Currstruct_p = newMAINLLstruct(S_FEED, yylineno); + Currstruct_p->u.feed_p->pagefeed = yyvsp[0].intval; + + /* make sure we're not in the middle of a measure. Go + * backwards in main list. If we hit STAFF before a BAR, + * then there is a problem. + */ + for (mll_p = Mainlltc_p; mll_p != (struct MAINLL *) 0; + mll_p = mll_p->prev) { + + if (mll_p->str == S_BAR) { + break; + } + else if (mll_p->str == S_STAFF) { + l_yyerror(Curr_filename, yylineno, + "%s not allowed in middle of measure", + name); + break; + } + else if (mll_p->str == S_FEED) { + if (mll_p->prev != 0 && + mll_p->prev->str == S_BLOCKHEAD) { + /* This is a feed following a block. + * If it was an implicit feed, + * we can get rid of it, because + * user now put an explicit one. + */ + if (mll_p->inputlineno == -1) { + unlinkMAINLL(mll_p); + FREE(mll_p); + } + /* We must be in block context, + * so no need to check farther back. + */ + break; + } + else { + l_yyerror(Curr_filename, yylineno, + "consecutive newscore/newpage not allowed"); + } + break; + } + } + insertMAINLL(Currstruct_p, Mainlltc_p); + + /* If this is inside a block, we need to create a new block + * and feed after it. + */ + if (Context == C_BLOCK) { + CALLOC(BLOCKHEAD, Currblock_p, 1); + set_win_coord(Currblock_p->c); + Next_print_link_p_p = &(Currblock_p->printdata_p); + insertMAINLL(newMAINLLstruct(S_BLOCKHEAD, yylineno), + Mainlltc_p); + Mainlltc_p->u.blockhead_p = Currblock_p; + insertMAINLL(newMAINLLstruct(S_FEED, -1), Mainlltc_p); + } + + } + break; + + case 478: +#line 4432 "gram.y" + { + Currstruct_p = (struct MAINLL *) 0; + } + break; + + case 482: +#line 4448 "gram.y" + { + yyvsp[0].floatval = adjust2inches(yyvsp[0].floatval); /* in case we are in centimeter mode */ + if (yyvsp[-2].intval == RIGHTMARGIN) { + if (Currstruct_p->u.feed_p->rightmargin >= 0) { + l_warning(Curr_filename, yylineno, + "rightmargin specified more than once, using last instance"); + /* fall through to override the previous */ + } + Currstruct_p->u.feed_p->rightmargin = yyvsp[0].floatval; + } + else if (yyvsp[-2].intval == LEFTMARGIN) { + if (Currstruct_p->u.feed_p->leftmargin >= 0) { + l_warning(Curr_filename, yylineno, + "leftmargin specified more than once, using last instance"); + /* fall through to override the previous */ + } + Currstruct_p->u.feed_p->leftmargin = yyvsp[0].floatval; + } + else { + yyerror("unexpected parameter; only 'leftmargin' or 'rightmargin' allowed here"); + } + chkmargin(Score.topmargin, Score.botmargin, + Currstruct_p->u.feed_p->leftmargin, + Currstruct_p->u.feed_p->rightmargin); + } + break; + + case 489: +#line 4494 "gram.y" + { + + /* build a BAR struct and add it to the main list */ + if (contextcheck(C_MUSIC, "bar") == YES) { + + Currstruct_p = newMAINLLstruct(S_BAR, yylineno); + Currstruct_p->u.bar_p->bartype = (short) yylval.intval; + Currstruct_p->u.bar_p->endingloc = Endingloc; + if (yyvsp[-2].intval != L_NORMAL) { + if (yyvsp[-2].intval != L_DASHED && yyvsp[-2].intval != L_DOTTED) { + yyerror("bar modifier can only be 'dashed' or 'dotted'"); + } + else if (yyvsp[0].intval != SINGLEBAR && yyvsp[0].intval != DOUBLEBAR) { + yyerror("only 'bar' or 'dblbar' can be dashed or dotted"); + } + } + Currstruct_p->u.bar_p->linetype = yyvsp[-2].intval; + insertMAINLL(Currstruct_p, Mainlltc_p); + Currstruct_p->u.bar_p->timedssv_p = tssv_sort(); + + /* re-order things in the bar, + * make sure they are all consistent, etc */ + do_bar(yyvsp[0].intval); + + Got_ending = NO; + } + if (yyvsp[0].intval == RESTART && Endingloc != NOITEM) { + yyerror("restart cannot be used inside an ending"); + } + + /* User can specify bar type to use on preceeding staff when + * a repeatstart gets moved to the next scores's pseudo-bar */ + if (yyvsp[-1].intval != -1) { + if (yyvsp[0].intval != REPEATSTART) { + yyerror("bar type for preceeding score only allowed on repeatstart"); + } + if (Currstruct_p != 0 && Currstruct_p->u.bar_p != 0) { + Currstruct_p->u.bar_p->precbartype = yyvsp[-1].intval; + } + } + else { + /* Default is single bar. It could be argued that in + * the case of a key change on this bar, it really + * should be a dblbar, but user can force that + * if they want it. */ + if (Currstruct_p != 0 && Currstruct_p->u.bar_p != 0) { + Currstruct_p->u.bar_p->precbartype = SINGLEBAR; + } + } + } + break; + + case 490: +#line 4547 "gram.y" + { + yyval.intval = -1; /* special value to mean "none specified" */ + } + break; + + case 491: +#line 4553 "gram.y" + { + /* Parens wouldn't be strictly necessary to be able to parse, + * but seem useful semantically to make it clear this is + * optional, only applying when repeatstart is moved to + * next score's pseudo bar. */ + yyval.intval = yyvsp[-1].intval; + } + break; + + case 494: +#line 4569 "gram.y" + { + if (Currstruct_p != (struct MAINLL *) 0) { + Currstruct_p->u.bar_p->padding += yyvsp[0].floatval * STEPSIZE; + } + } + break; + + case 495: +#line 4577 "gram.y" + { + if (Currstruct_p != (struct MAINLL *) 0) { + /* fill in location info */ + if (yyvsp[0].stringval != (char *) 0) { + addsym(yyvsp[0].stringval, Currstruct_p->u.bar_p->c, CT_BAR); + } + } + } + break; + + case 496: +#line 4588 "gram.y" + { + if (Got_ending == YES) { + yyerror("Only one ending allowed per bar"); + } + Got_ending = YES; + + if (Currstruct_p != (struct MAINLL *) 0) { + if (Currstruct_p->u.bar_p->bartype == RESTART) { + yyerror("ending not allowed on restart"); + } + /* fill in ending label if any */ + Currstruct_p->u.bar_p->endinglabel = yyvsp[0].stringval; + Currstruct_p->u.bar_p->endingloc = Endingloc; + ped_endings(Endingloc); + + /* for next time around, figure out what endingloc will + * be if user doesn't specify something different */ + switch (Endingloc) { + case STARTITEM: + Endingloc = INITEM; + break; + case ENDITEM: + Endingloc = NOITEM; + break; + default: + break; + } + } + } + break; + + case 497: +#line 4620 "gram.y" + { + if (Currstruct_p != 0) { + if (Currstruct_p->u.bar_p->bartype == RESTART) { + yyerror("hidechanges not allowed on restart"); + } + Currstruct_p->u.bar_p->hidechanges = YES; + } + } + break; + + case 498: +#line 4630 "gram.y" + { + if (Currstruct_p != 0) { + set_mnum(Currstruct_p->u.bar_p, yyvsp[0].intval); + } + } + break; + + case 499: +#line 4637 "gram.y" + { + /* +2 to skip font/size */ + init_reh(-1, yyvsp[0].stringval + 2, Currstruct_p); + } + break; + + case 500: +#line 4643 "gram.y" + { + init_reh(yyvsp[0].intval, (char *)0, Currstruct_p); + } + break; + + case 501: +#line 4649 "gram.y" + { + if (Currstruct_p != (struct MAINLL *) 0) { + set_reh_string(Currstruct_p->u.bar_p, yyvsp[-4].intval, yyvsp[-3].intval, yyvsp[-2].intval, yyvsp[-1].stringval); + Currstruct_p->u.bar_p->dist = Dist; + Currstruct_p->u.bar_p->dist_usage = Dist_usage; + } + } + break; + + case 502: +#line 4659 "gram.y" + { + yyval.stringval = yyvsp[0].stringval; + (void) fix_string(yyvsp[0].stringval, FONT_TR, DFLT_SIZE, Curr_filename, yylineno); + Endingloc = STARTITEM; + } + break; + + case 503: +#line 4667 "gram.y" + { + if (Endingloc == NOITEM) { + yyerror("no ending in progress"); + } + else { + Endingloc = ENDITEM; + } + yyval.stringval = (char *) 0; + } + break; + + case 504: +#line 4678 "gram.y" + { + /* null token to check for more than one rehearsal mark + * on one BAR */ + if (Currstruct_p != (struct MAINLL *) 0 && + Currstruct_p->u.bar_p->reh_type != REH_NONE) { + yyerror("only one rehearsal mark allowed per bar"); + } + } + break; + + case 505: +#line 4688 "gram.y" + { + if (Currstruct_p != (struct MAINLL *) 0) { + Currstruct_p->u.bar_p->reh_type = REH_STRING; + } + } + break; + + case 506: +#line 4696 "gram.y" + { + if (Currstruct_p != (struct MAINLL *) 0) { + Currstruct_p->u.bar_p->reh_type = REH_MNUM; + } + yyval.stringval = (char *) 0; + } + break; + + case 507: +#line 4705 "gram.y" + { + if (Currstruct_p != (struct MAINLL *) 0) { + Currstruct_p->u.bar_p->reh_type = REH_NUM; + } + yyval.stringval = (char *) 0; + } + break; + + case 508: +#line 4714 "gram.y" + { + if (Currstruct_p != (struct MAINLL *) 0) { + Currstruct_p->u.bar_p->reh_type = REH_LET; + } + yyval.stringval = (char *) 0; + } + break; + + case 509: +#line 4722 "gram.y" + { + yyval.inpcoord_p = yyvsp[-4].inpcoord_p; + } + break; + + case 510: +#line 4727 "gram.y" + { + /* null token to allocate an INPCOORD */ + CALLOC(INPCOORD, Curr_loc_info_p, 1); + yyval.inpcoord_p = Curr_loc_info_p; + /* set to positive in case input starts with an absolute + * x coordinate */ + Plus_minus = 1; + } + break; + + case 511: +#line 4737 "gram.y" + { + /* reset sign to positive in case y coordinate is absolute */ + Plus_minus = 1; + } + break; + + case 513: +#line 4746 "gram.y" + { + /* only 1 of these allowed per location */ + if (Curr_loc_info_p->hor_p != (float *) 0) { + pfatal("only one horizontal location variable allowed per coordinate"); + } + /* fill in the coord address and type */ + Curr_loc_info_p->hor_p = symval(yyvsp[-2].stringval, &(Curr_loc_info_p->hor_p)); + Curr_loc_info_p->htype = yyvsp[0].intval; + } + break; + + case 515: +#line 4762 "gram.y" + { + /* only valid letters is w */ + if (*yytext != 'w') { + yyerror("invalid direction: must be x, w, or e"); + } + yyval.intval = AW; + } + break; + + case 516: +#line 4771 "gram.y" + { + yyval.intval = AX; + } + break; + + case 517: +#line 4777 "gram.y" + { + /* only valid value is e */ + if (*yytext != 'e') { + yyerror("invalid direction: must be x, w, or e"); + } + yyval.intval = AE; + } + break; + + case 521: +#line 4794 "gram.y" + { + yyval.intval = Plus_minus = 1; + } + break; + + case 522: +#line 4800 "gram.y" + { + yyval.intval = Plus_minus = -1; + } + break; + + case 523: +#line 4805 "gram.y" + { + Curr_loc_info_p->hsteps += yyvsp[0].floatval * (float) Plus_minus; + } + break; + + case 524: +#line 4811 "gram.y" + { + if (Curr_loc_info_p->hor_p == (float *) 0) { + yyerror("must specify location before giving time offset"); + } + /* add or subtract time value from horizontal */ + if (Plus_minus == 1) { + Curr_loc_info_p->counts += yyvsp[0].floatval; + } + else { + Curr_loc_info_p->counts -= yyvsp[0].floatval; + } + } + break; + + case 527: +#line 4831 "gram.y" + { + /* only one of these allowed per location */ + if (Curr_loc_info_p->vert_p != (float *) 0) { + pfatal("only one vertical location variable allowed per coordinate"); + } + /* fill in the coord address and type */ + Curr_loc_info_p->vert_p = symval(yyvsp[-2].stringval, &(Curr_loc_info_p->vert_p)); + Curr_loc_info_p->vtype = yyvsp[0].intval; + + } + break; + + case 528: +#line 4843 "gram.y" + { + yyval.intval = AN; + } + break; + + case 529: +#line 4849 "gram.y" + { + yyval.intval = AS; + } + break; + + case 530: +#line 4855 "gram.y" + { + /* only valid value here is y */ + if (*yytext != 'y') { + yyerror("invalid direction: must be y, n, or s"); + } + yyval.intval = AY; + } + break; + + case 533: +#line 4870 "gram.y" + { + } + break; + + case 534: +#line 4875 "gram.y" + { + /* this is number of steps up (or down if negative) */ + Curr_loc_info_p->vsteps += yyvsp[0].floatval * (float) Plus_minus; + } + break; + + case 535: +#line 4881 "gram.y" + { + yyval.floatval = (float) yyvsp[0].intval; + } + break; + + case 536: +#line 4886 "gram.y" + { + sprintf(Tmpbuff,"%d.%s", yyvsp[-2].intval, yyvsp[0].stringval); + yyval.floatval = (float) atof(Tmpbuff); + } + break; + + case 537: +#line 4892 "gram.y" + { + sprintf(Tmpbuff,"0.%s", yyvsp[0].stringval); + yyval.floatval = (float) atof(Tmpbuff); + } + break; + + case 538: +#line 4898 "gram.y" + { + /* no decimal fraction part of float number */ + yyval.stringval = ""; + } + break; + + case 540: +#line 4908 "gram.y" + { + yyval.stringval = yytext; + } + break; + + case 542: +#line 4916 "gram.y" + { + Currstruct_p->u.line_p->linetype = yyvsp[-6].intval; + Currstruct_p->u.line_p->start = *(yyvsp[-3].inpcoord_p); + Currstruct_p->u.line_p->end = *(yyvsp[-1].inpcoord_p); + rep_inpcoord(yyvsp[-3].inpcoord_p, &(Currstruct_p->u.line_p->start)); + rep_inpcoord(yyvsp[-1].inpcoord_p, &(Currstruct_p->u.line_p->end)); + Currstruct_p->u.line_p->string = yyvsp[0].stringval; + + /* copies of the location info went into the LINE struct, + * so we can free the original copy of the information */ + if (yyvsp[-3].inpcoord_p) { + FREE(yyvsp[-3].inpcoord_p); + } + if (yyvsp[-1].inpcoord_p) { + FREE(yyvsp[-1].inpcoord_p); + } + insertMAINLL(Currstruct_p, Mainlltc_p); + Currstruct_p = (struct MAINLL *) 0; + } + break; + + case 543: +#line 4937 "gram.y" + { + /* null token to cause allocation of LINE struct */ + (void) contextcheck(C_MUSIC, "line"); + Currstruct_p = newMAINLLstruct(S_LINE, yylineno); + } + break; + + case 544: +#line 4944 "gram.y" + { + yyval.intval = L_NORMAL; + } + break; + + case 546: +#line 4954 "gram.y" + { + yyval.stringval = 0; + } + break; + + case 547: +#line 4959 "gram.y" + { + yyval.stringval = fix_string(yyvsp[0].stringval, Titlefont, Titlesize, Curr_filename, yylineno); + } + break; + + case 548: +#line 4965 "gram.y" + { + if (yyvsp[-6].intval == L_WAVY) { + l_yyerror(Curr_filename, yylineno, + "wavy curve not allowed"); + } + Currstruct_p->u.curve_p->curvetype = yyvsp[-6].intval; + insertMAINLL(Currstruct_p, Mainlltc_p); + Currstruct_p = (struct MAINLL *) 0; + } + break; + + case 549: +#line 4976 "gram.y" + { + (void) contextcheck(C_MUSIC, "curve"); + Currstruct_p = newMAINLLstruct(S_CURVE, yylineno); + + /* get space for a list of locations and mark it as empty */ + Item_count = 0; + Currstruct_p->u.curve_p->ncoord = (short) Item_count; + Currstruct_p->u.curve_p->nbulge = (short) Item_count; + MALLOC(INPCOORD, Currstruct_p->u.curve_p->coordlist, ITEMS); + Max_items = ITEMS; + } + break; + + case 556: +#line 5010 "gram.y" + { + /* get enough space to store some values if don't have enough */ + if (Currstruct_p->u.curve_p->nbulge == 0) { + MALLOCA(float, Currstruct_p->u.curve_p->bulgelist, ITEMS); + } + else if ( (Currstruct_p->u.curve_p->nbulge % ITEMS) == 0) { + REALLOCA(float, Currstruct_p->u.curve_p->bulgelist, + Currstruct_p->u.curve_p->nbulge + ITEMS); + } + + /* fill in the value and increment the count of how many */ + Currstruct_p->u.curve_p->bulgelist[Currstruct_p->u.curve_p->nbulge] = yyvsp[-1].intval * yyvsp[0].floatval; + (Currstruct_p->u.curve_p->nbulge)++; + } + break; + + case 557: +#line 5026 "gram.y" + { + struct INPCOORD *curve_inpcoord_p; + + /* If ran off end of list, make list bigger. + * We cannot use REALLOC here, since we need to update + * the tag reference information on each individual array + * element, so we alloc all new space, copy the existing data, + * and update the tag references, then free the old space, + * and redirect the pointer to the new space. */ + if (Currstruct_p->u.curve_p->ncoord >= Max_items) { + struct INPCOORD *newlist_p; + int n; + Max_items += ITEMS; + MALLOC(INPCOORD, newlist_p, Max_items); + for (n = 0; n < Currstruct_p->u.curve_p->ncoord; n++) { + newlist_p[n] = Currstruct_p->u.curve_p->coordlist[n]; + rep_inpcoord( + &(Currstruct_p->u.curve_p->coordlist[n]), + &(newlist_p[n])); + } + FREE(Currstruct_p->u.curve_p->coordlist); + Currstruct_p->u.curve_p->coordlist = newlist_p; + } + + /* Add this entry to the end of the list, update the + * tag reference to point to this permanent copy rather + * the temporary one we will be deleting, and update the + * count of how many elements in the list. */ + curve_inpcoord_p = &(Currstruct_p->u.curve_p->coordlist + [Currstruct_p->u.curve_p->ncoord]); + *curve_inpcoord_p = *(yyvsp[0].inpcoord_p); + rep_inpcoord(yyvsp[0].inpcoord_p, curve_inpcoord_p); + (Currstruct_p->u.curve_p->ncoord)++; + FREE(yyvsp[0].inpcoord_p); + } + break; + + case 558: +#line 5063 "gram.y" + { + attach_stuff(); + /* so reset flag */ + Defining_multiple = NO; + } + break; + + case 559: +#line 5071 "gram.y" + { + chk_stuff_header(yyvsp[-4].intval, yyvsp[-3].intval, yyvsp[-2].intval, Dist_usage); + add_to_sv_list(); + } + break; + + case 560: +#line 5078 "gram.y" + { + /* Separate rule for phrase because it has the linetype + * modifier in front, unlike any other STUFF. The size, + * and dist are not really allowed, but we match them + * if they are there in order to give more clear error + * message than just "syntax error," since there was + * already code elsewhere to check for these errors. + */ + set_stuff_type(ST_PHRASE); + chk_stuff_header(yyvsp[-3].intval, yyvsp[-5].intval, yyvsp[-2].intval, Dist_usage); + add_to_sv_list(); + } + break; + + case 561: +#line 5092 "gram.y" + { + /* need a separate rule for midi, because it can include + * a voice as well as staff. It also cannot have the chord, + * size or place, although those are checked elsewhere anyway */ + chk_stuff_header(-1, NO, PL_UNKNOWN, SD_NONE); + } + break; + + case 562: +#line 5101 "gram.y" + { + set_stuff_type(ST_MIDI); + begin_range(PL_UNKNOWN); + } + break; + + case 564: +#line 5111 "gram.y" + { + all(); + add_to_sv_list(); + } + break; + + case 565: +#line 5118 "gram.y" + { + /* dummy token for sole purpose of saving away current + * stuff type. We have to do this in order to have it in + * time to figure out the default place for "all" */ + set_stuff_type(yyvsp[0].intval); + } + break; + + case 566: +#line 5127 "gram.y" + { + Curr_family = yyvsp[-1].intval; + + switch (yyvsp[0].intval) { + case FONT_TR: + yyval.intval = ST_ROM; + break; + case FONT_TI: + yyval.intval = ST_ITAL; + break; + case FONT_TB: + yyval.intval = ST_BOLD; + break; + case FONT_TX: + yyval.intval = ST_BOLDITAL; + break; + default: + pfatal("unknown font"); + break; + } + } + break; + + case 567: +#line 5151 "gram.y" + { + if (yyvsp[0].intval != L_NORMAL) { + /* user used 'dotted' or 'dashed' which applies only + * to use of T_L_ANGLE for slurs. Use generic error + * message so looks like any other similar error. */ + yyerror("syntax error"); + } + yyval.intval = ST_CRESC; + } + break; + + case 568: +#line 5163 "gram.y" + { + yyval.intval = ST_DECRESC; + } + break; + + case 569: +#line 5169 "gram.y" + { + yyval.intval = ST_PEDAL; + } + break; + + case 570: +#line 5175 "gram.y" + { + yyval.intval = ST_MUSSYM; + } + break; + + case 571: +#line 5181 "gram.y" + { + yyval.intval = ST_OCTAVE; + } + break; + + case 572: +#line 5187 "gram.y" + { + /* use -1 to indicate user didn't specify so must use default */ + yyval.intval = -1; + } + break; + + case 573: +#line 5194 "gram.y" + { + yyval.intval = yyvsp[-1].intval; + } + break; + + case 574: +#line 5199 "gram.y" + { + yyval.intval = TM_NONE; + } + break; + + case 575: +#line 5205 "gram.y" + { + yyval.intval = yyvsp[0].intval; + } + break; + + case 576: +#line 5210 "gram.y" + { + Dist = 0; + Dist_usage = SD_NONE; + } + break; + + case 577: +#line 5217 "gram.y" + { + if (yyvsp[-1].intval != DIST) { + yyerror("unexpected parameter name instead of 'dist'"); + } + else { + if (rangecheck(yyvsp[0].intval, -MAXDIST, MAXDIST, "dist") == YES) { + Dist = yyvsp[0].intval; + } + } + } + break; + + case 578: +#line 5230 "gram.y" + { + yyval.intval = yyvsp[-1].intval; + } + break; + + case 579: +#line 5236 "gram.y" + { + if (Dist_usage != SD_FORCE) { + l_warning(Curr_filename, yylineno, + "negative dist requires !, setting to 0"); + yyval.intval = 0; + } + else { + yyval.intval = - yyvsp[-1].intval; + } + } + break; + + case 580: +#line 5248 "gram.y" + { + Dist_usage = SD_MIN; + } + break; + + case 581: +#line 5254 "gram.y" + { + Dist_usage = SD_FORCE; + } + break; + + case 584: +#line 5267 "gram.y" + { + add_stuff_item(yyvsp[-4].floatval, yyvsp[-3].floatval, Gracebackup, yyvsp[-2].stringval, Til_bars, Til_offset, + Dist, Dist_usage); + } + break; + + case 585: +#line 5274 "gram.y" + { + Til_bars = 0; + Til_offset = 0.0; + yyval.floatval = yyvsp[-1].floatval; + } + break; + + case 586: +#line 5281 "gram.y" + { + Gracebackup = 0; + } + break; + + case 587: +#line 5287 "gram.y" + { + Gracebackup = yyvsp[-1].intval; + } + break; + + case 588: +#line 5292 "gram.y" + { + yyval.floatval = 0.0; + } + break; + + case 589: +#line 5298 "gram.y" + { + yyval.floatval = yyvsp[-1].floatval * (float) yyvsp[-2].intval; + } + break; + + case 590: +#line 5303 "gram.y" + { + yyval.stringval = (char *) 0; + } + break; + + case 591: +#line 5309 "gram.y" + { + if (get_stuff_type() != ST_PEDAL) { + yyerror("'*' only valid with pedal"); + } + MALLOCA(char, yyval.stringval, 12); + yyval.stringval[0] = FONT_MUSIC; + yyval.stringval[1] = DFLT_SIZE; + sprintf(yyval.stringval + 2, "\\(endped)"); + } + break; + + case 592: +#line 5321 "gram.y" + { + yyval.stringval = yyvsp[0].stringval; + } + break; + + case 593: +#line 5326 "gram.y" + { + } + break; + + case 594: +#line 5331 "gram.y" + { + } + break; + + case 595: +#line 5336 "gram.y" + { + /** if there is a non-empty til_suffix, the floatnum better + ** have been an integer, and is really the number + * of bars. **/ + if (yyvsp[0].intval == YES) { + Til_bars = (int) yyvsp[-1].floatval; + if (yyvsp[-1].floatval - Til_bars != 0.0) { + yyerror("number of measures in til clause must be a whole number"); + } + } + else { + /* only a number, that means it was really a beat offset */ + Til_offset = yyvsp[-1].floatval; + } + } + break; + + case 596: +#line 5353 "gram.y" + { + yyval.intval = NO; + } + break; + + case 597: +#line 5359 "gram.y" + { + yyval.intval = YES; + } + break; + + case 598: +#line 5364 "gram.y" + { + Til_offset = 0.0; + } + break; + + case 599: +#line 5370 "gram.y" + { + Til_offset = yyvsp[0].floatval; + } + break; + + case 601: +#line 5378 "gram.y" + { + newROLLINFO(); + } + break; + + case 602: +#line 5384 "gram.y" + { + newROLLINFO(); + setrolldir(UP); + } + break; + + case 603: +#line 5391 "gram.y" + { + newROLLINFO(); + setrolldir(DOWN); + } + break; + + case 605: +#line 5402 "gram.y" + { + /* save staffnum and voice 1 for start of roll */ + rollparam(yyvsp[0].intval, 1, -1, -1); + } + break; + + case 606: +#line 5409 "gram.y" + { + /* save staff and voice for start of roll */ + rollparam(yyvsp[-1].intval, yyvsp[0].intval, -1, -1); + } + break; + + case 608: +#line 5418 "gram.y" + { + /* save staffnum, voice 1 for end of roll */ + rollparam(-1, -1, yyvsp[0].intval, 1); + } + break; + + case 609: +#line 5425 "gram.y" + { + /* save staffnum and voice for end of roll */ + rollparam(-1, -1, yyvsp[-1].intval, yyvsp[0].intval); + } + break; + + case 610: +#line 5432 "gram.y" + { + rolloffset( (double) yyvsp[-1].floatval); + } + break; + + case 611: +#line 5438 "gram.y" + { + rolloffset( (double) yyvsp[-1].floatval); + } + break; + + case 612: +#line 5443 "gram.y" + { + if (Curr_family == FAMILY_DFLT) { + Curr_family = Score.fontfamily; + } + Extra = extra_needed(Curr_family + Curr_font, Curr_size, yyvsp[0].stringval); + proc_printcmd(yyvsp[-2].intval, Curr_loc_info_p, yyvsp[0].stringval, Curr_family + Curr_font, + Curr_size, yyvsp[-1].intval, NO, (yyvsp[-1].intval == YES ? Extra : (double) 0.0)); + } + break; + + case 613: +#line 5454 "gram.y" + { + if (yyvsp[-1].intval == YES) { + warning("nl ignored for postscript"); + } + proc_printcmd(J_NONE, Curr_loc_info_p, yyvsp[0].stringval, FONT_UNKNOWN, + DFLT_SIZE, NO, YES, (double) 0.0); + end_raw(); + } + break; + + case 614: +#line 5465 "gram.y" + { + begin_raw(); + } + break; + + case 616: +#line 5473 "gram.y" + { + /* this means print at default location */ + Curr_loc_info_p = (struct INPCOORD *) 0; + yyval.intval = NO; + } + break; + + case 617: +#line 5481 "gram.y" + { + Curr_loc_info_p = (struct INPCOORD *) 0; + yyval.intval = YES; + } + break; + + case 618: +#line 5488 "gram.y" + { + yyval.intval = NO; + } + break; + + + } + +/* Line 1016 of /usr/share/bison/yacc.c. */ +#line 7824 "y.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + +#if YYDEBUG + if (yydebug) + { + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + YYSIZE_T yysize = 0; + int yytype = YYTRANSLATE (yychar); + char *yymsg; + int yyx, yycount; + + yycount = 0; + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + yysize += yystrlen (yytname[yyx]) + 15, yycount++; + yysize += yystrlen ("parse error, unexpected ") + 1; + yysize += yystrlen (yytname[yytype]); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) + { + char *yyp = yystpcpy (yymsg, "parse error, unexpected "); + yyp = yystpcpy (yyp, yytname[yytype]); + + if (yycount < 5) + { + yycount = 0; + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); + yyx++) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + const char *yyq = ! yycount ? ", expecting " : " or "; + yyp = yystpcpy (yyp, yyq); + yyp = yystpcpy (yyp, yytname[yyx]); + yycount++; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + yyerror ("parse error; also virtual memory exhausted"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror ("parse error"); + } + goto yyerrlab1; + + +/*----------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action. | +`----------------------------------------------------*/ +yyerrlab1: + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + /* Return failure if at end of input. */ + if (yychar == YYEOF) + { + /* Pop the error token. */ + YYPOPSTACK; + /* Pop the rest of the stack. */ + while (yyssp > yyss) + { + YYDPRINTF ((stderr, "Error: popping ")); + YYDSYMPRINT ((stderr, + yystos[*yyssp], + *yyvsp)); + YYDPRINTF ((stderr, "\n")); + yydestruct (yystos[*yyssp], *yyvsp); + YYPOPSTACK; + } + YYABORT; + } + + YYDPRINTF ((stderr, "Discarding token %d (%s).\n", + yychar, yytname[yychar1])); + yydestruct (yychar1, yylval); + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + YYDPRINTF ((stderr, "Error: popping ")); + YYDSYMPRINT ((stderr, + yystos[*yyssp], *yyvsp)); + YYDPRINTF ((stderr, "\n")); + + yydestruct (yystos[yystate], *yyvsp); + yyvsp--; + yystate = *--yyssp; + + +#if YYDEBUG + if (yydebug) + { + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "Error: state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); + } +#endif + } + + if (yyn == YYFINAL) + YYACCEPT; + + YYDPRINTF ((stderr, "Shifting error token, ")); + + *++yyvsp = yylval; + + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*----------------------------------------------. +| yyoverflowlab -- parser overflow comes here. | +`----------------------------------------------*/ +yyoverflowlab: + yyerror ("parser stack overflow"); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + return yyresult; +} + + +#line 5493 "gram.y" + + +#include + + +/* print error message along with current filename and line number */ + +int +yyerror(msg) + +char *msg; + +{ + if (strncmp(msg, "syntax error", 12) == 0 || + strncmp(msg, "parse error", 11) == 0) { + /* beef up yacc's default syntax error message */ + if (*yytext == '\n') { + l_yyerror(Curr_filename, yylineno, + "error detected at end of line (maybe missing semicolon or other required element?)"); + } + else { + l_yyerror(Curr_filename, yylineno, + "error detected at '%s'", yytext); + } + } + else { + l_yyerror(Curr_filename, yylineno, "%s", msg); + } + + /* return something to keep lint happy */ + return(0); +} + + +/* if argument is surrounded by double quotes, remove them and return the + * unquoted string. Actually just NULL out the end quote and return a + * pointer to beyond the leading quote */ + +static char * +stripquotes(string) + +char *string; + +{ + char *p; + + p = string + strlen(string) - 1; + if (*p == '"') { + *p = '\0'; + } + return( *string == '"' ? string + 1 : string); +} + + +/* make sure each header/footer type specified only once */ + +static void +chkdup_headfoot(flag, which) + +int flag; /* if non-zero, had gotten this head/foot before */ +char *which; /* header, footer, header2 or footer2 */ + +{ + if (flag != 0) { + l_yyerror(Curr_filename, yylineno, + "%s context specified more than once", which); + } +} + + +/* when entering new context, need to save away everything about current one */ + +static void +end_prev_context() + +{ + struct MAINLL *place_p; /* where to insert SSV in main list */ + + + /* assume we will place at the end of main list. Later we'll set + * the right value if that assumption is wrong */ + place_p = Mainlltc_p; + + /* If current main list item hasn't been added to list yet, + * do that now. */ + if (Currstruct_p != (struct MAINLL *) 0 && Currstruct_p != place_p) { + + if (Currstruct_p->str == S_SSV) { + + if (List_of_staffs_p != (struct MAINLL *) 0) { + yyerror("can't change context inside a measure"); + Currstruct_p = (struct MAINLL *) 0; + return; + } + + /* if is an SSV struct, we also need to set the + * correct values at this point, because the + * parser needs to know current values of some + * things (like font and point size) */ + asgnssv(Currstruct_p->u.ssv_p); + + /* if this SSV is after a FEED, we have to move it + * before the FEED in order to follow the rules of + * what comes when on the main list */ + for ( ; place_p != (struct MAINLL *) 0 && + place_p->str == S_FEED; + place_p = place_p->prev) { + } + } + + insertMAINLL(Currstruct_p, place_p); + } + + if (Currstruct_p != 0 && Currstruct_p->str == S_SSV) { + /* memorize or recall beamstyle and timeunit if appropriate */ + remember_tsig_params(Currstruct_p); + } + + Curr_grpsyl_p = (struct GRPSYL *) 0; + Currblock_p = (struct BLOCKHEAD *) 0; + set_win_coord(0); +} + + +/* if defining more than one voice at the moment, not valid to set + * a location variable. Print message and reset flag so we don't + * give any more of the same message this measure */ + +static void +var_valid() + +{ + if (Defining_multiple == YES) { + yyerror("location tag is only allowed when defining a single voice"); + Defining_multiple = NO; + } + else if (Chord_at_a_time == YES) { + yyerror("location tag not allowed with chord-at-a-time input"); + } +} + + +/* do a print command like left, right, or center. Allocate a PRINTDATA + * struct and fill in all the information about what to print and where + * to print it. */ + +static void +proc_printcmd(justifytype, inpc_p, str, font, size, got_nl, isPostScript, extra) + +int justifytype; /* J_LEFT, etc */ +struct INPCOORD *inpc_p; /* where to print */ +char *str; /* the string to print */ +int font; +int size; +int got_nl; /* YES if should go to next line before printing */ +int isPostScript; /* YES if is raw PostScript rather than normal print */ +double extra; /* how much extra vetical padding to add */ + +{ + struct PRINTDATA *curr_print_p; + + + (void) contextcheck(C_MUSIC | C_BLOCKHEAD, "print"); + + /* save all the info in a PRINTDATA struct */ + MALLOC(PRINTDATA, curr_print_p, 1); + + if (inpc_p == (struct INPCOORD *) 0) { + + /* print at default location */ + curr_print_p->location.vert_p = symval("_cur", (float **) 0); + + switch (justifytype) { + case J_LEFT: + case J_RAGPARA: + case J_JUSTPARA: + /* default x is relative to _win.w */ + curr_print_p->location.hor_p = symval("_win", (float **) 0); + curr_print_p->location.htype = AW; + break; + case J_RIGHT: + /* default x is relative to _win.e */ + curr_print_p->location.hor_p = symval("_win", (float **) 0); + curr_print_p->location.htype = AE; + break; + case J_CENTER: + /* default x is relative to _win.x */ + curr_print_p->location.hor_p = symval("_win", (float **) 0); + curr_print_p->location.htype = AX; + break; + case J_NONE: + default: + /* default is at current location */ + curr_print_p->location.hor_p = symval("_cur", (float **) 0); + curr_print_p->location.htype = AX; + break; + } + + curr_print_p->location.hsteps = 0.0; + curr_print_p->location.counts = 0.0; + curr_print_p->location.vtype = AY; + curr_print_p->location.vsteps = -extra; + + /* If this is the first print command in a block, + * we implicitly go down by the font ascent. */ + if (isPostScript == NO && Currblock_p != 0 + && Next_print_link_p_p + == &(Currblock_p->printdata_p) ) { + curr_print_p->location.vsteps -= fontascent(font, size) + / STEPSIZE; + got_nl = NO; + } + + } + else { + curr_print_p->location = *(inpc_p); + rep_inpcoord(inpc_p, &(curr_print_p->location) ); + FREE(inpc_p); + } + + curr_print_p->isPostScript = isPostScript; + if (isPostScript == YES) { + curr_print_p->width = 0.0; + } + else { + curr_print_p->width = strwidth(str); + } + curr_print_p->justifytype = (short) justifytype; + curr_print_p->string = str; + curr_print_p->inputfile = Curr_filename; + curr_print_p->inputlineno = (short) yylineno; + + /* special case of user asking that this be printed + * on the next line. In this case we go down by the + * current point size */ + if (got_nl) { + curr_print_p->location.vsteps -= + fontheight(font, size) / STEPSIZE; + } + + /* Now link onto proper list -- could be in BLOCKHEAD + * context or doing a PRHEAD. If we are in BLOCKHEAD context, we + * definitely have something in the main list to attach to. + * If in C_MUSIC, we may or may not depending on whether + * this is the first in a series of print commands. */ + if ( ((Context & C_BLOCKHEAD) != 0) + || ((Currstruct_p != (struct MAINLL *) 0) && + (Currstruct_p->str == S_PRHEAD) ) ) { + if (Next_print_link_p_p == (struct PRINTDATA **) 0) { + pfatal("Next_print_link_p_p is null"); + } + /* this means the value of Next_print_link_p_p + * is valid and will tell us where to link */ + *Next_print_link_p_p = curr_print_p; + } + else { + /* We must be in music context, but the last + * thing we saw wasn't a print command, so + * we have to allocate a PRHEAD and put it + * in the main list and attach to that. */ + /* allocate a new struct, put on main list and attach + * the print command to it */ + Currstruct_p = newMAINLLstruct(S_PRHEAD, yylineno); + insertMAINLL(Currstruct_p, Mainlltc_p); + Currstruct_p->u.prhead_p->printdata_p = curr_print_p; + Currstruct_p = (struct MAINLL *) 0; + } + + /* in any case, if we get another print command right away, it + * should be linked onto this one, so remember where we are */ + Next_print_link_p_p = &(curr_print_p->next); + curr_print_p->next = (struct PRINTDATA *) 0; +} + + +/* if the given string has a higher ascent than the given font/size, return + * the amount is it higher, in stepsizes */ + +static double +extra_needed(font, size, string) + +int font; /* default font for this string */ +int size; /* default size for this string */ +char *string; /* string, which might contain \s(xx) to make it bigger + * than normal */ + +{ + double usual_ascent; + double this_string_ascent; + + + /* get expected ascent for this font/size and actual for string */ + usual_ascent = fontascent(font, size); + (void) fix_string(string, font, size, Curr_filename, yylineno); + this_string_ascent = strascent(string); + + /* if this string is too tall, return by how much it is too tall */ + if (this_string_ascent > usual_ascent) { + return (this_string_ascent - usual_ascent) / STEPSIZE; + } + else { + return(0.0); + } +} + + +/* Sometimes lexer will recognize something as a keyword, but it's + * really a bunch of note letters, due to context. This function turns + * the mistaken keyword into notes. It handles a through g and r and s, but + * not n and u which would also be troublesome. + */ + +static void +keyword_notes(str) + +char *str; + +{ + for ( ; *str != '\0'; str++) { + /* On the last letter, if it's a true pitch, have to + * push it back into input, because it could be followed + * by an accidental or octave mark or tick or something. */ + if (*(str+1) == '\0' && *str >= 'a' && *str <= 'g') { + pushback(*str); + } + else { + add_note(Curr_grpsyl_p, (int) *str, 0, USE_DFLT_OCTAVE, + 0, NO, (char *) 0); + } + } +} + + +/* Free up the current additive time list, if any */ + +static void +free_extra_time() +{ + struct TIMELIST *tl_p; + + /* If this was the most recently allocated list, we can free it. + * We can't free otherwise, since Extra_time_p might be + * pointing to one from an SSV, which must be kept around. */ + if (Extra_time_p == Last_alloced_timelist_p) { + while (Extra_time_p != 0) { + tl_p = Extra_time_p->next; + FREE(Extra_time_p); + Extra_time_p = tl_p; + } + } + Extra_time_p = 0; + Last_alloced_timelist_p = 0; + Curr_timelist_p = 0; +} + + +/* Add an item to the internal representation of the time signature + * currently being collected */ + +static void +tsig_item(item) + +int item; /* the byte to add to timerep */ + +{ + if (Tsig_offset >= MAXTSLEN - 1) { + l_ufatal(Curr_filename, yylineno, + "time signature is too complicated"); + } + Timerep[Tsig_offset++] = (char) item; +} +