/* A Bison parser, made by GNU Bison 2.0a.  */

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 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

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 1

/* Using locations.  */
#define YYLSP_NEEDED 1



/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     PREC_TOP = 258,
     ADDLYRICS = 259,
     PREC_BOT = 260,
     ACCEPTS = 261,
     ADDQUOTE = 262,
     ALIAS = 263,
     ALTERNATIVE = 264,
     BOOK = 265,
     CHANGE = 266,
     CHORDMODE = 267,
     CHORDS = 268,
     CONSISTS = 269,
     CONTEXT = 270,
     DEFAULT = 271,
     DEFAULTCHILD = 272,
     DENIES = 273,
     DESCRIPTION = 274,
     DRUMMODE = 275,
     DRUMS = 276,
     FIGUREMODE = 277,
     FIGURES = 278,
     GROBDESCRIPTIONS = 279,
     HEADER = 280,
     INVALID = 281,
     KEY = 282,
     LAYOUT = 283,
     LYRICMODE = 284,
     LYRICS = 285,
     LYRICSTO = 286,
     MARK = 287,
     MARKUP = 288,
     MIDI = 289,
     NAME = 290,
     NOTEMODE = 291,
     OBJECTID = 292,
     OCTAVE = 293,
     ONCE = 294,
     OVERRIDE = 295,
     PAPER = 296,
     PARTIAL = 297,
     RELATIVE = 298,
     REMOVE = 299,
     REPEAT = 300,
     REST = 301,
     REVERT = 302,
     SCORE = 303,
     SEQUENTIAL = 304,
     SET = 305,
     SIMULTANEOUS = 306,
     SKIP = 307,
     TEMPO = 308,
     TIMES = 309,
     TRANSPOSE = 310,
     TRANSPOSITION = 311,
     TYPE = 312,
     UNSET = 313,
     WITH = 314,
     TIME_T = 315,
     NEWCONTEXT = 316,
     CHORD_BASS = 317,
     CHORD_CARET = 318,
     CHORD_COLON = 319,
     CHORD_MINUS = 320,
     CHORD_SLASH = 321,
     DOUBLE_ANGLE_CLOSE = 322,
     DOUBLE_ANGLE_OPEN = 323,
     E_BACKSLASH = 324,
     E_ANGLE_CLOSE = 325,
     E_CHAR = 326,
     E_CLOSE = 327,
     E_EXCLAMATION = 328,
     E_BRACKET_OPEN = 329,
     E_OPEN = 330,
     E_BRACKET_CLOSE = 331,
     E_ANGLE_OPEN = 332,
     E_PLUS = 333,
     E_TILDE = 334,
     EXTENDER = 335,
     FIGURE_CLOSE = 336,
     FIGURE_OPEN = 337,
     FIGURE_SPACE = 338,
     HYPHEN = 339,
     CHORDMODIFIERS = 340,
     LYRIC_MARKUP = 341,
     MULTI_MEASURE_REST = 342,
     SCM_T = 343,
     DIGIT = 344,
     E_UNSIGNED = 345,
     UNSIGNED = 346,
     BOOK_IDENTIFIER = 347,
     CHORDMODIFIER_PITCH = 348,
     CHORD_MODIFIER = 349,
     CONTEXT_DEF_IDENTIFIER = 350,
     DRUM_PITCH = 351,
     DURATION_IDENTIFIER = 352,
     EVENT_IDENTIFIER = 353,
     FRACTION = 354,
     LYRICS_STRING = 355,
     LYRIC_MARKUP_IDENTIFIER = 356,
     MARKUP_HEAD_EMPTY = 357,
     MARKUP_HEAD_LIST0 = 358,
     MARKUP_HEAD_MARKUP0 = 359,
     MARKUP_HEAD_MARKUP0_MARKUP1 = 360,
     MARKUP_HEAD_SCM0 = 361,
     MARKUP_HEAD_SCM0_MARKUP1 = 362,
     MARKUP_HEAD_SCM0_SCM1 = 363,
     MARKUP_HEAD_SCM0_SCM1_MARKUP2 = 364,
     MARKUP_HEAD_SCM0_SCM1_SCM2 = 365,
     MARKUP_IDENTIFIER = 366,
     MUSIC_FUNCTION = 367,
     MUSIC_FUNCTION_MARKUP = 368,
     MUSIC_FUNCTION_MARKUP_MARKUP = 369,
     MUSIC_FUNCTION_MARKUP_MARKUP_MUSIC = 370,
     MUSIC_FUNCTION_MARKUP_MUSIC = 371,
     MUSIC_FUNCTION_MARKUP_MUSIC_MUSIC = 372,
     MUSIC_FUNCTION_MUSIC = 373,
     MUSIC_FUNCTION_MUSIC_MUSIC = 374,
     MUSIC_FUNCTION_SCM = 375,
     MUSIC_FUNCTION_SCM_MUSIC = 376,
     MUSIC_FUNCTION_SCM_MUSIC_MUSIC = 377,
     MUSIC_FUNCTION_SCM_SCM = 378,
     MUSIC_FUNCTION_SCM_SCM_MUSIC = 379,
     MUSIC_FUNCTION_SCM_SCM_SCM = 380,
     MUSIC_IDENTIFIER = 381,
     NOTENAME_PITCH = 382,
     NUMBER_IDENTIFIER = 383,
     OUTPUT_DEF_IDENTIFIER = 384,
     REAL = 385,
     RESTNAME = 386,
     SCM_IDENTIFIER = 387,
     SCORE_IDENTIFIER = 388,
     STRING = 389,
     STRING_IDENTIFIER = 390,
     TONICNAME_PITCH = 391,
     UNARY_MINUS = 392
   };
#endif
#define PREC_TOP 258
#define ADDLYRICS 259
#define PREC_BOT 260
#define ACCEPTS 261
#define ADDQUOTE 262
#define ALIAS 263
#define ALTERNATIVE 264
#define BOOK 265
#define CHANGE 266
#define CHORDMODE 267
#define CHORDS 268
#define CONSISTS 269
#define CONTEXT 270
#define DEFAULT 271
#define DEFAULTCHILD 272
#define DENIES 273
#define DESCRIPTION 274
#define DRUMMODE 275
#define DRUMS 276
#define FIGUREMODE 277
#define FIGURES 278
#define GROBDESCRIPTIONS 279
#define HEADER 280
#define INVALID 281
#define KEY 282
#define LAYOUT 283
#define LYRICMODE 284
#define LYRICS 285
#define LYRICSTO 286
#define MARK 287
#define MARKUP 288
#define MIDI 289
#define NAME 290
#define NOTEMODE 291
#define OBJECTID 292
#define OCTAVE 293
#define ONCE 294
#define OVERRIDE 295
#define PAPER 296
#define PARTIAL 297
#define RELATIVE 298
#define REMOVE 299
#define REPEAT 300
#define REST 301
#define REVERT 302
#define SCORE 303
#define SEQUENTIAL 304
#define SET 305
#define SIMULTANEOUS 306
#define SKIP 307
#define TEMPO 308
#define TIMES 309
#define TRANSPOSE 310
#define TRANSPOSITION 311
#define TYPE 312
#define UNSET 313
#define WITH 314
#define TIME_T 315
#define NEWCONTEXT 316
#define CHORD_BASS 317
#define CHORD_CARET 318
#define CHORD_COLON 319
#define CHORD_MINUS 320
#define CHORD_SLASH 321
#define DOUBLE_ANGLE_CLOSE 322
#define DOUBLE_ANGLE_OPEN 323
#define E_BACKSLASH 324
#define E_ANGLE_CLOSE 325
#define E_CHAR 326
#define E_CLOSE 327
#define E_EXCLAMATION 328
#define E_BRACKET_OPEN 329
#define E_OPEN 330
#define E_BRACKET_CLOSE 331
#define E_ANGLE_OPEN 332
#define E_PLUS 333
#define E_TILDE 334
#define EXTENDER 335
#define FIGURE_CLOSE 336
#define FIGURE_OPEN 337
#define FIGURE_SPACE 338
#define HYPHEN 339
#define CHORDMODIFIERS 340
#define LYRIC_MARKUP 341
#define MULTI_MEASURE_REST 342
#define SCM_T 343
#define DIGIT 344
#define E_UNSIGNED 345
#define UNSIGNED 346
#define BOOK_IDENTIFIER 347
#define CHORDMODIFIER_PITCH 348
#define CHORD_MODIFIER 349
#define CONTEXT_DEF_IDENTIFIER 350
#define DRUM_PITCH 351
#define DURATION_IDENTIFIER 352
#define EVENT_IDENTIFIER 353
#define FRACTION 354
#define LYRICS_STRING 355
#define LYRIC_MARKUP_IDENTIFIER 356
#define MARKUP_HEAD_EMPTY 357
#define MARKUP_HEAD_LIST0 358
#define MARKUP_HEAD_MARKUP0 359
#define MARKUP_HEAD_MARKUP0_MARKUP1 360
#define MARKUP_HEAD_SCM0 361
#define MARKUP_HEAD_SCM0_MARKUP1 362
#define MARKUP_HEAD_SCM0_SCM1 363
#define MARKUP_HEAD_SCM0_SCM1_MARKUP2 364
#define MARKUP_HEAD_SCM0_SCM1_SCM2 365
#define MARKUP_IDENTIFIER 366
#define MUSIC_FUNCTION 367
#define MUSIC_FUNCTION_MARKUP 368
#define MUSIC_FUNCTION_MARKUP_MARKUP 369
#define MUSIC_FUNCTION_MARKUP_MARKUP_MUSIC 370
#define MUSIC_FUNCTION_MARKUP_MUSIC 371
#define MUSIC_FUNCTION_MARKUP_MUSIC_MUSIC 372
#define MUSIC_FUNCTION_MUSIC 373
#define MUSIC_FUNCTION_MUSIC_MUSIC 374
#define MUSIC_FUNCTION_SCM 375
#define MUSIC_FUNCTION_SCM_MUSIC 376
#define MUSIC_FUNCTION_SCM_MUSIC_MUSIC 377
#define MUSIC_FUNCTION_SCM_SCM 378
#define MUSIC_FUNCTION_SCM_SCM_MUSIC 379
#define MUSIC_FUNCTION_SCM_SCM_SCM 380
#define MUSIC_IDENTIFIER 381
#define NOTENAME_PITCH 382
#define NUMBER_IDENTIFIER 383
#define OUTPUT_DEF_IDENTIFIER 384
#define REAL 385
#define RESTNAME 386
#define SCM_IDENTIFIER 387
#define SCORE_IDENTIFIER 388
#define STRING 389
#define STRING_IDENTIFIER 390
#define TONICNAME_PITCH 391
#define UNARY_MINUS 392




/* Copy the first part of user declarations.  */
#line 10 "parser.yy"


#define YYERROR_VERBOSE 1
#define YYPARSE_PARAM my_lily_parser
#define YYLEX_PARAM my_lily_parser
#define THIS\
	((Lily_parser *) my_lily_parser)

#define yyerror THIS->parser_error

/* We use custom location type: Input objects */
#define YYLTYPE Input
#define YYLLOC_DEFAULT(Current,Rhs,N) \
	((Current).set_location ((Rhs)[1], (Rhs)[N]))


#line 56 "parser.yy"
 // -*-Fundamental-*-

/*
FIXME:

   * The rules for who is protecting what are very shady.  Uniformise
     this.

   * There are too many lexical modes?
*/

#include "config.hh"

#include <cctype>
#include <cstdlib>
#include <cstdio>
using namespace std;

#include "book.hh"
#include "context-def.hh"
#include "dimensions.hh"
#include "music.hh"
#include "file-path.hh"
#include "input-smob.hh"
#include "input.hh"
#include "lily-guile.hh"
#include "lilypond-input-version.hh"
#include "main.hh"
#include "misc.hh"
#include "lily-lexer.hh"
#include "lily-parser.hh"
#include "paper-book.hh"
#include "output-def.hh"
#include "scm-hash.hh"
#include "program-option.hh"
#include "score.hh"
#include "text-interface.hh"
#include "warn.hh"
#include "music.hh"



/* 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

#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 99 "parser.yy"
typedef union YYSTYPE {
	Book *book;
	Output_def *outputdef;
	SCM scm;
	String *string;
 	Music *music;
 	Score *score;
 	int i;
} YYSTYPE;
/* Line 191 of yacc.c.  */
#line 419 "out/parser.cc"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif

#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
typedef struct YYLTYPE
{
  int first_line;
  int first_column;
  int last_line;
  int last_column;
} YYLTYPE;
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
#endif


/* Copy the second part of user declarations.  */
#line 109 "parser.yy"


#define MY_MAKE_MUSIC(x)  make_music_by_name (ly_symbol2scm (x))

Music *property_op_to_music (SCM op);
Music *context_spec_music (SCM type, SCM id, Music *m, SCM ops);
SCM get_next_unique_context_id ();
SCM get_next_unique_lyrics_context_id ();

#undef _
#if !HAVE_GETTEXT
#define _(x) x
#else
#include <libintl.h>
#define _(x) gettext (x)
#endif



Music *make_lyric_combine_music (SCM name, Music *music);
Music *make_music_relative (Pitch start, Music *music);
Music *run_music_function (Lily_parser *, SCM expr);
Music *set_property_music (SCM sym, SCM value);
SCM get_first_context_id (SCM type, Music *m);
SCM make_chord (SCM pitch, SCM dur, SCM modification_list);
SCM make_chord_step (int step, int alter);
SCM make_simple_markup (SCM a);
bool is_duration (int t);
bool is_regular_identifier (SCM id);
bool ly_input_procedure_p (SCM x);
int yylex (YYSTYPE *s, YYLTYPE *loc, void *v);
void set_music_properties (Music *p, SCM a);



/* Line 214 of yacc.c.  */
#line 477 "out/parser.cc"

#if ! defined (yyoverflow) || YYERROR_VERBOSE

# ifndef YYFREE
#  define YYFREE free
# endif
# ifndef YYMALLOC
#  define YYMALLOC malloc
# endif

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   else
#    define YYSTACK_ALLOC alloca
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's `empty if-body' warning. */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
#  endif
# else
#  if defined (__STDC__) || defined (__cplusplus)
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   define YYSIZE_T size_t
#  else
#   define YYSIZE_T unsigned long int
#  endif
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
#  endif
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */


#if (! defined (yyoverflow) \
     && (! defined (__cplusplus) \
	 || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
             && defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  short int yyss;
  YYSTYPE yyvs;
    YYLTYPE yyls;
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (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 int) + sizeof (YYSTYPE) + sizeof (YYLTYPE))	\
      + 2 * YYSTACK_GAP_MAXIMUM)

/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined (__GNUC__) && 1 < __GNUC__
#   define YYCOPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define YYCOPY(To, From, Count)		\
      do					\
	{					\
	  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_MAXIMUM; \
	yyptr += yynewbytes / sizeof (*yyptr);				\
      }									\
    while (0)

#endif

#if defined (__STDC__) || defined (__cplusplus)
   typedef signed char yysigned_char;
#else
   typedef short int yysigned_char;
#endif

/* YYFINAL -- State number of the termination state. */
#define YYFINAL  2
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   2065

/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS  161
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS  130
/* YYNRULES -- Number of rules. */
#define YYNRULES  385
/* YYNRULES -- Number of states. */
#define YYNSTATES  573

/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
#define YYUNDEFTOK  2
#define YYMAXUTOK   392

#define YYTRANSLATE(YYX) 						\
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : 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,   159,     2,     2,     2,     2,     2,   152,
     150,   151,   156,   138,   153,   137,   143,   157,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,   158,     2,
     144,   142,   145,   160,     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,   147,     2,   148,   154,   155,     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,   140,   146,   141,   149,     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,   139
};

#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
   YYRHS.  */
static const unsigned short int yyprhs[] =
{
       0,     0,     3,     4,     7,    10,    13,    16,    19,    21,
      23,    25,    27,    29,    31,    33,    35,    37,    39,    40,
      43,    48,    50,    52,    56,    58,    60,    62,    64,    66,
      68,    70,    72,    74,    76,    78,    80,    85,    86,    88,
      92,    95,   100,   101,   103,   106,   109,   112,   115,   118,
     121,   126,   128,   130,   133,   136,   139,   142,   144,   147,
     149,   151,   153,   156,   160,   163,   166,   169,   172,   177,
     178,   181,   184,   187,   189,   191,   192,   197,   203,   208,
     212,   217,   221,   223,   225,   227,   229,   230,   231,   237,
     238,   241,   243,   245,   247,   249,   251,   253,   255,   258,
     261,   265,   269,   274,   277,   282,   286,   290,   294,   299,
     304,   306,   313,   318,   323,   327,   329,   334,   337,   341,
     343,   345,   347,   349,   351,   353,   355,   357,   359,   361,
     363,   367,   370,   371,   375,   376,   381,   384,   385,   390,
     395,   399,   402,   408,   415,   419,   421,   423,   425,   427,
     429,   431,   433,   435,   437,   439,   442,   444,   448,   454,
     461,   465,   470,   473,   476,   478,   480,   484,   486,   488,
     490,   492,   494,   496,   498,   500,   502,   503,   507,   509,
     511,   515,   517,   519,   521,   523,   527,   528,   531,   537,
     540,   542,   544,   547,   551,   556,   560,   562,   565,   568,
     570,   572,   574,   576,   579,   582,   585,   588,   590,   593,
     595,   598,   602,   603,   606,   609,   613,   618,   620,   623,
     625,   627,   630,   633,   635,   637,   639,   641,   643,   645,
     647,   649,   651,   653,   655,   657,   659,   661,   663,   665,
     667,   668,   670,   673,   676,   678,   681,   683,   686,   688,
     691,   694,   696,   699,   702,   704,   706,   708,   710,   712,
     714,   716,   718,   720,   722,   724,   726,   728,   730,   732,
     734,   736,   738,   739,   741,   744,   747,   749,   753,   757,
     759,   763,   764,   767,   769,   772,   774,   776,   778,   780,
     782,   784,   786,   788,   790,   793,   796,   799,   801,   803,
     805,   807,   810,   811,   814,   818,   819,   821,   828,   831,
     834,   837,   840,   843,   845,   847,   849,   852,   857,   858,
     861,   863,   865,   868,   871,   873,   875,   877,   879,   883,
     885,   888,   891,   895,   899,   901,   903,   907,   911,   914,
     916,   918,   920,   922,   925,   928,   930,   932,   933,   936,
     937,   940,   942,   943,   947,   949,   950,   954,   956,   959,
     961,   963,   965,   968,   972,   973,   976,   979,   981,   984,
     988,   990,   993,   995,   997,   999,  1001,  1002,  1008,  1011,
    1016,  1020,  1022,  1025,  1029,  1032
};

/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short int yyrhs[] =
{
     162,     0,    -1,    -1,   162,   164,    -1,   162,   170,    -1,
     162,     1,    -1,   162,    26,    -1,    37,   134,    -1,   168,
      -1,   226,    -1,   174,    -1,   176,    -1,   165,    -1,   279,
      -1,   179,    -1,   193,    -1,    88,    -1,   132,    -1,    -1,
     167,   170,    -1,    25,   140,   167,   141,    -1,   134,    -1,
     100,    -1,   169,   142,   171,    -1,   166,    -1,   176,    -1,
     174,    -1,   179,    -1,   172,    -1,   184,    -1,   231,    -1,
     270,    -1,   212,    -1,   166,    -1,   279,    -1,    89,    -1,
      15,   140,   173,   141,    -1,    -1,    95,    -1,   173,    24,
     166,    -1,   173,   209,    -1,    10,   140,   175,   141,    -1,
      -1,    92,    -1,   175,   178,    -1,   175,   176,    -1,   175,
     279,    -1,   175,   168,    -1,   175,     1,    -1,   175,   163,
      -1,    48,   140,   177,   141,    -1,   184,    -1,   133,    -1,
     177,   163,    -1,   177,   168,    -1,   177,   179,    -1,   177,
       1,    -1,   179,    -1,   181,   141,    -1,    41,    -1,    34,
      -1,    28,    -1,   180,   140,    -1,   180,   140,   129,    -1,
     181,   170,    -1,   181,   172,    -1,   181,   182,    -1,   181,
       1,    -1,    53,   249,   142,   274,    -1,    -1,   183,   184,
      -1,   183,   166,    -1,   183,     1,    -1,   189,    -1,   193,
      -1,    -1,     9,   140,   183,   141,    -1,    45,   213,   274,
     184,   185,    -1,    49,   140,   183,   141,    -1,   140,   183,
     141,    -1,    51,   140,   183,   141,    -1,   220,   183,   221,
      -1,   216,    -1,   126,    -1,   211,    -1,   206,    -1,    -1,
      -1,    59,   191,   140,   192,   141,    -1,    -1,   192,   209,
      -1,   197,    -1,   194,    -1,   188,    -1,   187,    -1,   166,
      -1,   213,    -1,   112,    -1,   120,   195,    -1,   113,   279,
      -1,   121,   195,   184,    -1,   123,   195,   195,    -1,   125,
     195,   195,   195,    -1,   118,   184,    -1,   124,   195,   195,
     184,    -1,   116,   279,   184,    -1,   114,   279,   279,    -1,
     119,   184,   184,    -1,   122,   195,   184,   184,    -1,   117,
     279,   184,   184,    -1,   196,    -1,    15,   213,   142,   213,
     190,   184,    -1,    15,   213,   190,   184,    -1,    61,   213,
     190,   184,    -1,    54,   251,   184,    -1,   186,    -1,    55,
     242,   242,   184,    -1,   198,   194,    -1,   199,   190,   194,
      -1,   200,    -1,   204,    -1,    36,    -1,    20,    -1,    22,
      -1,    12,    -1,    29,    -1,    21,    -1,    23,    -1,    13,
      -1,    30,    -1,    43,   246,   184,    -1,    43,   193,    -1,
      -1,     4,   202,   194,    -1,    -1,   201,     4,   203,   194,
      -1,   194,   201,    -1,    -1,    31,   213,   205,   184,    -1,
      11,   134,   142,   134,    -1,   134,   142,   214,    -1,    58,
     213,    -1,    40,   213,   166,   142,   166,    -1,    40,   213,
     166,   166,   142,   166,    -1,    47,   213,   166,    -1,    14,
      -1,    44,    -1,     6,    -1,    17,    -1,    18,    -1,     8,
      -1,    57,    -1,    19,    -1,    35,    -1,   207,    -1,   208,
     134,    -1,   213,    -1,   213,   143,   213,    -1,    40,   210,
     166,   142,   214,    -1,    40,   210,   166,   166,   142,   214,
      -1,    47,   210,   166,    -1,    50,   210,   142,   214,    -1,
      58,   210,    -1,    39,   211,    -1,   134,    -1,   135,    -1,
     212,   138,   212,    -1,   134,    -1,   100,    -1,   135,    -1,
     212,    -1,   100,    -1,   273,    -1,   166,    -1,   279,    -1,
      89,    -1,    -1,   215,   262,   229,    -1,   227,    -1,   217,
      -1,   222,   248,   229,    -1,   144,    -1,   145,    -1,    68,
      -1,    67,    -1,   218,   223,   219,    -1,    -1,   223,   224,
      -1,   241,   275,   276,   236,   229,    -1,    96,   229,    -1,
     225,    -1,   112,    -1,   118,   224,    -1,   121,   195,   224,
      -1,   124,   195,   195,   224,    -1,     7,   212,   184,    -1,
     228,    -1,    52,   247,    -1,    38,   241,    -1,    74,    -1,
      76,    -1,    69,    -1,   146,    -1,    56,   241,    -1,    42,
     247,    -1,    60,   251,    -1,    32,   214,    -1,    79,    -1,
      32,    16,    -1,   182,    -1,    27,    16,    -1,    27,   127,
     132,    -1,    -1,   229,   231,    -1,   118,   231,    -1,   121,
     195,   231,    -1,   124,   195,   195,   231,    -1,   234,    -1,
     137,   230,    -1,    84,    -1,    80,    -1,   245,   235,    -1,
     245,   234,    -1,   232,    -1,    90,    -1,   147,    -1,   148,
      -1,   149,    -1,   150,    -1,   151,    -1,    73,    -1,    75,
      -1,    72,    -1,    70,    -1,    77,    -1,   233,    -1,    98,
      -1,   253,    -1,   243,    -1,   244,    -1,    -1,   142,    -1,
     142,   238,    -1,   142,   237,    -1,   152,    -1,   237,   152,
      -1,   153,    -1,   238,   153,    -1,   127,    -1,   127,   237,
      -1,   127,   238,    -1,   136,    -1,   136,   237,    -1,   136,
     238,    -1,   239,    -1,   241,    -1,   240,    -1,   279,    -1,
     212,    -1,    89,    -1,   154,    -1,   138,    -1,   137,    -1,
     146,    -1,   145,    -1,   143,    -1,   155,    -1,   155,    -1,
     154,    -1,   137,    -1,   239,    -1,   250,    -1,    -1,   250,
      -1,   274,   252,    -1,    97,   252,    -1,   249,    -1,   250,
     156,   274,    -1,   250,   156,    99,    -1,    99,    -1,    91,
     157,    91,    -1,    -1,   252,   143,    -1,   158,    -1,   158,
     274,    -1,    89,    -1,    91,    -1,   134,    -1,   279,    -1,
     137,    -1,   138,    -1,   159,    -1,    83,    -1,   254,    -1,
     256,   148,    -1,   256,   255,    -1,   256,   257,    -1,    78,
      -1,    73,    -1,   157,    -1,   256,    -1,   147,   256,    -1,
      -1,   259,   258,    -1,    82,   259,    81,    -1,    -1,    46,
      -1,   241,   275,   276,   236,   248,   261,    -1,    96,   248,
      -1,   260,   248,    -1,   131,   248,    -1,    87,   248,    -1,
     263,   248,    -1,   264,    -1,   277,    -1,   100,    -1,   240,
     248,    -1,   240,   248,   266,   265,    -1,    -1,   265,   267,
      -1,    64,    -1,    63,    -1,    66,   240,    -1,    62,   240,
      -1,   266,    -1,   268,    -1,    94,    -1,   269,    -1,   268,
     143,   269,    -1,   274,    -1,   274,   138,    -1,   274,    65,
      -1,   270,   138,   271,    -1,   270,   137,   271,    -1,   271,
      -1,   272,    -1,   272,   156,   272,    -1,   272,   157,   272,
      -1,   137,   272,    -1,   273,    -1,    91,    -1,   130,    -1,
     128,    -1,   130,   128,    -1,    91,   128,    -1,    91,    -1,
      89,    -1,    -1,   275,   159,    -1,    -1,   276,   160,    -1,
     101,    -1,    -1,    86,   278,   281,    -1,   111,    -1,    -1,
      33,   280,   281,    -1,   282,    -1,   287,   288,    -1,   288,
      -1,   283,    -1,   284,    -1,   287,   284,    -1,   140,   285,
     141,    -1,    -1,   285,   290,    -1,   285,   282,    -1,   104,
      -1,   107,   166,    -1,   109,   166,   166,    -1,   286,    -1,
     287,   286,    -1,   134,    -1,   111,    -1,   101,    -1,   135,
      -1,    -1,    48,   289,   140,   177,   141,    -1,   106,   166,
      -1,   110,   166,   166,   166,    -1,   108,   166,   166,    -1,
     102,    -1,   103,   282,    -1,   105,   290,   290,    -1,   287,
     288,    -1,   288,    -1
};

/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
static const unsigned short int yyrline[] =
{
       0,   430,   430,   431,   433,   435,   438,   445,   449,   452,
     455,   461,   468,   474,   478,   495,   500,   501,   506,   510,
     516,   525,   526,   530,   546,   551,   555,   559,   563,   566,
     570,   574,   577,   580,   583,   586,   592,   599,   603,   607,
     618,   626,   635,   642,   646,   650,   655,   658,   661,   665,
     671,   677,   688,   692,   695,   698,   710,   721,   733,   742,
     747,   752,   762,   767,   776,   779,   782,   792,   798,   813,
     816,   827,   830,   847,   848,   852,   855,   862,   921,   926,
     934,   940,   948,   949,   952,   953,   958,   959,   959,   968,
     969,   976,   977,   981,   982,   987,   988,   992,   995,   998,
    1002,  1006,  1009,  1012,  1016,  1019,  1023,  1026,  1031,  1036,
    1044,  1047,  1051,  1054,  1059,  1075,  1076,  1086,  1100,  1112,
    1113,  1117,  1123,  1130,  1135,  1143,  1150,  1156,  1161,  1168,
    1176,  1182,  1192,  1192,  1201,  1201,  1210,  1238,  1238,  1250,
    1261,  1265,  1269,  1273,  1277,  1284,  1285,  1287,  1288,  1289,
    1291,  1292,  1293,  1294,  1298,  1299,  1305,  1314,  1321,  1328,
    1335,  1343,  1350,  1356,  1366,  1369,  1372,  1377,  1380,  1383,
    1388,  1391,  1394,  1397,  1400,  1403,  1427,  1431,  1444,  1445,
    1450,  1466,  1469,  1472,  1475,  1479,  1489,  1490,  1497,  1525,
    1537,  1544,  1547,  1551,  1555,  1565,  1574,  1582,  1588,  1594,
    1604,  1614,  1618,  1628,  1637,  1648,  1655,  1665,  1668,  1672,
    1675,  1679,  1697,  1700,  1708,  1711,  1714,  1721,  1724,  1729,
    1734,  1739,  1744,  1749,  1753,  1762,  1765,  1768,  1771,  1774,
    1777,  1780,  1783,  1786,  1789,  1795,  1809,  1812,  1821,  1824,
    1835,  1836,  1837,  1838,  1842,  1845,  1851,  1854,  1860,  1863,
    1868,  1880,  1883,  1888,  1897,  1903,  1904,  1908,  1914,  1922,
    1931,  1934,  1937,  1940,  1943,  1946,  1949,  1955,  1956,  1957,
    1962,  1968,  1974,  1978,  1985,  1994,  2003,  2006,  2009,  2017,
    2018,  2024,  2027,  2033,  2036,  2044,  2047,  2050,  2051,  2055,
    2056,  2057,  2061,  2067,  2079,  2083,  2094,  2113,  2116,  2119,
    2125,  2128,  2135,  2138,  2144,  2154,  2155,  2159,  2191,  2204,
    2213,  2233,  2240,  2253,  2261,  2264,  2270,  2273,  2280,  2283,
    2289,  2292,  2295,  2298,  2304,  2307,  2310,  2316,  2317,  2323,
    2326,  2329,  2341,  2344,  2347,  2351,  2354,  2357,  2363,  2366,
    2371,  2374,  2377,  2380,  2383,  2390,  2393,  2399,  2400,  2404,
    2405,  2413,  2417,  2416,  2425,  2429,  2428,  2437,  2440,  2443,
    2449,  2452,  2458,  2465,  2471,  2472,  2475,  2481,  2484,  2487,
    2493,  2496,  2502,  2505,  2508,  2511,  2514,  2514,  2523,  2526,
    2529,  2532,  2535,  2538,  2544,  2548
};
#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", "PREC_TOP", "\\addlyrics", "PREC_BOT",
  "\\accepts", "\\addquote", "\\alias", "\\alternative", "\book",
  "\\change", "\\chordmode", "\\chords", "\\consists", "\\context",
  "\\default", "\\defaultchild", "\\denies", "\\description", "\\drummode",
  "\\drums", "\\figuremode", "\\figures", "\\grobdescriptions", "\\header",
  "\\invalid", "\\key", "\\layout", "\\lyricmode", "\\lyrics",
  "\\lyricsto", "\\mark", "\\markup", "\\midi", "\\name", "\\notemode",
  "\\objectid", "\\octave", "\\once", "\\override", "\\paper", "\\partial",
  "\\relative", "\\remove", "\\repeat", "\\rest", "\\revert", "\\score",
  "\\sequential", "\\set", "\\simultaneous", "\\skip", "\\tempo",
  "\\times", "\\transpose", "\\transposition", "\\type", "\\unset",
  "\\with", "\\time", "\\new", "/+", "^", ":", "-", "/", ">>", "<<", "\\",
  "\\>", "\\C[haracter]", "\\)", "\\!", "\\[", "\\(", "\\]", "\\<", "\\+",
  "\\~", "__", "FIGURE_CLOSE", "FIGURE_OPEN", "_", "--", "CHORDMODIFIERS",
  "LYRIC_MARKUP", "MULTI_MEASURE_REST", "SCM_T", "DIGIT", "E_UNSIGNED",
  "UNSIGNED", "BOOK_IDENTIFIER", "CHORDMODIFIER_PITCH", "CHORD_MODIFIER",
  "CONTEXT_DEF_IDENTIFIER", "DRUM_PITCH", "DURATION_IDENTIFIER",
  "EVENT_IDENTIFIER", "FRACTION", "LYRICS_STRING",
  "LYRIC_MARKUP_IDENTIFIER", "MARKUP_HEAD_EMPTY", "MARKUP_HEAD_LIST0",
  "MARKUP_HEAD_MARKUP0", "MARKUP_HEAD_MARKUP0_MARKUP1", "MARKUP_HEAD_SCM0",
  "MARKUP_HEAD_SCM0_MARKUP1", "MARKUP_HEAD_SCM0_SCM1",
  "MARKUP_HEAD_SCM0_SCM1_MARKUP2", "MARKUP_HEAD_SCM0_SCM1_SCM2",
  "MARKUP_IDENTIFIER", "MUSIC_FUNCTION", "MUSIC_FUNCTION_MARKUP",
  "MUSIC_FUNCTION_MARKUP_MARKUP", "MUSIC_FUNCTION_MARKUP_MARKUP_MUSIC",
  "MUSIC_FUNCTION_MARKUP_MUSIC", "MUSIC_FUNCTION_MARKUP_MUSIC_MUSIC",
  "MUSIC_FUNCTION_MUSIC", "MUSIC_FUNCTION_MUSIC_MUSIC",
  "MUSIC_FUNCTION_SCM", "MUSIC_FUNCTION_SCM_MUSIC",
  "MUSIC_FUNCTION_SCM_MUSIC_MUSIC", "MUSIC_FUNCTION_SCM_SCM",
  "MUSIC_FUNCTION_SCM_SCM_MUSIC", "MUSIC_FUNCTION_SCM_SCM_SCM",
  "MUSIC_IDENTIFIER", "NOTENAME_PITCH", "NUMBER_IDENTIFIER",
  "OUTPUT_DEF_IDENTIFIER", "REAL", "RESTNAME", "SCM_IDENTIFIER",
  "SCORE_IDENTIFIER", "STRING", "STRING_IDENTIFIER", "TONICNAME_PITCH",
  "'-'", "'+'", "UNARY_MINUS", "'{'", "'}'", "'='", "'.'", "'<'", "'>'",
  "'|'", "'['", "']'", "'~'", "'('", "')'", "'''", "','", "'^'", "'_'",
  "'*'", "'/'", "':'", "'!'", "'?'", "$accept", "lilypond",
  "object_id_setting", "toplevel_expression", "toplevel_music",
  "embedded_scm", "lilypond_header_body", "lilypond_header",
  "assignment_id", "assignment", "identifier_init",
  "context_def_spec_block", "context_def_spec_body", "book_block",
  "book_body", "score_block", "score_body", "paper_block", "output_def",
  "output_def_head", "output_def_body", "tempo_event", "Music_list",
  "Music", "Alternative_music", "Repeated_music", "Sequential_music",
  "Simultaneous_music", "Simple_music", "optional_context_mod", "@1",
  "context_mod_list", "Composite_music", "Grouped_music_list",
  "function_scm_argument", "Generic_prefix_music_scm",
  "Prefix_composite_music", "mode_changing_head",
  "mode_changing_head_with_context", "relative_music", "new_lyrics", "@2",
  "@3", "re_rhythmed_music", "@4", "context_change", "property_operation",
  "context_def_mod", "context_mod", "context_prop_spec",
  "music_property_def", "string", "simple_string", "scalar", "pre_events",
  "event_chord", "note_chord_element", "chord_open", "chord_close",
  "simul_open", "simul_close", "chord_body", "chord_body_elements",
  "chord_body_element", "music_function_chord_body", "add_quote",
  "command_element", "command_event", "post_events",
  "music_function_event", "post_event", "string_number_event",
  "direction_less_char", "direction_less_event", "direction_reqd_event",
  "octave_check", "sup_quotes", "sub_quotes", "steno_pitch",
  "steno_tonic_pitch", "pitch", "pitch_also_in_chords", "gen_text_def",
  "script_abbreviation", "script_dir", "absolute_pitch", "duration_length",
  "optional_notemode_duration", "steno_duration", "multiplied_duration",
  "fraction", "dots", "tremolo_type", "bass_number",
  "figured_bass_alteration", "bass_figure", "figured_bass_modification",
  "br_bass_figure", "figure_list", "figure_spec", "optional_rest",
  "simple_element", "lyric_element", "new_chord", "chord_items",
  "chord_separator", "chord_item", "step_numbers", "step_number",
  "number_expression", "number_term", "number_factor", "bare_number",
  "bare_unsigned", "exclamations", "questions", "lyric_markup", "@5",
  "full_markup", "@6", "markup_top", "markup_list", "markup_composed_list",
  "markup_braced_list", "markup_braced_list_body", "markup_head_1_item",
  "markup_head_1_list", "simple_markup", "@7", "markup", 0
};
#endif

/* INFRINGES ON USER NAME SPACE */
#ifndef _
# define _(msgid) msgid
#endif

# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
   token YYLEX-NUM.  */
static const unsigned short int 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,    45,    43,   392,
     123,   125,    61,    46,    60,    62,   124,    91,    93,   126,
      40,    41,    39,    44,    94,    95,    42,    47,    58,    33,
      63
};
# endif

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
static const unsigned short int yyr1[] =
{
       0,   161,   162,   162,   162,   162,   162,   163,   164,   164,
     164,   164,   164,   164,   164,   165,   166,   166,   167,   167,
     168,   169,   169,   170,   170,   171,   171,   171,   171,   171,
     171,   171,   171,   171,   171,   171,   172,   173,   173,   173,
     173,   174,   175,   175,   175,   175,   175,   175,   175,   175,
     176,   177,   177,   177,   177,   177,   177,   178,   179,   180,
     180,   180,   181,   181,   181,   181,   181,   181,   182,   183,
     183,   183,   183,   184,   184,   185,   185,   186,   187,   187,
     188,   188,   189,   189,   189,   189,   190,   191,   190,   192,
     192,   193,   193,   194,   194,   195,   195,   196,   196,   196,
     196,   196,   196,   196,   196,   196,   196,   196,   196,   196,
     197,   197,   197,   197,   197,   197,   197,   197,   197,   197,
     197,   198,   198,   198,   198,   198,   199,   199,   199,   199,
     200,   200,   202,   201,   203,   201,   204,   205,   204,   206,
     207,   207,   207,   207,   207,   208,   208,   208,   208,   208,
     208,   208,   208,   208,   209,   209,   210,   210,   211,   211,
     211,   211,   211,   211,   212,   212,   212,   213,   213,   213,
     214,   214,   214,   214,   214,   214,   215,   216,   216,   216,
     217,   218,   219,   220,   221,   222,   223,   223,   224,   224,
     224,   225,   225,   225,   225,   226,   227,   227,   227,   227,
     227,   227,   227,   227,   227,   227,   227,   228,   228,   228,
     228,   228,   229,   229,   230,   230,   230,   231,   231,   231,
     231,   231,   231,   231,   232,   233,   233,   233,   233,   233,
     233,   233,   233,   233,   233,   234,   234,   234,   235,   235,
     236,   236,   236,   236,   237,   237,   238,   238,   239,   239,
     239,   240,   240,   240,   241,   242,   242,   243,   243,   243,
     244,   244,   244,   244,   244,   244,   244,   245,   245,   245,
     246,   247,   248,   248,   249,   249,   250,   250,   250,   251,
     251,   252,   252,   253,   253,   254,   254,   254,   254,   255,
     255,   255,   256,   256,   256,   256,   256,   257,   257,   257,
     258,   258,   259,   259,   260,   261,   261,   262,   262,   262,
     262,   262,   262,   262,   263,   263,   264,   264,   265,   265,
     266,   266,   266,   266,   267,   267,   267,   268,   268,   269,
     269,   269,   270,   270,   270,   271,   271,   271,   272,   272,
     273,   273,   273,   273,   273,   274,   274,   275,   275,   276,
     276,   277,   278,   277,   279,   280,   279,   281,   281,   281,
     282,   282,   283,   284,   285,   285,   285,   286,   286,   286,
     287,   287,   288,   288,   288,   288,   289,   288,   288,   288,
     288,   288,   288,   288,   290,   290
};

/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
static const unsigned char yyr2[] =
{
       0,     2,     0,     2,     2,     2,     2,     2,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     0,     2,
       4,     1,     1,     3,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     4,     0,     1,     3,
       2,     4,     0,     1,     2,     2,     2,     2,     2,     2,
       4,     1,     1,     2,     2,     2,     2,     1,     2,     1,
       1,     1,     2,     3,     2,     2,     2,     2,     4,     0,
       2,     2,     2,     1,     1,     0,     4,     5,     4,     3,
       4,     3,     1,     1,     1,     1,     0,     0,     5,     0,
       2,     1,     1,     1,     1,     1,     1,     1,     2,     2,
       3,     3,     4,     2,     4,     3,     3,     3,     4,     4,
       1,     6,     4,     4,     3,     1,     4,     2,     3,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       3,     2,     0,     3,     0,     4,     2,     0,     4,     4,
       3,     2,     5,     6,     3,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     2,     1,     3,     5,     6,
       3,     4,     2,     2,     1,     1,     3,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     0,     3,     1,     1,
       3,     1,     1,     1,     1,     3,     0,     2,     5,     2,
       1,     1,     2,     3,     4,     3,     1,     2,     2,     1,
       1,     1,     1,     2,     2,     2,     2,     1,     2,     1,
       2,     3,     0,     2,     2,     3,     4,     1,     2,     1,
       1,     2,     2,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       0,     1,     2,     2,     1,     2,     1,     2,     1,     2,
       2,     1,     2,     2,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     0,     1,     2,     2,     1,     3,     3,     1,
       3,     0,     2,     1,     2,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     2,     2,     2,     1,     1,     1,
       1,     2,     0,     2,     3,     0,     1,     6,     2,     2,
       2,     2,     2,     1,     1,     1,     2,     4,     0,     2,
       1,     1,     2,     2,     1,     1,     1,     1,     3,     1,
       2,     2,     3,     3,     1,     1,     3,     3,     2,     1,
       1,     1,     1,     2,     2,     1,     1,     0,     2,     0,
       2,     1,     0,     3,     1,     0,     3,     1,     2,     1,
       1,     1,     2,     3,     0,     2,     2,     1,     2,     3,
       1,     2,     1,     1,     1,     1,     0,     5,     2,     4,
       3,     1,     2,     3,     2,     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 int yydefact[] =
{
       2,     0,     1,     5,     0,     0,   124,   128,     0,   122,
     126,   123,   127,     0,     6,    61,   125,   129,     0,   355,
      60,   121,    59,     0,     0,     0,     0,     0,     0,     0,
       0,   183,    16,    22,   354,    97,     0,     0,     0,     0,
     176,   176,     0,     0,     0,     0,     0,     0,    17,    21,
      69,     3,    12,    24,     8,     0,     4,    10,    11,    14,
       0,     0,   115,    94,    93,    15,    92,   110,    91,     0,
      86,   119,   120,    69,     9,    13,   164,   165,   176,    42,
     168,   167,   169,    86,    18,   137,     0,   248,   131,   270,
     176,     0,   176,    69,    69,     0,   279,   176,   251,   254,
     256,   255,     0,    86,    99,     0,   176,   176,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,   201,   199,   200,   207,    83,   181,   202,   209,
     103,    73,    74,    85,    84,     0,    82,   179,   186,   272,
     178,   196,   176,    95,    98,    96,   176,   176,     0,     0,
       0,     0,   176,    62,    67,     0,    58,    64,    65,    66,
     132,   136,   117,    87,     0,     0,     0,   195,    43,     0,
       0,   176,     0,   176,   376,   374,   381,     0,   367,     0,
       0,     0,     0,     0,     0,   373,   372,   375,   364,   356,
     357,   360,   361,   370,     0,   359,   244,   246,   249,   250,
     130,   346,   345,   176,    52,     0,    51,     0,     0,     0,
     114,   252,   253,   176,   176,   106,   105,   176,     0,   210,
       0,   208,   175,   340,   171,   342,   341,   173,   170,   206,
     172,   174,   198,   163,     0,   156,   281,   204,   276,   271,
     281,     0,     0,   197,     0,   203,   162,   205,   302,   352,
     272,   272,   315,   351,   272,   272,   347,   272,   212,   272,
     313,   314,     0,   212,   273,   107,   100,   176,   101,   176,
       0,    72,    79,    71,    70,     0,   233,   232,   230,   231,
     234,   220,   219,    35,   224,   236,   269,   225,   226,   227,
     228,   229,   268,   267,   283,    33,    23,    28,    26,    25,
      27,    29,    32,    30,   223,   235,   217,     0,   237,    31,
     334,   335,   339,    34,    63,    37,     0,   134,     0,   118,
     184,    81,   166,    48,     0,    41,    49,    47,    45,    44,
      57,    46,    86,   112,    20,    19,   138,     0,   382,     0,
       0,   385,     0,   378,   368,     0,     0,     0,     0,   362,
     371,   358,   245,   247,    75,    56,    50,    53,    54,    55,
      78,    80,   280,   116,   113,   109,     0,   211,   344,   343,
       0,     0,   275,     0,   274,   160,     0,     0,     0,     0,
     311,   308,   310,   316,   349,   309,   177,   312,   212,   191,
       0,     0,     0,   182,   185,   187,   190,   347,   180,   108,
     104,   102,     0,     0,     0,     0,   218,   338,   284,   259,
     262,   261,   265,   264,   263,   260,   266,   258,   222,   221,
     238,   239,   257,     0,     0,     0,     0,    38,     0,   133,
       0,    89,     7,   176,   176,   384,   383,   380,   369,     0,
     363,   366,     0,   365,     0,    77,   139,     0,     0,   157,
     282,   278,   277,   161,    68,   304,   292,   285,   286,   287,
       0,   293,   300,   303,   288,   353,     0,   321,   320,     0,
     318,   348,   240,   269,   213,   189,   192,     0,     0,   349,
     214,     0,     0,   333,   332,   336,   337,   147,   150,   145,
     148,   149,   152,     0,   153,     0,   146,     0,   151,     0,
       0,    36,   154,     0,    40,   135,     0,   111,     0,   379,
      69,   158,     0,   301,   298,   297,   289,   290,   294,   299,
     291,   295,   296,   323,   322,   317,   241,   350,   272,   193,
       0,   240,   215,     0,    39,     0,     0,   141,     0,   155,
      88,    90,   377,     0,   159,   326,   324,   319,   325,   327,
     329,   243,   242,   305,   194,   212,   216,     0,   144,   140,
      76,     0,   331,   330,   306,   307,   188,     0,     0,   328,
     142,     0,   143
};

/* YYDEFGOTO[NTERM-NUM]. */
static const short int yydefgoto[] =
{
      -1,     1,   357,    51,    52,   143,   172,   358,    55,    56,
     296,   158,   428,    57,   169,    58,   205,   329,   359,    60,
      61,   129,   151,   274,   445,    62,    63,    64,   131,   164,
     318,   506,   132,    66,   144,    67,    68,    69,    70,    71,
     161,   316,   430,    72,   173,   133,   502,   503,   504,   234,
     134,   228,   145,   229,   135,   136,   137,   138,   394,    73,
     321,   139,   262,   395,   396,    74,   140,   141,   386,   406,
     474,   304,   305,   306,   419,   528,   198,   199,    99,   100,
     397,   102,   420,   421,   307,    90,   237,   263,   238,   264,
      97,   372,   308,   461,   521,   462,   522,   463,   378,   257,
     565,   258,   259,   260,   525,   470,   547,   548,   549,   309,
     310,   311,   312,   240,   384,   472,   261,   379,   231,    86,
     189,   190,   191,   192,   348,   193,   194,   341,   337,   342
};

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
#define YYPACT_NINF -354
static const short int yypact[] =
{
    -354,  1385,  -354,  -354,   -39,  -102,  -354,  -354,    40,  -354,
    -354,  -354,  -354,   -81,  -354,  -354,  -354,  -354,    40,  -354,
    -354,  -354,  -354,  1890,    40,   -67,   -55,   -51,   -11,   -53,
      40,  -354,  -354,  -354,  -354,  -354,    14,    14,    14,    14,
    1760,  1760,   136,   136,   136,   136,   136,   136,  -354,  -354,
    -354,  -354,  -354,  -354,  -354,   -28,  -354,  -354,  -354,  -354,
      25,    96,  -354,  -354,  -354,  -354,   132,  -354,  -354,     1,
     134,  -354,  -354,  -354,  -354,  -354,  -354,  -354,  1500,   126,
    -354,  -354,  -354,   -13,  -354,  -354,  1353,    16,  -354,  -354,
    1760,   143,  1630,  -354,  -354,    87,  -354,  1760,    16,  -354,
    -354,  -354,   -53,   134,  -354,    14,  1760,  1760,   101,    35,
     325,   121,   427,    40,   230,    40,    40,   230,   230,   121,
      40,   -11,  -354,  -354,  -354,  -354,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,  -354,  -354,   -29,  -354,  -354,  -354,   230,
    -354,  -354,  1760,  -354,  -354,  -354,  1760,  1760,   136,   136,
     136,   703,   552,   138,  -354,   110,  -354,  -354,  -354,  -354,
    -354,   255,  -354,  -354,     1,   839,   -39,  -354,  -354,   105,
      40,  1760,    97,  1760,  -354,  -354,  -354,   151,  -354,  1493,
      -9,    -9,    -9,    -9,    -9,  -354,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,  -354,  1353,  -354,  -354,  -354,   124,   119,
    -354,  -354,  -354,  1760,  -354,    53,  -354,   975,  1111,   188,
    -354,   124,   119,  1760,  1760,  -354,  -354,  1760,   144,  -354,
     148,  -354,  -354,   160,  -354,  -354,   161,  -354,   159,  -354,
    -354,  -354,  -354,  -354,    -9,   155,  -354,  -354,  -354,   147,
    -354,    -9,   166,  -354,   183,  -354,  -354,  -354,  -354,  -354,
     230,   230,  -354,  -354,   230,   230,  -354,   230,  -354,   230,
    -354,  -354,   235,  -354,   147,  -354,  -354,  1760,  -354,  1760,
     136,  -354,  -354,  -354,  -354,   -35,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,  -354,  -354,  -354,   194,  -354,  -354,  -354,
    -354,  -354,  -354,  -354,   143,  -354,  -354,  -354,  -354,  -354,
    -354,  -354,   159,  -354,  -354,  -354,  -354,  1818,  -354,    63,
    -354,   106,  -354,  -354,  -354,   209,     1,  -354,   189,  -354,
    -354,  -354,  -354,  -354,   196,  -354,  -354,  -354,  -354,  -354,
    -354,  -354,   134,  -354,  -354,  -354,  -354,   192,  -354,   151,
    1493,  -354,  1493,  -354,  -354,    -9,    -9,    -9,   413,  -354,
    -354,  -354,  -354,  -354,   326,  -354,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,  -354,  -354,  -354,   203,  -354,  -354,  -354,
     -20,    40,   195,   210,   195,  -354,   354,   143,   130,  1353,
    -354,  -354,  -354,   328,   180,  -354,  1907,  -354,  -354,  -354,
     352,   136,   136,  -354,  -354,  -354,  -354,  -354,  1907,  -354,
    -354,  -354,  1907,   136,   136,   -27,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,  -354,  -354,  -354,  -354,   159,  -354,  -354,
    -354,  -354,  -354,   -27,   -27,   -27,   -27,  -354,   276,  -354,
       1,  -354,  -354,  1760,  1630,  -354,  -354,  -354,  -354,    -9,
    -354,  -354,  1353,  -354,   202,  -354,  -354,   354,   201,  -354,
    -354,  -354,  -354,  -354,  -354,  -354,  -354,  -354,  -354,  -354,
     162,  -354,   169,  -354,  -354,  -354,   213,  -354,  -354,   213,
    -354,  -354,   -94,    91,  -354,  1907,  -354,   352,   136,   180,
    -354,  1907,   136,  -354,  -354,  -354,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,    -9,  -354,    40,  -354,    40,  -354,    40,
     208,  -354,  -354,   218,  -354,  -354,   349,  -354,   120,  -354,
    -354,  -354,   354,   169,  -354,  -354,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,  -354,  -354,   335,    16,  -354,   230,  -354,
     352,   -94,  -354,  1907,  -354,    -9,    -9,  -354,   354,  -354,
    -354,  -354,  -354,  1247,  -354,  -354,  -354,  -354,   211,  -354,
      -4,   124,   119,   318,  -354,  -354,  -354,    78,  -354,  -354,
    -354,   143,  -354,  -354,  -354,  -354,  1907,    -9,   223,  -354,
    -354,    -9,  -354
};

/* YYPGOTO[NTERM-NUM].  */
static const short int yypgoto[] =
{
    -354,  -354,   205,  -354,  -354,    -1,  -354,    18,  -354,    -5,
    -354,   225,  -354,   226,  -354,   -76,   -52,  -354,    34,  -354,
    -354,   322,   -71,   -15,  -354,  -354,  -354,  -354,  -354,   -54,
    -354,  -354,    61,   -60,   -31,  -354,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,  -354,  -354,  -354,  -354,  -354,  -127,   107,
     273,     7,     0,  -321,  -354,  -354,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,  -353,  -354,  -354,  -354,  -354,  -253,  -354,
    -145,  -354,  -354,    79,  -354,  -136,   -93,   -92,   377,  -118,
      41,   300,  -354,  -354,  -354,  -354,   286,  -223,   290,    30,
     283,   171,  -354,  -354,  -354,   -48,  -354,  -354,  -354,  -354,
    -354,  -354,  -354,  -354,  -354,  -116,  -354,  -354,  -146,  -354,
    -158,  -200,  -107,   -90,    23,   -58,  -354,  -354,     3,  -354,
      43,  -156,  -354,  -161,  -354,  -150,  -134,   -66,  -354,   -99
};

/* 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, syntax error.  */
#define YYTABLE_NINF -177
static const short int yytable[] =
{
      53,   203,   165,   230,    75,   211,   212,   303,    83,   162,
     398,    78,   146,   147,   148,   149,   150,   255,    85,    54,
     195,   338,   207,   208,    91,   130,   142,   380,   381,   171,
     103,   382,   383,   349,   385,    59,   387,   476,    79,   104,
     105,   106,   107,   339,   350,   340,   163,    19,   526,   214,
      26,   219,    27,   248,   355,   453,   157,   249,   250,    84,
      53,   562,    65,   167,   223,    80,   527,   251,    32,    31,
     101,   252,   253,    92,    87,   200,   299,   206,    13,    32,
      95,    15,   210,    98,    88,    93,   407,    20,    96,    94,
     324,   216,   217,   328,    22,    76,    77,   154,    87,    81,
      82,   225,   254,   226,   319,   315,   323,    98,   215,   227,
     405,   155,    48,   235,   152,   235,   235,   268,   269,   270,
     235,   355,   447,    48,   529,    34,   511,   265,   351,   170,
      13,   266,   267,    15,   563,   475,   160,   301,    19,    20,
      80,    50,   324,   101,   239,    13,    22,   239,    15,   118,
     273,   295,   232,    25,    20,   313,   333,   324,   336,   302,
     245,    22,   220,    19,   273,   153,    32,   335,   196,   197,
     332,    53,   331,   322,    81,    82,   256,   554,   349,   343,
     344,   345,   346,   347,    32,    32,   300,   327,   354,   350,
     350,   544,   441,   163,   356,    19,    33,    33,   363,   364,
     423,   424,   365,   330,   408,   407,   273,   273,   340,   402,
      48,   455,   403,   456,   442,   404,    34,   559,   168,   457,
     567,   458,   241,   242,    32,   485,   486,   246,    48,    48,
      49,    49,   201,   370,   202,   218,    80,   156,   334,   401,
     375,    34,   514,   436,   209,   456,   325,   515,    87,   443,
     315,   457,   399,   458,   400,   178,   429,   480,   181,   317,
     183,   542,   425,   426,   459,   483,   484,   314,    48,   230,
      81,    82,   353,    34,   435,    83,   352,   460,   433,   362,
     367,   349,   487,   452,   488,   223,   366,   454,   368,   369,
     489,   188,   350,   490,   491,   492,   459,   166,   371,   201,
     493,   202,   566,   373,   427,   553,   516,   517,   376,   451,
     422,   494,   402,   195,   417,   403,   495,   518,   404,   201,
     496,   202,   225,   497,   226,   377,   519,   236,   520,   431,
     432,   388,   434,   498,   499,   444,   532,   446,   450,   471,
     230,   221,   510,   512,   437,   438,   439,   389,   523,    98,
     538,   524,   539,   390,   561,   487,   391,   488,    19,   392,
     477,   478,    87,   489,   564,   571,   490,   491,   492,   448,
     505,   449,   481,   482,   326,   227,   435,   297,   298,   541,
     393,   464,   508,   159,   494,   233,   418,    19,   556,   495,
     466,   467,   468,   496,   469,   555,   497,   466,   467,   468,
      89,   469,   213,   243,   247,   230,   498,   499,   244,   546,
     500,   374,   513,    32,   222,   569,   223,   501,   507,   206,
     479,   531,   465,     0,   201,   224,   202,     0,     0,   545,
       0,   230,     0,   551,   552,   550,    34,     0,   509,   543,
       0,     0,    32,   222,     0,   223,   227,   530,   388,     0,
       0,   533,     0,   225,   224,   226,     0,    48,     0,    76,
      77,   174,     0,   464,   389,    34,   112,   113,     0,     0,
     390,   550,     0,   391,   115,     0,   392,   116,     0,    87,
       0,     0,   225,   500,   226,   120,    48,     0,    76,    77,
     540,     0,   534,     0,     0,   535,     0,   536,     0,   537,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   227,     0,     0,   175,   176,   177,   178,   179,   180,
     181,   182,   183,   184,   185,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   557,   558,     0,   227,     0,     0,
       0,     0,   273,     0,     0,     0,     0,   186,   187,     0,
       0,     0,     0,   188,   440,     0,   568,     0,     0,     0,
       0,     0,     5,   108,     6,     7,   570,   275,     0,     0,
     572,     0,     9,    10,    11,    12,     0,     0,     0,   109,
      15,    16,    17,    18,   110,    19,    20,     0,    21,     0,
     111,   112,   113,    22,   114,    23,     0,    24,     0,   115,
      25,    26,   116,    27,   117,   118,    28,    29,   119,     0,
     120,     0,   121,    30,     0,     0,     0,     0,     0,     0,
      31,   122,   276,     0,   277,   278,   123,   279,   124,   280,
       0,   125,   281,     0,     0,     0,   282,     0,     0,     0,
      32,   283,   284,   223,     0,     0,     0,     0,     0,     0,
     285,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    34,    35,    36,    37,     0,    38,    39,
      40,    41,    42,    43,    44,    45,    46,    47,   126,     0,
     225,     0,   226,     0,    48,     0,    76,    77,     0,   286,
       0,     0,    50,     0,     0,     0,   127,     0,   128,   287,
     288,   289,   290,   291,   271,     0,   292,   293,     0,     0,
     294,     0,     0,     0,   108,     6,     7,     0,     8,     0,
       0,     0,     0,     9,    10,    11,    12,     0,     0,     0,
     109,     0,    16,    17,    18,   110,     0,     0,     0,    21,
       0,   111,   112,   113,     0,   114,    23,     0,    24,     0,
     115,     0,    26,   116,    27,   117,   118,    28,    29,   119,
       0,   120,     0,   121,    30,     0,     0,     0,     0,     0,
       0,    31,   122,     0,     0,     0,     0,   123,     0,   124,
       0,     0,   125,     0,     0,  -176,     0,     0,     0,  -176,
    -176,    32,     0,     0,     0,     0,     0,     0,     0,  -176,
       0,     0,     0,  -176,  -176,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,    35,    36,    37,     0,    38,
      39,    40,    41,    42,    43,    44,    45,    46,    47,   126,
    -176,     0,     0,     0,  -176,    48,     0,     0,     0,  -176,
     271,     0,     0,    50,   272,     0,     0,   127,     0,   128,
     108,     6,     7,     0,     8,     0,     0,     0,     0,     9,
      10,    11,    12,     0,     0,     0,   109,     0,    16,    17,
      18,   110,     0,     0,     0,    21,     0,   111,   112,   113,
       0,   114,    23,     0,    24,     0,   115,     0,    26,   116,
      27,   117,   118,    28,    29,   119,     0,   120,     0,   121,
      30,     0,     0,     0,     0,     0,   320,    31,   122,     0,
       0,     0,     0,   123,     0,   124,     0,     0,   125,     0,
       0,  -176,     0,     0,     0,  -176,  -176,    32,     0,     0,
       0,     0,     0,     0,     0,  -176,     0,     0,     0,  -176,
    -176,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,    35,    36,    37,     0,    38,    39,    40,    41,    42,
      43,    44,    45,    46,    47,   126,  -176,     0,     0,     0,
    -176,    48,     0,     0,     0,  -176,   271,     0,     0,    50,
       0,     0,     0,   127,     0,   128,   108,     6,     7,     0,
       8,     0,     0,     0,     0,     9,    10,    11,    12,     0,
       0,     0,   109,     0,    16,    17,    18,   110,     0,     0,
       0,    21,     0,   111,   112,   113,     0,   114,    23,     0,
      24,     0,   115,     0,    26,   116,    27,   117,   118,    28,
      29,   119,     0,   120,     0,   121,    30,     0,     0,     0,
       0,     0,     0,    31,   122,     0,     0,     0,     0,   123,
       0,   124,     0,     0,   125,     0,     0,  -176,     0,     0,
       0,  -176,  -176,    32,     0,     0,     0,     0,     0,     0,
       0,  -176,     0,     0,     0,  -176,  -176,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,    35,    36,    37,
       0,    38,    39,    40,    41,    42,    43,    44,    45,    46,
      47,   126,  -176,     0,     0,     0,  -176,    48,     0,     0,
       0,  -176,   271,     0,     0,    50,   360,     0,     0,   127,
       0,   128,   108,     6,     7,     0,     8,     0,     0,     0,
       0,     9,    10,    11,    12,     0,     0,     0,   109,     0,
      16,    17,    18,   110,     0,     0,     0,    21,     0,   111,
     112,   113,     0,   114,    23,     0,    24,     0,   115,     0,
      26,   116,    27,   117,   118,    28,    29,   119,     0,   120,
       0,   121,    30,     0,     0,     0,     0,     0,     0,    31,
     122,     0,     0,     0,     0,   123,     0,   124,     0,     0,
     125,     0,     0,  -176,     0,     0,     0,  -176,  -176,    32,
       0,     0,     0,     0,     0,     0,     0,  -176,     0,     0,
       0,  -176,  -176,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    35,    36,    37,     0,    38,    39,    40,
      41,    42,    43,    44,    45,    46,    47,   126,  -176,     0,
       0,     0,  -176,    48,     0,     0,     0,  -176,   271,     0,
       0,    50,   361,     0,     0,   127,     0,   128,   108,     6,
       7,     0,     8,     0,     0,     0,     0,     9,    10,    11,
      12,     0,     0,     0,   109,     0,    16,    17,    18,   110,
       0,     0,     0,    21,     0,   111,   112,   113,     0,   114,
      23,     0,    24,     0,   115,     0,    26,   116,    27,   117,
     118,    28,    29,   119,     0,   120,     0,   121,    30,     0,
       0,     0,     0,     0,     0,    31,   122,     0,     0,     0,
       0,   123,     0,   124,     0,     0,   125,     0,     0,  -176,
       0,     0,     0,  -176,  -176,    32,     0,     0,     0,     0,
       0,     0,     0,  -176,     0,     0,     0,  -176,  -176,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    35,
      36,    37,     0,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,   126,  -176,     0,     0,     0,  -176,    48,
       0,     0,     0,  -176,     0,     2,     3,    50,   560,     0,
       0,   127,     4,   128,     0,     5,     0,     6,     7,     0,
       8,   174,     0,     0,     0,     9,    10,    11,    12,     0,
      13,    14,     0,    15,    16,    17,    18,     0,    19,    20,
       0,    21,     0,     0,     0,     0,    22,     0,    23,     0,
      24,     0,     0,    25,    26,     0,    27,     0,     0,    28,
      29,     0,     0,     0,     0,     0,    30,     0,     0,     0,
       0,     0,     0,    31,   175,   176,   177,   178,   179,   180,
     181,   182,   183,   184,   185,     0,     0,     0,     0,     0,
       0,     0,     0,    32,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,    33,     0,   186,   187,     0,
       0,     0,     0,   188,     0,     0,    34,    35,    36,    37,
       0,    38,    39,    40,    41,    42,    43,    44,    45,    46,
      47,   108,     6,     7,     0,     8,     0,    48,     0,    49,
       9,    10,    11,    12,     0,    50,     0,   109,     0,    16,
      17,    18,   110,     0,     0,     0,    21,     0,   111,   112,
     113,   174,   114,    23,     0,    24,     0,   115,     0,    26,
     116,    27,   117,   118,    28,    29,   119,     0,   120,     0,
     121,    30,     0,     0,     0,     0,     0,     0,    31,   122,
       0,     0,     0,     0,   123,     0,   124,     0,     0,   125,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   175,   176,   177,   178,   179,   180,
     181,   182,   183,   184,   185,     0,     0,     0,     0,     0,
       0,     0,    35,    36,    37,     0,    38,    39,    40,    41,
      42,    43,    44,    45,    46,    47,   126,   186,   187,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   166,     0,
      50,   108,     6,     7,   127,     8,   128,     0,     0,     0,
       9,    10,    11,    12,     0,     0,     0,   109,     0,    16,
      17,    18,   110,     0,     0,     0,    21,     0,   111,   112,
     113,     0,   114,    23,     0,    24,     0,   115,     0,    26,
     116,    27,   117,   118,    28,    29,   119,     0,   120,     0,
     121,    30,     0,     0,     0,     0,     0,     0,    31,   122,
       0,     0,     0,     0,   123,     0,   124,     0,     0,   125,
       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,     0,     0,     0,     0,
       0,     0,    35,    36,    37,     0,    38,    39,    40,    41,
      42,    43,    44,    45,    46,    47,   126,     0,     0,     0,
       0,     0,     0,   204,     0,     0,     0,     0,     0,     0,
      50,   108,     6,     7,   127,     8,   128,     0,     0,     0,
       9,    10,    11,    12,     0,     0,     0,   109,     0,    16,
      17,    18,   110,     0,     0,     0,    21,     0,   111,   112,
     113,     0,   114,    23,     0,    24,     0,   115,     0,    26,
     116,    27,   117,   118,    28,    29,   119,     0,   120,     0,
     121,    30,     0,     0,     0,     0,     0,     0,    31,   122,
       0,     0,     0,     0,   123,     0,   124,     0,     0,   125,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,    19,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    35,    36,    37,     0,    38,    39,    40,    41,
      42,    43,    44,    45,    46,    47,   126,     0,   276,     0,
     277,   278,     0,   279,     0,   280,     0,     0,     0,     0,
      50,     0,     6,     7,   127,     8,   128,   409,     0,     0,
       9,    10,    11,    12,     0,     0,   285,     0,     0,    16,
      17,    18,     0,     0,     0,     0,    21,     0,     0,    34,
       0,     0,     0,    23,     0,    24,     0,     0,     0,    26,
       0,    27,     0,     0,    28,    29,     0,     0,     0,     0,
       0,    30,    76,    77,     0,   410,   411,     0,    31,     0,
       0,   412,     0,   413,   414,   287,   288,   289,   290,   291,
       0,     0,   415,   416,     0,     0,   294,   276,     0,   277,
     278,     0,   279,     0,   280,     0,     0,   281,     0,     0,
       0,   282,     0,     0,     0,     0,     0,   284,     0,     0,
       0,     0,    35,    36,    37,   285,    38,    39,    40,    41,
      42,    43,    44,    45,    46,    47,     0,    87,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      50,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   473,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   287,   288,   289,   290,   291,     0,
       0,   292,   293,     0,     0,   294
};

static const short int yycheck[] =
{
       1,    91,    73,   110,     1,    98,    98,   152,     8,    69,
     263,     4,    43,    44,    45,    46,    47,   135,    18,     1,
      86,   177,    93,    94,    24,    40,    41,   250,   251,    83,
      30,   254,   255,   194,   257,     1,   259,   390,   140,    36,
      37,    38,    39,   177,   194,   179,    59,    33,   142,   103,
      49,    16,    51,    82,     1,   376,    61,    86,    87,   140,
      61,    65,     1,    78,    91,   100,   160,    96,    88,    68,
      29,   100,   101,   140,   127,    90,   152,    92,    25,    88,
      91,    28,    97,   136,    23,   140,   286,    34,    99,   140,
      37,   106,   107,   169,    41,   134,   135,     1,   127,   134,
     135,   128,   131,   130,   164,   140,     1,   136,   105,   110,
     137,    15,   132,   113,   142,   115,   116,   148,   149,   150,
     120,     1,   142,   132,   477,   111,   447,   142,   194,   142,
      25,   146,   147,    28,   138,   388,     4,   152,    33,    34,
     100,   140,    37,   102,   114,    25,    41,   117,    28,    53,
     151,   152,   111,    48,    34,   152,   171,    37,   173,   152,
     119,    41,   127,    33,   165,   140,    88,   172,   152,   153,
     170,   172,   169,   166,   134,   135,   135,   530,   339,   180,
     181,   182,   183,   184,    88,    88,   152,   169,   203,   339,
     340,   512,   348,    59,   141,    33,   100,   100,   213,   214,
     137,   138,   217,   169,   294,   405,   207,   208,   342,   118,
     132,    81,   121,    83,   348,   124,   111,   538,    92,    89,
     142,    91,   115,   116,    88,   425,   426,   120,   132,   132,
     134,   134,    89,   234,    91,   134,   100,   141,   141,   270,
     241,   111,    73,   342,   157,    83,   141,    78,   127,   348,
     140,    89,   267,    91,   269,   104,   316,   402,   107,     4,
     109,   141,   156,   157,   134,   423,   424,   129,   132,   376,
     134,   135,   153,   111,   340,   275,   152,   147,   332,    91,
     132,   442,     6,   373,     8,    91,   142,   377,   128,   128,
      14,   140,   442,    17,    18,    19,   134,   138,   143,    89,
      24,    91,   555,   156,    95,   528,   137,   138,   142,    99,
     307,    35,   118,   379,   307,   121,    40,   148,   124,    89,
      44,    91,   128,    47,   130,   142,   157,    97,   159,   140,
     134,    96,   140,    57,    58,     9,   481,   134,   143,   159,
     447,    16,   140,   142,   345,   346,   347,   112,   466,   136,
     142,   469,   134,   118,   143,     6,   121,     8,    33,   124,
     391,   392,   127,    14,    46,   142,    17,    18,    19,   370,
     430,   371,   403,   404,   169,   376,   442,   152,   152,   506,
     145,   378,   434,    61,    35,   112,   307,    33,   533,    40,
      62,    63,    64,    44,    66,   531,    47,    62,    63,    64,
      23,    66,   102,   117,   121,   512,    57,    58,   118,   525,
     134,   240,   460,    88,    89,   561,    91,   141,   433,   434,
     397,   479,   379,    -1,    89,   100,    91,    -1,    -1,    94,
      -1,   538,    -1,   526,   526,   525,   111,    -1,   439,   510,
      -1,    -1,    88,    89,    -1,    91,   447,   478,    96,    -1,
      -1,   482,    -1,   128,   100,   130,    -1,   132,    -1,   134,
     135,    48,    -1,   460,   112,   111,    39,    40,    -1,    -1,
     118,   561,    -1,   121,    47,    -1,   124,    50,    -1,   127,
      -1,    -1,   128,   134,   130,    58,   132,    -1,   134,   135,
     141,    -1,   493,    -1,    -1,   495,    -1,   497,    -1,   499,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   512,    -1,    -1,   101,   102,   103,   104,   105,   106,
     107,   108,   109,   110,   111,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   535,   536,    -1,   538,    -1,    -1,
      -1,    -1,   543,    -1,    -1,    -1,    -1,   134,   135,    -1,
      -1,    -1,    -1,   140,   141,    -1,   557,    -1,    -1,    -1,
      -1,    -1,    10,    11,    12,    13,   567,    15,    -1,    -1,
     571,    -1,    20,    21,    22,    23,    -1,    -1,    -1,    27,
      28,    29,    30,    31,    32,    33,    34,    -1,    36,    -1,
      38,    39,    40,    41,    42,    43,    -1,    45,    -1,    47,
      48,    49,    50,    51,    52,    53,    54,    55,    56,    -1,
      58,    -1,    60,    61,    -1,    -1,    -1,    -1,    -1,    -1,
      68,    69,    70,    -1,    72,    73,    74,    75,    76,    77,
      -1,    79,    80,    -1,    -1,    -1,    84,    -1,    -1,    -1,
      88,    89,    90,    91,    -1,    -1,    -1,    -1,    -1,    -1,
      98,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   111,   112,   113,   114,    -1,   116,   117,
     118,   119,   120,   121,   122,   123,   124,   125,   126,    -1,
     128,    -1,   130,    -1,   132,    -1,   134,   135,    -1,   137,
      -1,    -1,   140,    -1,    -1,    -1,   144,    -1,   146,   147,
     148,   149,   150,   151,     1,    -1,   154,   155,    -1,    -1,
     158,    -1,    -1,    -1,    11,    12,    13,    -1,    15,    -1,
      -1,    -1,    -1,    20,    21,    22,    23,    -1,    -1,    -1,
      27,    -1,    29,    30,    31,    32,    -1,    -1,    -1,    36,
      -1,    38,    39,    40,    -1,    42,    43,    -1,    45,    -1,
      47,    -1,    49,    50,    51,    52,    53,    54,    55,    56,
      -1,    58,    -1,    60,    61,    -1,    -1,    -1,    -1,    -1,
      -1,    68,    69,    -1,    -1,    -1,    -1,    74,    -1,    76,
      -1,    -1,    79,    -1,    -1,    82,    -1,    -1,    -1,    86,
      87,    88,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    96,
      -1,    -1,    -1,   100,   101,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   112,   113,   114,    -1,   116,
     117,   118,   119,   120,   121,   122,   123,   124,   125,   126,
     127,    -1,    -1,    -1,   131,   132,    -1,    -1,    -1,   136,
       1,    -1,    -1,   140,   141,    -1,    -1,   144,    -1,   146,
      11,    12,    13,    -1,    15,    -1,    -1,    -1,    -1,    20,
      21,    22,    23,    -1,    -1,    -1,    27,    -1,    29,    30,
      31,    32,    -1,    -1,    -1,    36,    -1,    38,    39,    40,
      -1,    42,    43,    -1,    45,    -1,    47,    -1,    49,    50,
      51,    52,    53,    54,    55,    56,    -1,    58,    -1,    60,
      61,    -1,    -1,    -1,    -1,    -1,    67,    68,    69,    -1,
      -1,    -1,    -1,    74,    -1,    76,    -1,    -1,    79,    -1,
      -1,    82,    -1,    -1,    -1,    86,    87,    88,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    96,    -1,    -1,    -1,   100,
     101,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   112,   113,   114,    -1,   116,   117,   118,   119,   120,
     121,   122,   123,   124,   125,   126,   127,    -1,    -1,    -1,
     131,   132,    -1,    -1,    -1,   136,     1,    -1,    -1,   140,
      -1,    -1,    -1,   144,    -1,   146,    11,    12,    13,    -1,
      15,    -1,    -1,    -1,    -1,    20,    21,    22,    23,    -1,
      -1,    -1,    27,    -1,    29,    30,    31,    32,    -1,    -1,
      -1,    36,    -1,    38,    39,    40,    -1,    42,    43,    -1,
      45,    -1,    47,    -1,    49,    50,    51,    52,    53,    54,
      55,    56,    -1,    58,    -1,    60,    61,    -1,    -1,    -1,
      -1,    -1,    -1,    68,    69,    -1,    -1,    -1,    -1,    74,
      -1,    76,    -1,    -1,    79,    -1,    -1,    82,    -1,    -1,
      -1,    86,    87,    88,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    96,    -1,    -1,    -1,   100,   101,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,   112,   113,   114,
      -1,   116,   117,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,    -1,    -1,    -1,   131,   132,    -1,    -1,
      -1,   136,     1,    -1,    -1,   140,   141,    -1,    -1,   144,
      -1,   146,    11,    12,    13,    -1,    15,    -1,    -1,    -1,
      -1,    20,    21,    22,    23,    -1,    -1,    -1,    27,    -1,
      29,    30,    31,    32,    -1,    -1,    -1,    36,    -1,    38,
      39,    40,    -1,    42,    43,    -1,    45,    -1,    47,    -1,
      49,    50,    51,    52,    53,    54,    55,    56,    -1,    58,
      -1,    60,    61,    -1,    -1,    -1,    -1,    -1,    -1,    68,
      69,    -1,    -1,    -1,    -1,    74,    -1,    76,    -1,    -1,
      79,    -1,    -1,    82,    -1,    -1,    -1,    86,    87,    88,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    96,    -1,    -1,
      -1,   100,   101,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   112,   113,   114,    -1,   116,   117,   118,
     119,   120,   121,   122,   123,   124,   125,   126,   127,    -1,
      -1,    -1,   131,   132,    -1,    -1,    -1,   136,     1,    -1,
      -1,   140,   141,    -1,    -1,   144,    -1,   146,    11,    12,
      13,    -1,    15,    -1,    -1,    -1,    -1,    20,    21,    22,
      23,    -1,    -1,    -1,    27,    -1,    29,    30,    31,    32,
      -1,    -1,    -1,    36,    -1,    38,    39,    40,    -1,    42,
      43,    -1,    45,    -1,    47,    -1,    49,    50,    51,    52,
      53,    54,    55,    56,    -1,    58,    -1,    60,    61,    -1,
      -1,    -1,    -1,    -1,    -1,    68,    69,    -1,    -1,    -1,
      -1,    74,    -1,    76,    -1,    -1,    79,    -1,    -1,    82,
      -1,    -1,    -1,    86,    87,    88,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    96,    -1,    -1,    -1,   100,   101,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   112,
     113,   114,    -1,   116,   117,   118,   119,   120,   121,   122,
     123,   124,   125,   126,   127,    -1,    -1,    -1,   131,   132,
      -1,    -1,    -1,   136,    -1,     0,     1,   140,   141,    -1,
      -1,   144,     7,   146,    -1,    10,    -1,    12,    13,    -1,
      15,    48,    -1,    -1,    -1,    20,    21,    22,    23,    -1,
      25,    26,    -1,    28,    29,    30,    31,    -1,    33,    34,
      -1,    36,    -1,    -1,    -1,    -1,    41,    -1,    43,    -1,
      45,    -1,    -1,    48,    49,    -1,    51,    -1,    -1,    54,
      55,    -1,    -1,    -1,    -1,    -1,    61,    -1,    -1,    -1,
      -1,    -1,    -1,    68,   101,   102,   103,   104,   105,   106,
     107,   108,   109,   110,   111,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    88,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   100,    -1,   134,   135,    -1,
      -1,    -1,    -1,   140,    -1,    -1,   111,   112,   113,   114,
      -1,   116,   117,   118,   119,   120,   121,   122,   123,   124,
     125,    11,    12,    13,    -1,    15,    -1,   132,    -1,   134,
      20,    21,    22,    23,    -1,   140,    -1,    27,    -1,    29,
      30,    31,    32,    -1,    -1,    -1,    36,    -1,    38,    39,
      40,    48,    42,    43,    -1,    45,    -1,    47,    -1,    49,
      50,    51,    52,    53,    54,    55,    56,    -1,    58,    -1,
      60,    61,    -1,    -1,    -1,    -1,    -1,    -1,    68,    69,
      -1,    -1,    -1,    -1,    74,    -1,    76,    -1,    -1,    79,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   101,   102,   103,   104,   105,   106,
     107,   108,   109,   110,   111,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,   112,   113,   114,    -1,   116,   117,   118,   119,
     120,   121,   122,   123,   124,   125,   126,   134,   135,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   138,    -1,
     140,    11,    12,    13,   144,    15,   146,    -1,    -1,    -1,
      20,    21,    22,    23,    -1,    -1,    -1,    27,    -1,    29,
      30,    31,    32,    -1,    -1,    -1,    36,    -1,    38,    39,
      40,    -1,    42,    43,    -1,    45,    -1,    47,    -1,    49,
      50,    51,    52,    53,    54,    55,    56,    -1,    58,    -1,
      60,    61,    -1,    -1,    -1,    -1,    -1,    -1,    68,    69,
      -1,    -1,    -1,    -1,    74,    -1,    76,    -1,    -1,    79,
      -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,
      -1,    -1,   112,   113,   114,    -1,   116,   117,   118,   119,
     120,   121,   122,   123,   124,   125,   126,    -1,    -1,    -1,
      -1,    -1,    -1,   133,    -1,    -1,    -1,    -1,    -1,    -1,
     140,    11,    12,    13,   144,    15,   146,    -1,    -1,    -1,
      20,    21,    22,    23,    -1,    -1,    -1,    27,    -1,    29,
      30,    31,    32,    -1,    -1,    -1,    36,    -1,    38,    39,
      40,    -1,    42,    43,    -1,    45,    -1,    47,    -1,    49,
      50,    51,    52,    53,    54,    55,    56,    -1,    58,    -1,
      60,    61,    -1,    -1,    -1,    -1,    -1,    -1,    68,    69,
      -1,    -1,    -1,    -1,    74,    -1,    76,    -1,    -1,    79,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    33,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,   112,   113,   114,    -1,   116,   117,   118,   119,
     120,   121,   122,   123,   124,   125,   126,    -1,    70,    -1,
      72,    73,    -1,    75,    -1,    77,    -1,    -1,    -1,    -1,
     140,    -1,    12,    13,   144,    15,   146,    89,    -1,    -1,
      20,    21,    22,    23,    -1,    -1,    98,    -1,    -1,    29,
      30,    31,    -1,    -1,    -1,    -1,    36,    -1,    -1,   111,
      -1,    -1,    -1,    43,    -1,    45,    -1,    -1,    -1,    49,
      -1,    51,    -1,    -1,    54,    55,    -1,    -1,    -1,    -1,
      -1,    61,   134,   135,    -1,   137,   138,    -1,    68,    -1,
      -1,   143,    -1,   145,   146,   147,   148,   149,   150,   151,
      -1,    -1,   154,   155,    -1,    -1,   158,    70,    -1,    72,
      73,    -1,    75,    -1,    77,    -1,    -1,    80,    -1,    -1,
      -1,    84,    -1,    -1,    -1,    -1,    -1,    90,    -1,    -1,
      -1,    -1,   112,   113,   114,    98,   116,   117,   118,   119,
     120,   121,   122,   123,   124,   125,    -1,   127,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
     140,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   137,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   147,   148,   149,   150,   151,    -1,
      -1,   154,   155,    -1,    -1,   158
};

/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
   symbol of state STATE-NUM.  */
static const unsigned short int yystos[] =
{
       0,   162,     0,     1,     7,    10,    12,    13,    15,    20,
      21,    22,    23,    25,    26,    28,    29,    30,    31,    33,
      34,    36,    41,    43,    45,    48,    49,    51,    54,    55,
      61,    68,    88,   100,   111,   112,   113,   114,   116,   117,
     118,   119,   120,   121,   122,   123,   124,   125,   132,   134,
     140,   164,   165,   166,   168,   169,   170,   174,   176,   179,
     180,   181,   186,   187,   188,   193,   194,   196,   197,   198,
     199,   200,   204,   220,   226,   279,   134,   135,   212,   140,
     100,   134,   135,   213,   140,   213,   280,   127,   193,   239,
     246,   213,   140,   140,   140,    91,    99,   251,   136,   239,
     240,   241,   242,   213,   279,   279,   279,   279,    11,    27,
      32,    38,    39,    40,    42,    47,    50,    52,    53,    56,
      58,    60,    69,    74,    76,    79,   126,   144,   146,   182,
     184,   189,   193,   206,   211,   215,   216,   217,   218,   222,
     227,   228,   184,   166,   195,   213,   195,   195,   195,   195,
     195,   183,   142,   140,     1,    15,   141,   170,   172,   182,
       4,   201,   194,    59,   190,   183,   138,   184,    92,   175,
     142,   190,   167,   205,    48,   101,   102,   103,   104,   105,
     106,   107,   108,   109,   110,   111,   134,   135,   140,   281,
     282,   283,   284,   286,   287,   288,   152,   153,   237,   238,
     184,    89,    91,   274,   133,   177,   184,   183,   183,   157,
     184,   237,   238,   242,   190,   279,   184,   184,   134,    16,
     127,    16,    89,    91,   100,   128,   130,   166,   212,   214,
     273,   279,   241,   211,   210,   213,    97,   247,   249,   250,
     274,   210,   210,   247,   249,   241,   210,   251,    82,    86,
      87,    96,   100,   101,   131,   240,   241,   260,   262,   263,
     264,   277,   223,   248,   250,   184,   184,   184,   195,   195,
     195,     1,   141,   166,   184,    15,    70,    72,    73,    75,
      77,    80,    84,    89,    90,    98,   137,   147,   148,   149,
     150,   151,   154,   155,   158,   166,   171,   172,   174,   176,
     179,   184,   212,   231,   232,   233,   234,   245,   253,   270,
     271,   272,   273,   279,   129,   140,   202,     4,   191,   194,
      67,   221,   212,     1,    37,   141,   163,   168,   176,   178,
     179,   279,   213,   184,   141,   170,   184,   289,   282,   287,
     287,   288,   290,   166,   166,   166,   166,   166,   285,   284,
     286,   288,   152,   153,   184,     1,   141,   163,   168,   179,
     141,   141,    91,   184,   184,   184,   142,   132,   128,   128,
     166,   143,   252,   156,   252,   166,   142,   142,   259,   278,
     248,   248,   248,   248,   275,   248,   229,   248,    96,   112,
     118,   121,   124,   145,   219,   224,   225,   241,   229,   184,
     184,   195,   118,   121,   124,   137,   230,   272,   274,    89,
     137,   138,   143,   145,   146,   154,   155,   212,   234,   235,
     243,   244,   279,   137,   138,   156,   157,    95,   173,   194,
     203,   140,   134,   190,   140,   288,   290,   166,   166,   166,
     141,   282,   287,   290,     9,   185,   134,   142,   166,   213,
     143,    99,   274,   214,   274,    81,    83,    89,    91,   134,
     147,   254,   256,   258,   279,   281,    62,    63,    64,    66,
     266,   159,   276,   137,   231,   229,   224,   195,   195,   275,
     231,   195,   195,   271,   271,   272,   272,     6,     8,    14,
      17,    18,    19,    24,    35,    40,    44,    47,    57,    58,
     134,   141,   207,   208,   209,   194,   192,   184,   177,   166,
     140,   214,   142,   256,    73,    78,   137,   138,   148,   157,
     159,   255,   257,   240,   240,   265,   142,   160,   236,   224,
     195,   276,   231,   195,   166,   213,   213,   213,   142,   134,
     141,   209,   141,   183,   214,    94,   266,   267,   268,   269,
     274,   237,   238,   248,   224,   236,   231,   166,   166,   214,
     141,   143,    65,   138,    46,   261,   229,   142,   166,   269,
     166,   142,   166
};

#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 <stddef.h> /* 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 yyerrorlab


/* 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);						\
      yytoken = YYTRANSLATE (yychar);				\
      YYPOPSTACK;						\
      goto yybackup;						\
    }								\
  else								\
    { 								\
      yyerror (_("syntax error: cannot back up")); \
      YYERROR;							\
    }								\
while (0)


#define YYTERROR	1
#define YYERRCODE	256


/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
   If N is 0, then set CURRENT to the empty location which ends
   the previous symbol: RHS[0] (always defined).  */

#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)				\
    do									\
      if (N)								\
	{								\
	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
	}								\
      else								\
	{								\
	  (Current).first_line   = (Current).last_line   =		\
	    YYRHSLOC (Rhs, 0).last_line;				\
	  (Current).first_column = (Current).last_column =		\
	    YYRHSLOC (Rhs, 0).last_column;				\
	}								\
    while (0)
#endif


/* YY_LOCATION_PRINT -- Print the location on the stream.
   This macro was not mandated originally: define only if we know
   we won't break user code: when these are the locations we know.  */

#ifndef YY_LOCATION_PRINT
# if YYLTYPE_IS_TRIVIAL
#  define YY_LOCATION_PRINT(File, Loc)			\
     fprintf (File, "%d.%d-%d.%d",			\
              (Loc).first_line, (Loc).first_column,	\
              (Loc).last_line,  (Loc).last_column)
# else
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif


/* YYLEX -- calling `yylex' with the right arguments.  */

#ifdef YYLEX_PARAM
# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
#else
# define YYLEX yylex (&yylval, &yylloc)
#endif

/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)			\
do {						\
  if (yydebug)					\
    YYFPRINTF Args;				\
} while (0)

# define YY_SYMBOL_PRINT(Title, Type, Value, Location)		\
do {								\
  if (yydebug)							\
    {								\
      YYFPRINTF (stderr, "%s ", Title);				\
      yysymprint (stderr, 					\
                  Type, Value, Location);	\
      YYFPRINTF (stderr, "\n");					\
    }								\
} while (0)

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

#if defined (__STDC__) || defined (__cplusplus)
static void
yy_stack_print (short int *bottom, short int *top)
#else
static void
yy_stack_print (bottom, top)
    short int *bottom;
    short int *top;
#endif
{
  YYFPRINTF (stderr, _("Stack now"));
  for (/* Nothing. */; bottom <= top; ++bottom)
    YYFPRINTF (stderr, " %d", *bottom);
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)				\
do {								\
  if (yydebug)							\
    yy_stack_print ((Bottom), (Top));				\
} while (0)


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

#if defined (__STDC__) || defined (__cplusplus)
static void
yy_reduce_print (int yyrule)
#else
static void
yy_reduce_print (yyrule)
    int yyrule;
#endif
{
  int yyi;
  unsigned int yylno = yyrline[yyrule];
  YYFPRINTF (stderr, _("Reducing stack by rule %d (line %u), "),
             yyrule - 1, yylno);
  /* Print the symbols being reduced, and their result.  */
  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
}

# define YY_REDUCE_PRINT(Rule)		\
do {					\
  if (yydebug)				\
    yy_reduce_print (Rule);		\
} 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 YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#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
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#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
{
  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
{
  char *yyd = yydest;
  const char *yys = yysrc;

  while ((*yyd++ = *yys++) != '\0')
    continue;

  return yyd - 1;
}
#  endif
# endif

#endif /* !YYERROR_VERBOSE */



#if YYDEBUG
/*--------------------------------.
| Print this symbol on YYOUTPUT.  |
`--------------------------------*/

#if defined (__STDC__) || defined (__cplusplus)
static void
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
#else
static void
yysymprint (yyoutput, yytype, yyvaluep, yylocationp)
    FILE *yyoutput;
    int yytype;
    YYSTYPE *yyvaluep;
    YYLTYPE *yylocationp;
#endif
{
  /* Pacify ``unused variable'' warnings.  */
  (void) yyvaluep;
  (void) yylocationp;

  if (yytype < YYNTOKENS)
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  else
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);

  YY_LOCATION_PRINT (yyoutput, *yylocationp);
  fprintf (yyoutput, ": ");

# ifdef YYPRINT
  if (yytype < YYNTOKENS)
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
  switch (yytype)
    {
      default:
        break;
    }
  YYFPRINTF (yyoutput, ")");
}

#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

#if defined (__STDC__) || defined (__cplusplus)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
#else
static void
yydestruct (yymsg, yytype, yyvaluep, yylocationp)
    const char *yymsg;
    int yytype;
    YYSTYPE *yyvaluep;
    YYLTYPE *yylocationp;
#endif
{
  /* Pacify ``unused variable'' warnings.  */
  (void) yyvaluep;
  (void) yylocationp;

  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);

  switch (yytype)
    {

      default:
        break;
    }
}


/* Prevent warnings from -Wmissing-prototypes.  */

#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM);
# else
int yyparse ();
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */






/*----------.
| yyparse.  |
`----------*/

#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM)
# else
int yyparse (YYPARSE_PARAM)
  void *YYPARSE_PARAM;
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int
yyparse (void)
#else
int
yyparse ()

#endif
#endif
{
  /* The look-ahead symbol.  */
int yychar;

/* The semantic value of the look-ahead symbol.  */
YYSTYPE yylval;

/* Number of syntax errors so far.  */
int yynerrs;
/* Location data for the look-ahead symbol.  */
YYLTYPE yylloc;

  int yystate;
  int yyn;
  int yyresult;
  /* Number of tokens to shift before error messages enabled.  */
  int yyerrstatus;
  /* Look-ahead token as an internal (translated) token number.  */
  int yytoken = 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 int yyssa[YYINITDEPTH];
  short int *yyss = yyssa;
  short int *yyssp;

  /* The semantic value stack.  */
  YYSTYPE yyvsa[YYINITDEPTH];
  YYSTYPE *yyvs = yyvsa;
  YYSTYPE *yyvsp;

  /* The location stack.  */
  YYLTYPE yylsa[YYINITDEPTH];
  YYLTYPE *yyls = yylsa;
  YYLTYPE *yylsp;
  /* The locations where the error started and ended. */
  YYLTYPE yyerror_range[2];

#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)

  YYSIZE_T yystacksize = YYINITDEPTH;

  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;
  YYLTYPE yyloc;

  /* 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;
  yylsp = yyls;
#if YYLTYPE_IS_TRIVIAL
  /* Initialize the default location before parsing starts.  */
  yylloc.first_line   = yylloc.last_line   = 1;
  yylloc.first_column = yylloc.last_column = 0;
#endif


  yyvsp[0] = yylval;
    yylsp[0] = yylloc;

  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 (yyss + yystacksize - 1 <= yyssp)
    {
      /* 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 int *yyss1 = yyss;
	YYLTYPE *yyls1 = yyls;

	/* 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),
		    &yyls1, yysize * sizeof (*yylsp),
		    &yystacksize);
	yyls = yyls1;
	yyss = yyss1;
	yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyoverflowlab;
# else
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
	goto yyoverflowlab;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
	yystacksize = YYMAXDEPTH;

      {
	short int *yyss1 = yyss;
	union yyalloc *yyptr =
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
	if (! yyptr)
	  goto yyoverflowlab;
	YYSTACK_RELOCATE (yyss);
	YYSTACK_RELOCATE (yyvs);
	YYSTACK_RELOCATE (yyls);
#  undef YYSTACK_RELOCATE
	if (yyss1 != yyssa)
	  YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
      yylsp = yyls + yysize - 1;

      YYDPRINTF ((stderr, _("Stack size increased to %lu\n"),
		  (unsigned long int) yystacksize));

      if (yyss + yystacksize - 1 <= yyssp)
	YYABORT;
    }

  YYDPRINTF ((stderr, _("Entering state %d\n"), yystate));

  goto yybackup;

/*-----------.
| yybackup.  |
`-----------*/
yybackup:

/* Do appropriate processing given the current state.  */
/* Read a look-ahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to look-ahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYPACT_NINF)
    goto yydefault;

  /* Not known => get a look-ahead token if don't already have one.  */

  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, _("Reading a token: ")));
      yychar = YYLEX;
    }

  if (yychar <= YYEOF)
    {
      yychar = yytoken = YYEOF;
      YYDPRINTF ((stderr, _("Now at end of input.\n")));
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT (_("Next token is"), yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    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 look-ahead token.  */
  YY_SYMBOL_PRINT (_("Shifting"), yytoken, &yylval, &yylloc);

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;
  *++yylsp = yylloc;

  /* 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];

  /* Default location. */
  YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);
  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
        case 3:
#line 431 "parser.yy"
    {
	;}
    break;

  case 4:
#line 433 "parser.yy"
    {
	;}
    break;

  case 5:
#line 435 "parser.yy"
    {
		THIS->error_level_ = 1;
	;}
    break;

  case 6:
#line 438 "parser.yy"
    {
		THIS->error_level_ = 1;
	;}
    break;

  case 7:
#line 445 "parser.yy"
    { (yyval.scm) = (yyvsp[0].scm); ;}
    break;

  case 8:
#line 449 "parser.yy"
    {
		THIS->lexer_->set_identifier (ly_symbol2scm ("$defaultheader"), (yyvsp[0].scm));
	;}
    break;

  case 9:
#line 452 "parser.yy"
    {
	
	;}
    break;

  case 10:
#line 455 "parser.yy"
    {
		Book *book = (yyvsp[0].book);
		SCM proc = THIS->lexer_->lookup_identifier ("toplevel-book-handler");
		scm_call_2 (proc, THIS->self_scm (), book->self_scm ());
		book->unprotect ();
	;}
    break;

  case 11:
#line 461 "parser.yy"
    {
		Score *score = (yyvsp[0].score);
		
		SCM proc = THIS->lexer_->lookup_identifier ("toplevel-score-handler");
		scm_call_2 (proc, THIS->self_scm (), score->self_scm ());
		score->unprotect ();
	;}
    break;

  case 12:
#line 468 "parser.yy"
    {
		Music *music = (yyvsp[0].music);
		SCM proc = THIS->lexer_->lookup_identifier ("toplevel-music-handler");
		scm_call_2 (proc, THIS->self_scm (), music->self_scm ());
		music->unprotect (); 
	;}
    break;

  case 13:
#line 474 "parser.yy"
    {
		SCM proc = THIS->lexer_->lookup_identifier ("toplevel-text-handler");
		scm_call_2 (proc, THIS->self_scm (), (yyvsp[0].scm));
	;}
    break;

  case 14:
#line 478 "parser.yy"
    {
		SCM id = SCM_EOL;
		Output_def * od = (yyvsp[0].outputdef);

		if ((yyvsp[0].outputdef)->c_variable ("is-paper") == SCM_BOOL_T)
			id = ly_symbol2scm ("$defaultpaper");
		else if ((yyvsp[0].outputdef)->c_variable ("is-midi") == SCM_BOOL_T)
			id = ly_symbol2scm ("$defaultmidi");
		else if ((yyvsp[0].outputdef)->c_variable ("is-layout") == SCM_BOOL_T)
			id = ly_symbol2scm ("$defaultlayout");

		THIS->lexer_->set_identifier (id, od->self_scm ());
		od->unprotect();
	;}
    break;

  case 15:
#line 495 "parser.yy"
    {
	;}
    break;

  case 18:
#line 506 "parser.yy"
    {
		(yyval.scm) = get_header(THIS);
		THIS->lexer_->add_scope ((yyval.scm));
	;}
    break;

  case 19:
#line 510 "parser.yy"
    {
		
	;}
    break;

  case 20:
#line 516 "parser.yy"
    {
		(yyval.scm) = THIS->lexer_->remove_scope ();
	;}
    break;

  case 21:
#line 525 "parser.yy"
    { (yyval.scm) = (yyvsp[0].scm); ;}
    break;

  case 22:
#line 526 "parser.yy"
    { (yyval.scm) = (yyvsp[0].scm); ;}
    break;

  case 23:
#line 530 "parser.yy"
    {
		if (! is_regular_identifier ((yyvsp[-2].scm)))
		{
			(yylsp[-2]).warning (_ ("identifier should have alphabetic characters only"));
		}

	        THIS->lexer_->set_identifier ((yyvsp[-2].scm), (yyvsp[0].scm));

/*
 TODO: devise standard for protection in parser.

  The parser stack lives on the C-stack, which means that
all objects can be unprotected as soon as they're here.

*/
	;}
    break;

  case 24:
#line 546 "parser.yy"
    { ;}
    break;

  case 25:
#line 551 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].score)->self_scm ();
		(yyvsp[0].score)->unprotect ();
	;}
    break;

  case 26:
#line 555 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].book)->self_scm ();
		(yyvsp[0].book)->unprotect ();
	;}
    break;

  case 27:
#line 559 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].outputdef)->self_scm ();
		(yyvsp[0].outputdef)->unprotect ();
	;}
    break;

  case 28:
#line 563 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 29:
#line 566 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].music)->self_scm ();
		(yyvsp[0].music)->unprotect();
	;}
    break;

  case 30:
#line 570 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].music)->self_scm ();
		(yyvsp[0].music)->unprotect();
	;}
    break;

  case 31:
#line 574 "parser.yy"
    {
 		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 32:
#line 577 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 33:
#line 580 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 34:
#line 583 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 35:
#line 586 "parser.yy"
    {
		(yyval.scm) = scm_from_int ((yyvsp[0].i));
	;}
    break;

  case 36:
#line 593 "parser.yy"
    {
		(yyval.scm) = (yyvsp[-1].scm);
	;}
    break;

  case 37:
#line 599 "parser.yy"
    {
		(yyval.scm) = Context_def::make_scm ();
		unsmob_context_def ((yyval.scm))->set_spot ((yyloc));
	;}
    break;

  case 38:
#line 603 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
		unsmob_context_def ((yyval.scm))->set_spot ((yyloc));
	;}
    break;

  case 39:
#line 607 "parser.yy"
    {
		Context_def*td = unsmob_context_def ((yyval.scm));

		for (SCM p = (yyvsp[0].scm); scm_is_pair (p); p = scm_cdr (p)) {
			SCM tag = scm_caar (p);

			/* TODO: should make new tag "grob-definition" ? */
			td->add_context_mod (scm_list_3 (ly_symbol2scm ("assign"),
							tag, scm_cons (scm_cdar (p), SCM_EOL)));
		}
	;}
    break;

  case 40:
#line 618 "parser.yy"
    {
		unsmob_context_def ((yyval.scm))->add_context_mod ((yyvsp[0].scm));		
	;}
    break;

  case 41:
#line 626 "parser.yy"
    {
		(yyval.book) = (yyvsp[-1].book);
	;}
    break;

  case 42:
#line 635 "parser.yy"
    {
		(yyval.book) = new Book;
		(yyval.book)->set_spot ((yyloc));
		(yyval.book)->paper_ = dynamic_cast<Output_def*> (unsmob_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"))->clone ());
		(yyval.book)->paper_->unprotect ();
		(yyval.book)->header_ = THIS->lexer_->lookup_identifier ("$defaultheader"); 
	;}
    break;

  case 43:
#line 642 "parser.yy"
    {
		(yyval.book) = unsmob_book ((yyvsp[0].scm));
		(yyval.book)->set_spot ((yyloc));
	;}
    break;

  case 44:
#line 646 "parser.yy"
    {
		(yyval.book)->paper_ = (yyvsp[0].outputdef);
		(yyvsp[0].outputdef)->unprotect ();
	;}
    break;

  case 45:
#line 650 "parser.yy"
    {
		SCM s = (yyvsp[0].score)->self_scm ();
		(yyval.book)->add_score (s);
		(yyvsp[0].score)->unprotect();
	;}
    break;

  case 46:
#line 655 "parser.yy"
    {
		(yyval.book)->add_score ((yyvsp[0].scm));
	;}
    break;

  case 47:
#line 658 "parser.yy"
    {
		(yyval.book)->header_ = (yyvsp[0].scm);
	;}
    break;

  case 48:
#line 661 "parser.yy"
    {
		(yyval.book)->paper_ = 0;
		(yyval.book)->scores_ = SCM_EOL;
	;}
    break;

  case 49:
#line 665 "parser.yy"
    {
		(yyval.book)->user_key_ = ly_scm2string ((yyvsp[0].scm));
	;}
    break;

  case 50:
#line 671 "parser.yy"
    {
		(yyval.score) = (yyvsp[-1].score);
	;}
    break;

  case 51:
#line 677 "parser.yy"
    {
		SCM m = (yyvsp[0].music)->self_scm ();
		(yyvsp[0].music)->unprotect();
		SCM scorify = ly_lily_module_constant ("scorify-music");
		SCM score = scm_call_2 (scorify, m, THIS->self_scm ());

		// pass ownernship to C++ again.
		(yyval.score) = unsmob_score (score);
		(yyval.score)->protect ();
		(yyval.score)->set_spot ((yyloc));
	;}
    break;

  case 52:
#line 688 "parser.yy"
    {
		(yyval.score) = unsmob_score ((yyvsp[0].scm));
		(yyval.score)->set_spot ((yyloc));
	;}
    break;

  case 53:
#line 692 "parser.yy"
    {
		(yyval.score)->user_key_ = ly_scm2string ((yyvsp[0].scm));
	;}
    break;

  case 54:
#line 695 "parser.yy"
    {
		(yyval.score)->header_ = (yyvsp[0].scm);
	;}
    break;

  case 55:
#line 698 "parser.yy"
    {
		if ((yyvsp[0].outputdef)->lookup_variable (ly_symbol2scm ("is-paper")) == SCM_BOOL_T)
		{
			THIS->parser_error ((yylsp[0]), _("\\paper cannot be used in \\score, use \\layout instead"));
		
		}
		else
		{
			(yyval.score)->defs_.push ((yyvsp[0].outputdef));
		}
		(yyvsp[0].outputdef)->unprotect ();
	;}
    break;

  case 56:
#line 710 "parser.yy"
    {
		(yyval.score)->error_found_ = true;
	;}
    break;

  case 57:
#line 721 "parser.yy"
    {
		(yyval.outputdef) = (yyvsp[0].outputdef);
		if ((yyval.outputdef)->lookup_variable (ly_symbol2scm ("is-paper")) != SCM_BOOL_T)
		{
			THIS->parser_error ((yylsp[0]), _ ("need \\paper for paper block"));
			(yyval.outputdef) = get_paper (THIS);
		}
	;}
    break;

  case 58:
#line 733 "parser.yy"
    {
		(yyval.outputdef) = (yyvsp[-1].outputdef);

		THIS->lexer_->remove_scope ();
		THIS->lexer_->pop_state ();
	;}
    break;

  case 59:
#line 742 "parser.yy"
    {
		(yyval.outputdef) = get_paper (THIS);
		(yyval.outputdef)->input_origin_ = (yyloc);
		THIS->lexer_->add_scope ((yyval.outputdef)->scope_);
	;}
    break;

  case 60:
#line 747 "parser.yy"
    {
		Output_def *p = get_midi (THIS);
		(yyval.outputdef) = p;
		THIS->lexer_->add_scope (p->scope_);
	;}
    break;

  case 61:
#line 752 "parser.yy"
    {
		Output_def *p = get_layout (THIS);

		THIS->lexer_->add_scope (p->scope_);
		(yyval.outputdef) = p;
	;}
    break;

  case 62:
#line 762 "parser.yy"
    {
		(yyval.outputdef) = (yyvsp[-1].outputdef);
		(yyval.outputdef)->input_origin_.set_spot ((yyloc));
		THIS->lexer_->push_initial_state ();
	;}
    break;

  case 63:
#line 767 "parser.yy"
    {
		(yyvsp[-2].outputdef)->unprotect ();
		Output_def *o = unsmob_output_def ((yyvsp[0].scm));
		o->input_origin_.set_spot ((yyloc));
		(yyval.outputdef) = o;
		THIS->lexer_->remove_scope ();
		THIS->lexer_->add_scope (o->scope_);
		THIS->lexer_->push_initial_state ();
	;}
    break;

  case 64:
#line 776 "parser.yy"
    {

	;}
    break;

  case 65:
#line 779 "parser.yy"
    {
		assign_context_def ((yyval.outputdef), (yyvsp[0].scm));
	;}
    break;

  case 66:
#line 782 "parser.yy"
    {
		/*
			junk this ? there already is tempo stuff in
			music.
		*/
		int m = scm_to_int ((yyvsp[0].music)->get_property ("metronome-count"));
		Duration *d = unsmob_duration ((yyvsp[0].music)->get_property ("tempo-unit"));
		set_tempo ((yyval.outputdef), d->get_length (), m);
		(yyvsp[0].music)->unprotect ();
	;}
    break;

  case 67:
#line 792 "parser.yy"
    {

	;}
    break;

  case 68:
#line 798 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("MetronomeChangeEvent");
		(yyval.music)->set_property ("tempo-unit", (yyvsp[-2].scm));
		(yyval.music)->set_property ("metronome-count", scm_from_int ( (yyvsp[0].i)));
	;}
    break;

  case 69:
#line 813 "parser.yy"
    {
		(yyval.scm) = scm_cons (SCM_EOL, SCM_EOL);
	;}
    break;

  case 70:
#line 816 "parser.yy"
    {
		SCM s = (yyval.scm);
 		SCM c = scm_cons ((yyvsp[0].music)->self_scm (), SCM_EOL);
		(yyvsp[0].music)->unprotect (); /* UGH */

		if (scm_is_pair (scm_cdr (s)))
			scm_set_cdr_x (scm_cdr (s), c); /* append */
		else
			scm_set_car_x (s, c); /* set first cons */
		scm_set_cdr_x (s, c);  /* remember last cell */
	;}
    break;

  case 71:
#line 827 "parser.yy"
    {

	;}
    break;

  case 72:
#line 830 "parser.yy"
    {
		Music * m = MY_MAKE_MUSIC("Music");
		// ugh. code dup 
		m->set_property ("error-found", SCM_BOOL_T);
		SCM s = (yyval.scm);
 		SCM c = scm_cons (m->self_scm (), SCM_EOL);
		m->unprotect (); /* UGH */

		if (scm_is_pair (scm_cdr (s)))
			scm_set_cdr_x (scm_cdr (s), c); /* append */
		else
			scm_set_car_x (s, c); /* set first cons */
		scm_set_cdr_x (s, c);  /* remember last cell */
	;}
    break;

  case 75:
#line 852 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;
	;}
    break;

  case 76:
#line 855 "parser.yy"
    {
		(yyval.scm) = (yyvsp[-1].scm);
	;}
    break;

  case 77:
#line 863 "parser.yy"
    {
		Music *beg = (yyvsp[-1].music);
		int times = (yyvsp[-2].i);
		SCM alts = scm_is_pair ((yyvsp[0].scm)) ? scm_car ((yyvsp[0].scm)) : SCM_EOL;
		if (times < scm_ilength (alts)) {
		  unsmob_music (scm_car (alts))
		    ->origin ()->warning (
		    _ ("more alternatives than repeats"));
		    warning ("junking excess alternatives");
		  alts = ly_truncate_list (times, alts);
		}


		SCM proc = ly_lily_module_constant ("make-repeated-music");

		SCM mus = scm_call_1 (proc, (yyvsp[-3].scm));
		Music *r = unsmob_music (mus);
		r->protect ();
		if (beg)
			{
			r-> set_property ("element", beg->self_scm ());
			beg->unprotect ();
			}
		r->set_property ("repeat-count", scm_from_int (max (times, 1)));

		r-> set_property ("elements",alts);
		if (ly_is_equal ((yyvsp[-3].scm), scm_makfrom0str ("tremolo"))) {
			/*
			TODO: move this code to Scheme.
			*/

			/* we cannot get durations and other stuff
			   correct down the line,
			   so we have to add to the duration log here. */
			SCM func = ly_lily_module_constant ("shift-duration-log");

			int dots = ((yyvsp[-2].i) % 3) ? 0 : 1;
			int shift = -intlog2 ((dots) ? ((yyvsp[-2].i)*2/3) : (yyvsp[-2].i));

			
			if ((yyvsp[-1].music)->is_mus_type ("sequential-music"))
			{
				int list_len = scm_ilength ((yyvsp[-1].music)->get_property ("elements"));
				if (list_len != 2)
					(yyvsp[-1].music)->origin ()->warning (_f ("expect 2 elements for Chord tremolo, found %d", list_len));
				shift -= 1;
				r->compress (Moment (Rational (1, list_len)));
			}
			scm_call_3 (func, r->self_scm (), scm_from_int (shift), scm_from_int (dots));

		}
		r->set_spot (*(yyvsp[-1].music)->origin ());

		(yyval.music) = r;
	;}
    break;

  case 78:
#line 921 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("SequentialMusic");
		(yyval.music)->set_property ("elements", scm_car ((yyvsp[-1].scm)));
		(yyval.music)->set_spot ((yyloc));
	;}
    break;

  case 79:
#line 926 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("SequentialMusic");
		(yyval.music)->set_property ("elements", scm_car ((yyvsp[-1].scm)));
		(yyval.music)->set_spot ((yyloc));
	;}
    break;

  case 80:
#line 934 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("SimultaneousMusic");
		(yyval.music)->set_property ("elements", scm_car ((yyvsp[-1].scm)));
		(yyval.music)->set_spot ((yyloc));

	;}
    break;

  case 81:
#line 940 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("SimultaneousMusic");
		(yyval.music)->set_property ("elements", scm_car ((yyvsp[-1].scm)));
		(yyval.music)->set_spot ((yyloc));
	;}
    break;

  case 82:
#line 948 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

  case 83:
#line 949 "parser.yy"
    {
		(yyval.music) = unsmob_music ((yyvsp[0].scm));
	;}
    break;

  case 86:
#line 958 "parser.yy"
    { (yyval.scm) = SCM_EOL; ;}
    break;

  case 87:
#line 959 "parser.yy"
    { THIS->lexer_->push_initial_state (); ;}
    break;

  case 88:
#line 961 "parser.yy"
    {
		THIS->lexer_->pop_state ();
		(yyval.scm) = (yyvsp[-1].scm);
	;}
    break;

  case 89:
#line 968 "parser.yy"
    { (yyval.scm) = SCM_EOL; ;}
    break;

  case 90:
#line 969 "parser.yy"
    {
		 (yyval.scm) = scm_cons ((yyvsp[0].scm), (yyvsp[-1].scm));
	;}
    break;

  case 91:
#line 976 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

  case 92:
#line 977 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

  case 93:
#line 981 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

  case 94:
#line 982 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

  case 97:
#line 992 "parser.yy"
    {
		(yyval.scm) = scm_list_2 ((yyvsp[0].scm), make_input ((yyloc)));
	;}
    break;

  case 98:
#line 995 "parser.yy"
    {
		(yyval.scm) = scm_list_3 ((yyvsp[-1].scm), make_input ((yyloc)), (yyvsp[0].scm));
	;}
    break;

  case 99:
#line 998 "parser.yy"
    {
		(yyval.scm) = scm_list_3 ((yyvsp[-1].scm), make_input ((yyloc)), (yyvsp[0].scm));
	;}
    break;

  case 100:
#line 1002 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-2].scm), make_input ((yyloc)), (yyvsp[-1].scm), (yyvsp[0].music)->self_scm ());
		(yyvsp[0].music)->unprotect ();
	;}
    break;

  case 101:
#line 1006 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-2].scm), make_input ((yyloc)), (yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 102:
#line 1009 "parser.yy"
    {
		(yyval.scm) = scm_list_5 ((yyvsp[-3].scm), make_input ((yyloc)), (yyvsp[-2].scm), (yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 103:
#line 1012 "parser.yy"
    {
		(yyval.scm) = scm_list_3 ((yyvsp[-1].scm), make_input ((yyloc)), (yyvsp[0].music)->self_scm ());
		(yyvsp[0].music)->unprotect ();
	;}
    break;

  case 104:
#line 1016 "parser.yy"
    {
		(yyval.scm) = scm_list_5 ((yyvsp[-3].scm), make_input ((yyloc)), (yyvsp[-2].scm), (yyvsp[-1].scm), (yyvsp[0].music)->self_scm ());
	;}
    break;

  case 105:
#line 1019 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-2].scm), make_input ((yyloc)), (yyvsp[-1].scm), (yyvsp[0].music)->self_scm ());
		(yyvsp[0].music)->unprotect ();
	;}
    break;

  case 106:
#line 1023 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-2].scm), make_input ((yyloc)), (yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 107:
#line 1026 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-2].scm), make_input ((yyloc)), (yyvsp[-1].music)->self_scm (), (yyvsp[0].music)->self_scm ());
		(yyvsp[-1].music)->unprotect ();
		(yyvsp[0].music)->unprotect ();
	;}
    break;

  case 108:
#line 1031 "parser.yy"
    {
		(yyval.scm) = scm_list_5 ((yyvsp[-3].scm), make_input ((yyloc)), (yyvsp[-2].scm), (yyvsp[-1].music)->self_scm (), (yyvsp[0].music)->self_scm ());
		(yyvsp[0].music)->unprotect ();
		(yyvsp[-1].music)->unprotect ();
	;}
    break;

  case 109:
#line 1036 "parser.yy"
    {
		(yyval.scm) = scm_list_5 ((yyvsp[-3].scm), make_input ((yyloc)), (yyvsp[-2].scm), (yyvsp[-1].music)->self_scm (), (yyvsp[0].music)->self_scm ());
		(yyvsp[-1].music)->unprotect ();
		(yyvsp[0].music)->unprotect ();
	;}
    break;

  case 110:
#line 1044 "parser.yy"
    {
		(yyval.music) = run_music_function (THIS, (yyvsp[0].scm));
	;}
    break;

  case 111:
#line 1047 "parser.yy"
    {
		(yyval.music) = context_spec_music ((yyvsp[-4].scm), (yyvsp[-2].scm), (yyvsp[0].music), (yyvsp[-1].scm));

	;}
    break;

  case 112:
#line 1051 "parser.yy"
    {
		(yyval.music) = context_spec_music ((yyvsp[-2].scm), SCM_UNDEFINED, (yyvsp[0].music), (yyvsp[-1].scm));
	;}
    break;

  case 113:
#line 1054 "parser.yy"
    {
		(yyval.music) = context_spec_music ((yyvsp[-2].scm), get_next_unique_context_id (), (yyvsp[0].music),
			(yyvsp[-1].scm));
	;}
    break;

  case 114:
#line 1061 "parser.yy"
    {
		int n = scm_to_int (scm_car ((yyvsp[-1].scm))); int d = scm_to_int (scm_cdr ((yyvsp[-1].scm)));
		Music *mp = (yyvsp[0].music);

		(yyval.music)= MY_MAKE_MUSIC ("TimeScaledMusic");
		(yyval.music)->set_spot ((yyloc));

		(yyval.music)->set_property ("element", mp->self_scm ());
		mp->unprotect();
		(yyval.music)->set_property ("numerator", scm_from_int (n));
		(yyval.music)->set_property ("denominator", scm_from_int (d));
		(yyval.music)->compress (Moment (Rational (n,d)));

	;}
    break;

  case 115:
#line 1075 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

  case 116:
#line 1076 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("TransposedMusic");
		Music *p = (yyvsp[0].music);
		Pitch from = *unsmob_pitch ((yyvsp[-2].scm));
		Pitch to = *unsmob_pitch ((yyvsp[-1].scm));

		p->transpose (pitch_interval (from, to));
		(yyval.music)->set_property ("element", p->self_scm ());
		p->unprotect();
	;}
    break;

  case 117:
#line 1086 "parser.yy"
    {
		if ((yyvsp[-1].scm) == ly_symbol2scm ("chords"))
		{
		  Music *chm = MY_MAKE_MUSIC ("UnrelativableMusic");
		  chm->set_property ("element", (yyvsp[0].music)->self_scm ());
		  (yyval.music) = chm;
		  (yyvsp[0].music)->unprotect();
		}
		else
		{
		  (yyval.music) = (yyvsp[0].music);
		}
		THIS->lexer_->pop_state ();
	;}
    break;

  case 118:
#line 1100 "parser.yy"
    {
		(yyval.music) = context_spec_music ((yyvsp[-2].scm), get_next_unique_context_id (),
					 (yyvsp[0].music), (yyvsp[-1].scm));
		if ((yyvsp[-2].scm) == ly_symbol2scm ("ChordNames"))
		{
		  Music *chm = MY_MAKE_MUSIC ("UnrelativableMusic");
		  chm->set_property ("element", (yyval.music)->self_scm ());
		  (yyval.music)->unprotect();
		  (yyval.music) = chm;
		}
		THIS->lexer_->pop_state ();
	;}
    break;

  case 119:
#line 1112 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

  case 120:
#line 1113 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

  case 121:
#line 1117 "parser.yy"
    {
		SCM nn = THIS->lexer_->lookup_identifier ("pitchnames");
		THIS->lexer_->push_note_state (alist_to_hashq (nn));

		(yyval.scm) = ly_symbol2scm ("notes");
	;}
    break;

  case 122:
#line 1124 "parser.yy"
    {
		SCM nn = THIS->lexer_->lookup_identifier ("drumPitchNames");
		THIS->lexer_->push_note_state (alist_to_hashq (nn));

		(yyval.scm) = ly_symbol2scm ("drums");
	;}
    break;

  case 123:
#line 1130 "parser.yy"
    {
		THIS->lexer_->push_figuredbass_state ();

		(yyval.scm) = ly_symbol2scm ("figures");
	;}
    break;

  case 124:
#line 1135 "parser.yy"
    {
		SCM nn = THIS->lexer_->lookup_identifier ("chordmodifiers");
		THIS->lexer_->chordmodifier_tab_ = alist_to_hashq (nn);
		nn = THIS->lexer_->lookup_identifier ("pitchnames");
		THIS->lexer_->push_chord_state (alist_to_hashq (nn));
		(yyval.scm) = ly_symbol2scm ("chords");

	;}
    break;

  case 125:
#line 1144 "parser.yy"
    { THIS->lexer_->push_lyric_state ();
		(yyval.scm) = ly_symbol2scm ("lyrics");
	;}
    break;

  case 126:
#line 1150 "parser.yy"
    {
		SCM nn = THIS->lexer_->lookup_identifier ("drumPitchNames");
		THIS->lexer_->push_note_state (alist_to_hashq (nn));

		(yyval.scm) = ly_symbol2scm ("DrumStaff");
	;}
    break;

  case 127:
#line 1156 "parser.yy"
    {
		THIS->lexer_->push_figuredbass_state ();

		(yyval.scm) = ly_symbol2scm ("FiguredBass");
	;}
    break;

  case 128:
#line 1161 "parser.yy"
    {
		SCM nn = THIS->lexer_->lookup_identifier ("chordmodifiers");
		THIS->lexer_->chordmodifier_tab_ = alist_to_hashq (nn);
		nn = THIS->lexer_->lookup_identifier ("pitchnames");
		THIS->lexer_->push_chord_state (alist_to_hashq (nn));
		(yyval.scm) = ly_symbol2scm ("ChordNames");
	;}
    break;

  case 129:
#line 1169 "parser.yy"
    { THIS->lexer_->push_lyric_state ();
		(yyval.scm) = ly_symbol2scm ("Lyrics");
	;}
    break;

  case 130:
#line 1176 "parser.yy"
    {
		Music *m = (yyvsp[0].music);
		Pitch start = *unsmob_pitch ((yyvsp[-1].scm));
		(yyval.music) = make_music_relative (start, m);
		m->unprotect();
	;}
    break;

  case 131:
#line 1182 "parser.yy"
    {
		Music *m = (yyvsp[0].music);

		Pitch middle_c (0, 0, 0);
		(yyval.music) = make_music_relative (middle_c, m);
		m->unprotect();
	;}
    break;

  case 132:
#line 1192 "parser.yy"
    { THIS->lexer_->push_lyric_state (); ;}
    break;

  case 133:
#line 1194 "parser.yy"
    {
	/* Can also use Music at the expensive of two S/Rs similar to
           \repeat \alternative */
		THIS->lexer_->pop_state ();

		(yyval.scm) = scm_cons ((yyvsp[0].music)->self_scm (), SCM_EOL);
	;}
    break;

  case 134:
#line 1201 "parser.yy"
    {
		THIS->lexer_->push_lyric_state ();
	;}
    break;

  case 135:
#line 1203 "parser.yy"
    {
		THIS->lexer_->pop_state ();
		(yyval.scm) = scm_cons ((yyvsp[0].music)->self_scm (), (yyvsp[-3].scm));
	;}
    break;

  case 136:
#line 1210 "parser.yy"
    {
		Music * voice = (yyvsp[-1].music);
		SCM name = get_first_context_id (scm_makfrom0str ("Voice"), voice); 
		if (!scm_is_string (name))
		{
			name = get_next_unique_lyrics_context_id ();
			voice = context_spec_music (scm_makfrom0str ("Voice"),
						    name,
						    voice, SCM_EOL);
		}

		SCM context = scm_makfrom0str ("Lyrics");
		Music *all = MY_MAKE_MUSIC ("SimultaneousMusic");

		SCM lst = SCM_EOL;
		for (SCM s = (yyvsp[0].scm); scm_is_pair (s); s = scm_cdr (s))
		{
			Music *music = unsmob_music (scm_car (s));
			Music *com = make_lyric_combine_music (name, music);
			Music *csm = context_spec_music (context,
				get_next_unique_context_id (), com, SCM_EOL);
			lst = scm_cons (csm->self_scm (), lst);
		}
		all->set_property ("elements", scm_cons (voice->self_scm (),
			lst));
		(yyval.music) = all;
		voice->unprotect ();
	;}
    break;

  case 137:
#line 1238 "parser.yy"
    {
		THIS->lexer_->push_lyric_state ();
	;}
    break;

  case 138:
#line 1240 "parser.yy"
    {
		THIS->lexer_->pop_state ();
		Music *music = (yyvsp[0].music);
		SCM name = (yyvsp[-2].scm);
		(yyval.music) = make_lyric_combine_music (name, music);
		music->unprotect();
	;}
    break;

  case 139:
#line 1250 "parser.yy"
    {
		Music*t = MY_MAKE_MUSIC ("ContextChange");
		t-> set_property ("change-to-type", scm_string_to_symbol ((yyvsp[-2].scm)));
		t-> set_property ("change-to-id", (yyvsp[0].scm));

		(yyval.music) = t;
		(yyval.music)->set_spot ((yyloc));
	;}
    break;

  case 140:
#line 1261 "parser.yy"
    {
		(yyval.scm) = scm_list_3 (ly_symbol2scm ("assign"),
			scm_string_to_symbol ((yyvsp[-2].scm)), (yyvsp[0].scm));
	;}
    break;

  case 141:
#line 1265 "parser.yy"
    {
		(yyval.scm) = scm_list_2 (ly_symbol2scm ("unset"),
			scm_string_to_symbol ((yyvsp[0].scm)));
	;}
    break;

  case 142:
#line 1269 "parser.yy"
    {
		(yyval.scm) = scm_list_4 (ly_symbol2scm ("push"),
			scm_string_to_symbol ((yyvsp[-3].scm)), (yyvsp[0].scm), (yyvsp[-2].scm));
	;}
    break;

  case 143:
#line 1273 "parser.yy"
    {
		(yyval.scm) = scm_list_5 (ly_symbol2scm ("push"),
				scm_string_to_symbol ((yyvsp[-4].scm)), (yyvsp[0].scm), (yyvsp[-2].scm), (yyvsp[-3].scm));
	;}
    break;

  case 144:
#line 1277 "parser.yy"
    {
		(yyval.scm) = scm_list_3 (ly_symbol2scm ("pop"),
			scm_string_to_symbol ((yyvsp[-1].scm)), (yyvsp[0].scm));
	;}
    break;

  case 145:
#line 1284 "parser.yy"
    { (yyval.scm) = ly_symbol2scm ("consists"); ;}
    break;

  case 146:
#line 1285 "parser.yy"
    { (yyval.scm) = ly_symbol2scm ("remove"); ;}
    break;

  case 147:
#line 1287 "parser.yy"
    { (yyval.scm) = ly_symbol2scm ("accepts"); ;}
    break;

  case 148:
#line 1288 "parser.yy"
    { (yyval.scm) = ly_symbol2scm ("default-child"); ;}
    break;

  case 149:
#line 1289 "parser.yy"
    { (yyval.scm) = ly_symbol2scm ("denies"); ;}
    break;

  case 150:
#line 1291 "parser.yy"
    { (yyval.scm) = ly_symbol2scm ("alias"); ;}
    break;

  case 151:
#line 1292 "parser.yy"
    { (yyval.scm) = ly_symbol2scm ("translator-type"); ;}
    break;

  case 152:
#line 1293 "parser.yy"
    { (yyval.scm) = ly_symbol2scm ("description"); ;}
    break;

  case 153:
#line 1294 "parser.yy"
    { (yyval.scm) = ly_symbol2scm ("context-name"); ;}
    break;

  case 154:
#line 1298 "parser.yy"
    { (yyval.scm) = (yyvsp[0].scm); ;}
    break;

  case 155:
#line 1299 "parser.yy"
    {
		(yyval.scm) = scm_list_2 ((yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 156:
#line 1305 "parser.yy"
    {
		if (!is_regular_identifier ((yyvsp[0].scm)))
		{
			(yyloc).error (_("Grob name should be alphanumeric"));
		}

		(yyval.scm) = scm_list_2 (ly_symbol2scm ("Bottom"),
			scm_string_to_symbol ((yyvsp[0].scm)));
	;}
    break;

  case 157:
#line 1314 "parser.yy"
    {
		(yyval.scm) = scm_list_2 (scm_string_to_symbol ((yyvsp[-2].scm)),
			scm_string_to_symbol ((yyvsp[0].scm)));
	;}
    break;

  case 158:
#line 1321 "parser.yy"
    {
		(yyval.music) = property_op_to_music (scm_list_4 (
			ly_symbol2scm ("push"),
			scm_cadr ((yyvsp[-3].scm)),
			(yyvsp[0].scm), (yyvsp[-2].scm)));
		(yyval.music) = context_spec_music (scm_car ((yyvsp[-3].scm)), SCM_UNDEFINED, (yyval.music), SCM_EOL);
	;}
    break;

  case 159:
#line 1328 "parser.yy"
    {
		(yyval.music) = property_op_to_music (scm_list_5 (
			ly_symbol2scm ("push"),
			scm_cadr ((yyvsp[-4].scm)),
			(yyvsp[0].scm), (yyvsp[-2].scm), (yyvsp[-3].scm)));
		(yyval.music) = context_spec_music (scm_car ((yyvsp[-4].scm)), SCM_UNDEFINED, (yyval.music), SCM_EOL);
	;}
    break;

  case 160:
#line 1335 "parser.yy"
    {
		(yyval.music) = property_op_to_music (scm_list_3 (
			ly_symbol2scm ("pop"),
			scm_cadr ((yyvsp[-1].scm)),
			(yyvsp[0].scm)));

		(yyval.music)= context_spec_music (scm_car ((yyvsp[-1].scm)), SCM_UNDEFINED, (yyval.music), SCM_EOL);
	;}
    break;

  case 161:
#line 1343 "parser.yy"
    {
		(yyval.music) = property_op_to_music (scm_list_3 (
			ly_symbol2scm ("assign"),
			scm_cadr ((yyvsp[-2].scm)),
			(yyvsp[0].scm)));
		(yyval.music)= context_spec_music (scm_car ((yyvsp[-2].scm)), SCM_UNDEFINED, (yyval.music), SCM_EOL);
	;}
    break;

  case 162:
#line 1350 "parser.yy"
    {
		(yyval.music) = property_op_to_music (scm_list_2 (
			ly_symbol2scm ("unset"),
			scm_cadr ((yyvsp[0].scm))));
		(yyval.music)= context_spec_music (scm_car ((yyvsp[0].scm)), SCM_UNDEFINED, (yyval.music), SCM_EOL);
	;}
    break;

  case 163:
#line 1356 "parser.yy"
    {
		SCM e = (yyvsp[0].music)->get_property ("element");
                unsmob_music (e)->set_property ("once", SCM_BOOL_T);
		(yyval.music) = (yyvsp[0].music);

	;}
    break;

  case 164:
#line 1366 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 165:
#line 1369 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 166:
#line 1372 "parser.yy"
    {
		(yyval.scm) = scm_string_append (scm_list_2 ((yyvsp[-2].scm), (yyvsp[0].scm)));
	;}
    break;

  case 167:
#line 1377 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 168:
#line 1380 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 169:
#line 1383 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 170:
#line 1388 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 171:
#line 1391 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 172:
#line 1394 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 173:
#line 1397 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 174:
#line 1400 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 175:
#line 1403 "parser.yy"
    {
		(yyval.scm) = scm_from_int ((yyvsp[0].i));
	;}
    break;

  case 177:
#line 1431 "parser.yy"
    {
		SCM elts = (yyvsp[-1].music)-> get_property ("elements");

		elts = ly_append2 (elts, scm_reverse_x ((yyvsp[0].scm), SCM_EOL));

		(yyvsp[-1].music)->set_property ("elements", elts);
		/* why is this giving wrong start location? -ns
		 * $2->set_spot (@$); */
		Input i;
		i.set_location ((yylsp[-1]), (yylsp[0]));
		(yyvsp[-1].music)->set_spot (i);
		(yyval.music) = (yyvsp[-1].music);
	;}
    break;

  case 180:
#line 1451 "parser.yy"
    {
		SCM dur = unsmob_duration ((yyvsp[-1].scm))->smobbed_copy ();
		SCM es = (yyvsp[-2].music)->get_property ("elements");
		SCM postevs = scm_reverse_x ((yyvsp[0].scm), SCM_EOL);

		for (SCM s = es; scm_is_pair (s); s = scm_cdr (s))
		  unsmob_music (scm_car (s))->set_property ("duration", dur);
		es = ly_append2 (es, postevs);

		(yyvsp[-2].music)-> set_property ("elements", es);
		(yyvsp[-2].music)->set_spot ((yyloc));
		(yyval.music) = (yyvsp[-2].music);
	;}
    break;

  case 185:
#line 1480 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("EventChord");
		(yyval.music)->set_spot ((yyloc));
		(yyval.music)->set_property ("elements",
			scm_reverse_x ((yyvsp[-1].scm), SCM_EOL));
	;}
    break;

  case 186:
#line 1489 "parser.yy"
    { (yyval.scm) = SCM_EOL; ;}
    break;

  case 187:
#line 1490 "parser.yy"
    {
		(yyval.scm) = scm_cons ((yyvsp[0].music)->self_scm (), (yyvsp[-1].scm));
		(yyvsp[0].music)->unprotect ();
	;}
    break;

  case 188:
#line 1498 "parser.yy"
    {
		int q = (yyvsp[-2].i);
		int ex = (yyvsp[-3].i);
		SCM check = (yyvsp[-1].scm);
		SCM post = (yyvsp[0].scm);

		Music *n = MY_MAKE_MUSIC ("NoteEvent");
		n->set_property ("pitch", (yyvsp[-4].scm));
		n->set_spot ((yyloc));
		if (q % 2)
			n->set_property ("cautionary", SCM_BOOL_T);
		if (ex % 2 || q % 2)
			n->set_property ("force-accidental", SCM_BOOL_T);

		if (scm_is_pair (post)) {
			SCM arts = scm_reverse_x (post, SCM_EOL);
			n->set_property ("articulations", arts);
		}
		if (scm_is_number (check))
		{
			int q = scm_to_int (check);
			n->set_property ("absolute-octave", scm_from_int (q-1));
		}

		
		(yyval.music) = n;
	;}
    break;

  case 189:
#line 1525 "parser.yy"
    {
		Music *n = MY_MAKE_MUSIC ("NoteEvent");
		n->set_property ("duration", (yyvsp[0].scm));
		n->set_property ("drum-type", (yyvsp[-1].scm));
		n->set_spot ((yyloc));

		if (scm_is_pair ((yyvsp[0].scm))) {
			SCM arts = scm_reverse_x ((yyvsp[0].scm), SCM_EOL);
			n->set_property ("articulations", arts);
		}
		(yyval.music) = n;
	;}
    break;

  case 190:
#line 1537 "parser.yy"
    { 
		(yyval.music) = run_music_function (THIS, (yyvsp[0].scm));
		(yyval.music)->set_spot ((yyloc));
	;}
    break;

  case 191:
#line 1544 "parser.yy"
    {
		(yyval.scm) = scm_list_2 ((yyvsp[0].scm), make_input ((yyloc)));
	;}
    break;

  case 192:
#line 1547 "parser.yy"
    {
		(yyval.scm) = scm_list_3 ((yyvsp[-1].scm), make_input ((yyloc)),
					(yyvsp[0].music)->self_scm ());
	;}
    break;

  case 193:
#line 1551 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-2].scm), make_input ((yyloc)),
					(yyvsp[-1].scm), (yyvsp[0].music)->self_scm ());
	;}
    break;

  case 194:
#line 1556 "parser.yy"
    {

		(yyval.scm) = scm_list_5 ((yyvsp[-3].scm), make_input ((yyloc)),
					(yyvsp[-2].scm), (yyvsp[-1].scm), (yyvsp[0].music)->self_scm ());
	;}
    break;

  case 195:
#line 1565 "parser.yy"
    {
		SCM adder = ly_lily_module_constant ("add-quotable");
		
		scm_call_2 (adder, (yyvsp[-1].scm), (yyvsp[0].music)->self_scm ());
		(yyvsp[0].music)->unprotect();
	;}
    break;

  case 196:
#line 1574 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("EventChord");
		(yyval.music)->set_property ("elements", scm_cons ((yyvsp[0].music)->self_scm (), SCM_EOL));
		(yyvsp[0].music)->unprotect();

		(yyval.music)-> set_spot ((yyloc));
		(yyvsp[0].music)-> set_spot ((yyloc));
	;}
    break;

  case 197:
#line 1582 "parser.yy"
    {
		Music *skip = MY_MAKE_MUSIC ("SkipMusic");
		skip->set_property ("duration", (yyvsp[0].scm));
		skip->set_spot ((yyloc));
		(yyval.music) = skip;
	;}
    break;

  case 198:
#line 1588 "parser.yy"
    {
		Music *m = MY_MAKE_MUSIC ("RelativeOctaveCheck");
		(yyval.music) = m;
		(yyval.music)->set_spot ((yyloc));
		(yyval.music)->set_property ("pitch", (yyvsp[0].scm));
	;}
    break;

  case 199:
#line 1594 "parser.yy"
    {
		Music *m = MY_MAKE_MUSIC ("LigatureEvent");
		m->set_property ("span-direction", scm_from_int (START));
		m->set_spot ((yyloc));

		(yyval.music) = MY_MAKE_MUSIC ("EventChord");
		(yyval.music)->set_property ("elements", scm_cons (m->self_scm (), SCM_EOL));
		m->unprotect();
		(yyval.music)->set_spot ((yyloc));
	;}
    break;

  case 200:
#line 1604 "parser.yy"
    {
		Music *m = MY_MAKE_MUSIC ("LigatureEvent");
		m->set_property ("span-direction", scm_from_int (STOP));
		m->set_spot ((yyloc));

		(yyval.music) = MY_MAKE_MUSIC ("EventChord");
		(yyval.music)->set_property ("elements", scm_cons (m->self_scm (), SCM_EOL));
		(yyval.music)->set_spot ((yyloc));
		m->unprotect ();
	;}
    break;

  case 201:
#line 1614 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("VoiceSeparator");
		(yyval.music)->set_spot ((yyloc));
	;}
    break;

  case 202:
#line 1618 "parser.yy"
    {
		SCM pipe = THIS->lexer_->lookup_identifier ("pipeSymbol");

		if (Music * m = unsmob_music (pipe))
			(yyval.music) = m->clone ();
		else
			(yyval.music) = MY_MAKE_MUSIC ("BarCheck");

		(yyval.music)->set_spot ((yyloc));
	;}
    break;

  case 203:
#line 1628 "parser.yy"
    {
		Pitch middle_c;
		Pitch sounds_as_c = pitch_interval (*unsmob_pitch ((yyvsp[0].scm)), middle_c);
		(yyval.music) = set_property_music (ly_symbol2scm ("instrumentTransposition"),
					 sounds_as_c.smobbed_copy());
		(yyval.music)->set_spot ((yyloc));
		(yyval.music) = context_spec_music (ly_symbol2scm ("Staff"), SCM_UNDEFINED,
			(yyval.music), SCM_EOL);
	;}
    break;

  case 204:
#line 1637 "parser.yy"
    {
		Moment m = - unsmob_duration ((yyvsp[0].scm))->get_length ();
		Music *p = set_property_music (ly_symbol2scm ( "measurePosition"),m.smobbed_copy ());
		p->set_spot ((yyloc));
		p = context_spec_music (ly_symbol2scm ("Timing"), SCM_UNDEFINED,
					p, SCM_EOL);
		p = context_spec_music (ly_symbol2scm ("Score"), SCM_UNDEFINED,
					p, SCM_EOL);
		(yyval.music) = p;
	;}
    break;

  case 205:
#line 1648 "parser.yy"
    {
		SCM proc = ly_lily_module_constant ("make-time-signature-set");

		SCM result = scm_apply_2   (proc, scm_car ((yyvsp[0].scm)), scm_cdr ((yyvsp[0].scm)), SCM_EOL);
		(yyval.music) = unsmob_music (result);
		(yyval.music)->protect ();
	;}
    break;

  case 206:
#line 1655 "parser.yy"
    {
		SCM proc = ly_lily_module_constant ("make-mark-set");

		SCM result = scm_call_1 (proc, (yyvsp[0].scm));
		(yyval.music) = unsmob_music (result);
		(yyval.music)->protect ();
	;}
    break;

  case 207:
#line 1665 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("PesOrFlexaEvent");
	;}
    break;

  case 208:
#line 1668 "parser.yy"
    {
		Music *m = MY_MAKE_MUSIC ("MarkEvent");
		(yyval.music) = m;
	;}
    break;

  case 209:
#line 1672 "parser.yy"
    {
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

  case 210:
#line 1675 "parser.yy"
    {
		Music *key = MY_MAKE_MUSIC ("KeyChangeEvent");
		(yyval.music) = key;
	;}
    break;

  case 211:
#line 1679 "parser.yy"
    {

		Music *key = MY_MAKE_MUSIC ("KeyChangeEvent");
		if (scm_ilength ((yyvsp[0].scm)) > 0)
		{		
			key->set_property ("pitch-alist", (yyvsp[0].scm));
			key->set_property ("tonic", Pitch (0, 0, 0).smobbed_copy ());
			key->transpose (* unsmob_pitch ((yyvsp[-1].scm)));
		} else {
			THIS->parser_error ((yylsp[0]), _ ("second argument must be pitch list"));
		}

		(yyval.music) = key;
	;}
    break;

  case 212:
#line 1697 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;
	;}
    break;

  case 213:
#line 1700 "parser.yy"
    {
		(yyvsp[0].music)->set_spot ((yylsp[0]));
		(yyval.scm) = scm_cons ((yyvsp[0].music)->self_scm (), (yyval.scm));
		(yyvsp[0].music)->unprotect ();
	;}
    break;

  case 214:
#line 1708 "parser.yy"
    {
		(yyval.scm) = scm_list_3 ((yyvsp[-1].scm), make_input ((yyloc)), (yyvsp[0].music)->self_scm ());
	;}
    break;

  case 215:
#line 1711 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-2].scm), make_input ((yyloc)), (yyvsp[-1].scm), (yyvsp[0].music)->self_scm ());
	;}
    break;

  case 216:
#line 1714 "parser.yy"
    {
		(yyval.scm) = scm_list_5 ((yyvsp[-3].scm), make_input ((yyloc)), (yyvsp[-2].scm), (yyvsp[-1].scm), (yyvsp[0].music)->self_scm ());
	;}
    break;

  case 217:
#line 1721 "parser.yy"
    {
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

  case 218:
#line 1724 "parser.yy"
    {
		Music *mus = run_music_function (THIS, (yyvsp[0].scm));
		mus->set_spot ((yylsp[-1]));
		(yyval.music) = mus;
	;}
    break;

  case 219:
#line 1729 "parser.yy"
    {
		if (!THIS->lexer_->is_lyric_state ())
			THIS->parser_error ((yylsp[0]), _ ("have to be in Lyric mode for lyrics"));
		(yyval.music) = MY_MAKE_MUSIC ("HyphenEvent");
	;}
    break;

  case 220:
#line 1734 "parser.yy"
    {
		if (!THIS->lexer_->is_lyric_state ())
			THIS->parser_error ((yylsp[0]), _ ("have to be in Lyric mode for lyrics"));
		(yyval.music) = MY_MAKE_MUSIC ("ExtenderEvent");
	;}
    break;

  case 221:
#line 1739 "parser.yy"
    {
		if ((yyvsp[-1].i))
			(yyvsp[0].music)->set_property ("direction", scm_from_int ((yyvsp[-1].i)));
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

  case 222:
#line 1744 "parser.yy"
    {
		if ((yyvsp[-1].i))
			(yyvsp[0].music)->set_property ("direction", scm_from_int ((yyvsp[-1].i)));
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

  case 224:
#line 1753 "parser.yy"
    {
		Music *s = MY_MAKE_MUSIC ("StringNumberEvent");
		s->set_property ("string-number", scm_from_int ((yyvsp[0].i)));
		s->set_spot ((yyloc));
		(yyval.music) = s;
	;}
    break;

  case 225:
#line 1762 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("bracketOpenSymbol");
	;}
    break;

  case 226:
#line 1765 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("bracketCloseSymbol"); 
	;}
    break;

  case 227:
#line 1768 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("tildeSymbol");
	;}
    break;

  case 228:
#line 1771 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("parenthesisOpenSymbol");
	;}
    break;

  case 229:
#line 1774 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("parenthesisCloseSymbol");
	;}
    break;

  case 230:
#line 1777 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("escapedExclamationSymbol");
	;}
    break;

  case 231:
#line 1780 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("escapedParenthesisOpenSymbol");
	;}
    break;

  case 232:
#line 1783 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("escapedParenthesisCloseSymbol");
	;}
    break;

  case 233:
#line 1786 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("escapedBiggerSymbol");
	;}
    break;

  case 234:
#line 1789 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("escapedSmallerSymbol");
	;}
    break;

  case 235:
#line 1795 "parser.yy"
    {
		SCM predefd = THIS->lexer_->lookup_identifier_symbol ((yyvsp[0].scm));
		Music * m = 0;
		if (unsmob_music (predefd))
		{
			m = unsmob_music (predefd)->clone ();
		}
		else
		{
			m = MY_MAKE_MUSIC ("Music");
		}
		m->set_spot ((yyloc));
		(yyval.music) = m;		
	;}
    break;

  case 236:
#line 1809 "parser.yy"
    {
		(yyval.music) = unsmob_music ((yyvsp[0].scm));
	;}
    break;

  case 237:
#line 1812 "parser.yy"
    {
               Music *a = MY_MAKE_MUSIC ("TremoloEvent");
               a->set_spot ((yyloc));
               a->set_property ("tremolo-type", scm_from_int ((yyvsp[0].i)));
               (yyval.music) = a;
        ;}
    break;

  case 238:
#line 1821 "parser.yy"
    {
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

  case 239:
#line 1824 "parser.yy"
    {
		SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ((yyvsp[0].scm)));
		Music *a = MY_MAKE_MUSIC ("ArticulationEvent");
		if (scm_is_string (s))
			a->set_property ("articulation-type", s);
		else THIS->parser_error ((yylsp[0]), _ ("expecting string as script definition"));
		(yyval.music) = a;
	;}
    break;

  case 240:
#line 1835 "parser.yy"
    { (yyval.scm) = SCM_EOL; ;}
    break;

  case 241:
#line 1836 "parser.yy"
    { (yyval.scm) = scm_from_int (0); ;}
    break;

  case 242:
#line 1837 "parser.yy"
    { (yyval.scm) = scm_from_int ((yyvsp[0].i)); ;}
    break;

  case 243:
#line 1838 "parser.yy"
    { (yyval.scm) = scm_from_int ((yyvsp[0].i)); ;}
    break;

  case 244:
#line 1842 "parser.yy"
    {
		(yyval.i) = 1;
	;}
    break;

  case 245:
#line 1845 "parser.yy"
    {
		(yyval.i) ++;
	;}
    break;

  case 246:
#line 1851 "parser.yy"
    {
		(yyval.i) = 1;
	;}
    break;

  case 247:
#line 1854 "parser.yy"
    {
		(yyval.i)++;
	;}
    break;

  case 248:
#line 1860 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 249:
#line 1863 "parser.yy"
    {
		Pitch p = *unsmob_pitch ((yyvsp[-1].scm));
		p = p.transposed (Pitch ((yyvsp[0].i),0,0));
		(yyval.scm) = p.smobbed_copy ();
	;}
    break;

  case 250:
#line 1868 "parser.yy"
    {
		Pitch p =* unsmob_pitch ((yyvsp[-1].scm));
		p = p.transposed (Pitch (-(yyvsp[0].i),0,0));
		(yyval.scm) = p.smobbed_copy ();
	;}
    break;

  case 251:
#line 1880 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 252:
#line 1883 "parser.yy"
    {
		Pitch p = *unsmob_pitch ((yyvsp[-1].scm));
		p = p.transposed (Pitch ((yyvsp[0].i),0,0));
		(yyval.scm) = p.smobbed_copy ();
	;}
    break;

  case 253:
#line 1888 "parser.yy"
    {
		Pitch p =* unsmob_pitch ((yyvsp[-1].scm));

		p = p.transposed (Pitch (-(yyvsp[0].i),0,0));
		(yyval.scm) = p.smobbed_copy ();
	;}
    break;

  case 254:
#line 1897 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 257:
#line 1908 "parser.yy"
    {
		Music *t = MY_MAKE_MUSIC ("TextScriptEvent");
		t->set_property ("text", (yyvsp[0].scm));
		t->set_spot ((yyloc));
		(yyval.music) = t;	
	;}
    break;

  case 258:
#line 1914 "parser.yy"
    {
		Music *t = MY_MAKE_MUSIC ("TextScriptEvent");
		t->set_property ("text",
			make_simple_markup ((yyvsp[0].scm)));
		t->set_spot ((yyloc));
		(yyval.music) = t;
	
	;}
    break;

  case 259:
#line 1922 "parser.yy"
    {
		Music *t = MY_MAKE_MUSIC ("FingerEvent");
		t->set_property ("digit", scm_from_int ((yyvsp[0].i)));
		t->set_spot ((yyloc));
		(yyval.music) = t;
	;}
    break;

  case 260:
#line 1931 "parser.yy"
    {
		(yyval.scm) = scm_makfrom0str ("Hat");
	;}
    break;

  case 261:
#line 1934 "parser.yy"
    {
		(yyval.scm) = scm_makfrom0str ("Plus");
	;}
    break;

  case 262:
#line 1937 "parser.yy"
    {
		(yyval.scm) = scm_makfrom0str ("Dash");
	;}
    break;

  case 263:
#line 1940 "parser.yy"
    {
		(yyval.scm) = scm_makfrom0str ("Bar");
	;}
    break;

  case 264:
#line 1943 "parser.yy"
    {
		(yyval.scm) = scm_makfrom0str ("Larger");
	;}
    break;

  case 265:
#line 1946 "parser.yy"
    {
		(yyval.scm) = scm_makfrom0str ("Dot");
	;}
    break;

  case 266:
#line 1949 "parser.yy"
    {
		(yyval.scm) = scm_makfrom0str ("Underscore");
	;}
    break;

  case 267:
#line 1955 "parser.yy"
    { (yyval.i) = DOWN; ;}
    break;

  case 268:
#line 1956 "parser.yy"
    { (yyval.i) = UP; ;}
    break;

  case 269:
#line 1957 "parser.yy"
    { (yyval.i) = CENTER; ;}
    break;

  case 270:
#line 1962 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 271:
#line 1968 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 272:
#line 1974 "parser.yy"
    {
		Duration dd = THIS->default_duration_;
		(yyval.scm) = dd.smobbed_copy ();
	;}
    break;

  case 273:
#line 1978 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
		THIS->default_duration_ = *unsmob_duration ((yyval.scm));
	;}
    break;

  case 274:
#line 1985 "parser.yy"
    {
		int len = 0;
		if (!is_duration ((yyvsp[-1].i)))
			THIS->parser_error ((yylsp[-1]), _f ("not a duration: %d", (yyvsp[-1].i)));
		else
			len = intlog2 ((yyvsp[-1].i));

		(yyval.scm) = Duration (len, (yyvsp[0].i)).smobbed_copy ();
	;}
    break;

  case 275:
#line 1994 "parser.yy"
    {
		Duration *d = unsmob_duration ((yyvsp[-1].scm));
		Duration k (d->duration_log (), d->dot_count () + (yyvsp[0].i));
		*d = k;
		(yyval.scm) = (yyvsp[-1].scm);
	;}
    break;

  case 276:
#line 2003 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 277:
#line 2006 "parser.yy"
    {
		(yyval.scm) = unsmob_duration ((yyval.scm))->compressed ( (yyvsp[0].i)) .smobbed_copy ();
	;}
    break;

  case 278:
#line 2009 "parser.yy"
    {
		Rational  m (scm_to_int (scm_car ((yyvsp[0].scm))), scm_to_int (scm_cdr ((yyvsp[0].scm))));

		(yyval.scm) = unsmob_duration ((yyval.scm))->compressed (m).smobbed_copy ();
	;}
    break;

  case 279:
#line 2017 "parser.yy"
    { (yyval.scm) = (yyvsp[0].scm); ;}
    break;

  case 280:
#line 2018 "parser.yy"
    {
		(yyval.scm) = scm_cons (scm_from_int ((yyvsp[-2].i)), scm_from_int ((yyvsp[0].i)));
	;}
    break;

  case 281:
#line 2024 "parser.yy"
    {
		(yyval.i) = 0;
	;}
    break;

  case 282:
#line 2027 "parser.yy"
    {
		(yyval.i) ++;
	;}
    break;

  case 283:
#line 2033 "parser.yy"
    {
		(yyval.i) = 0;
	;}
    break;

  case 284:
#line 2036 "parser.yy"
    {
		if (!is_duration ((yyvsp[0].i)))
			THIS->parser_error ((yylsp[0]), _f ("not a duration: %d", (yyvsp[0].i)));
		(yyval.i) = (yyvsp[0].i);
	;}
    break;

  case 285:
#line 2044 "parser.yy"
    {
		(yyval.scm) = scm_from_int ((yyvsp[0].i));
	;}
    break;

  case 286:
#line 2047 "parser.yy"
    {
		(yyval.scm) = scm_from_int ((yyvsp[0].i));
	;}
    break;

  case 287:
#line 2050 "parser.yy"
    { (yyval.scm) = (yyvsp[0].scm); ;}
    break;

  case 288:
#line 2051 "parser.yy"
    { (yyval.scm) = (yyvsp[0].scm); ;}
    break;

  case 289:
#line 2055 "parser.yy"
    { (yyval.i) = -2; ;}
    break;

  case 290:
#line 2056 "parser.yy"
    { (yyval.i) = 2; ;}
    break;

  case 291:
#line 2057 "parser.yy"
    { (yyval.i) = 0; ;}
    break;

  case 292:
#line 2061 "parser.yy"
    {
		Music *bfr = MY_MAKE_MUSIC ("BassFigureEvent");
		(yyval.scm) = bfr->self_scm ();
		bfr->unprotect ();
		bfr->set_spot ((yylsp[0]));
	;}
    break;

  case 293:
#line 2067 "parser.yy"
    {
		Music *bfr = MY_MAKE_MUSIC ("BassFigureEvent");
		(yyval.scm) = bfr->self_scm ();

		if (scm_is_number ((yyvsp[0].scm)))
			bfr->set_property ("figure", (yyvsp[0].scm));
		else if (Text_interface::is_markup ((yyvsp[0].scm)))
			bfr->set_property ("text", (yyvsp[0].scm));

		bfr->unprotect ();
		bfr->set_spot ((yylsp[0]));
	;}
    break;

  case 294:
#line 2079 "parser.yy"
    {
		(yyval.scm) = (yyvsp[-1].scm);
		unsmob_music ((yyvsp[-1].scm))->set_property ("bracket-stop", SCM_BOOL_T);
	;}
    break;

  case 295:
#line 2083 "parser.yy"
    {
		Music *m = unsmob_music ((yyvsp[-1].scm));
		if ((yyvsp[0].i)) {
			SCM salter = m->get_property ("alteration");
			int alter = scm_is_number (salter) ? scm_to_int (salter) : 0;
			m->set_property ("alteration",
				scm_from_int (alter + (yyvsp[0].i)));
		} else {
			m->set_property ("alteration", scm_from_int (0));
		}
	;}
    break;

  case 296:
#line 2094 "parser.yy"
    {
		Music *m = unsmob_music ((yyvsp[-1].scm));
		if ((yyvsp[0].scm) == ly_symbol2scm ("plus"))
			{
			m->set_property ("augmented", SCM_BOOL_T);
			}
		else if ((yyvsp[0].scm) == ly_symbol2scm ("slash"))
			{
			m->set_property ("diminished", SCM_BOOL_T);
			}
		else if ((yyvsp[0].scm) == ly_symbol2scm ("exclamation"))
			{
			m->set_property ("no-continuation", SCM_BOOL_T);
			}
	;}
    break;

  case 297:
#line 2113 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("plus");
	;}
    break;

  case 298:
#line 2116 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("exclamation");
	;}
    break;

  case 299:
#line 2119 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("slash");
	;}
    break;

  case 300:
#line 2125 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 301:
#line 2128 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
		unsmob_music ((yyval.scm))->set_property ("bracket-start", SCM_BOOL_T);
	;}
    break;

  case 302:
#line 2135 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;
	;}
    break;

  case 303:
#line 2138 "parser.yy"
    {
		(yyval.scm) = scm_cons ((yyvsp[0].scm), (yyvsp[-1].scm));
	;}
    break;

  case 304:
#line 2144 "parser.yy"
    {
		Music *m = MY_MAKE_MUSIC ("EventChord");
		(yyvsp[-1].scm) = scm_reverse_x ((yyvsp[-1].scm), SCM_EOL);
		m->set_property ("elements", (yyvsp[-1].scm));
		(yyval.scm) = m->self_scm ();
	;}
    break;

  case 305:
#line 2154 "parser.yy"
    { (yyval.i) = 0; ;}
    break;

  case 306:
#line 2155 "parser.yy"
    { (yyval.i) = 1; ;}
    break;

  case 307:
#line 2159 "parser.yy"
    {
		if (!THIS->lexer_->is_note_state ())
			THIS->parser_error ((yylsp[-5]), _ ("have to be in Note mode for notes"));

		Music *n = 0;
		if ((yyvsp[0].i))
			n = MY_MAKE_MUSIC ("RestEvent");
		else
			n = MY_MAKE_MUSIC ("NoteEvent");
		
		n->set_property ("pitch", (yyvsp[-5].scm));
		n->set_property ("duration", (yyvsp[-1].scm));

		if (scm_is_number ((yyvsp[-2].scm)))
		{
			int q = scm_to_int ((yyvsp[-2].scm));
			n->set_property ("absolute-octave", scm_from_int (q-1));
		}

		if ((yyvsp[-3].i) % 2)
			n->set_property ("cautionary", SCM_BOOL_T);
		if ((yyvsp[-4].i) % 2 || (yyvsp[-3].i) % 2)
			n->set_property ("force-accidental", SCM_BOOL_T);

		Music *v = MY_MAKE_MUSIC ("EventChord");
		v->set_property ("elements", scm_list_1 (n->self_scm ()));
		n->unprotect ();

		v->set_spot ((yyloc));
		n->set_spot ((yyloc));
		(yyval.music) = v;
	;}
    break;

  case 308:
#line 2191 "parser.yy"
    {
		Music *n = MY_MAKE_MUSIC ("NoteEvent");
		n->set_property ("duration", (yyvsp[0].scm));
		n->set_property ("drum-type", (yyvsp[-1].scm));

		Music *v = MY_MAKE_MUSIC ("EventChord");
		v->set_property ("elements", scm_list_1 (n->self_scm ()));
		n->unprotect ();
		v->set_spot ((yyloc));
		n->set_spot ((yyloc));
		(yyval.music) = v;
		
	;}
    break;

  case 309:
#line 2204 "parser.yy"
    {
		Music *m = unsmob_music ((yyvsp[-1].scm));
		m->set_spot ((yyloc));
		for (SCM s = m->get_property ("elements"); scm_is_pair (s); s = scm_cdr (s))
		{
			unsmob_music (scm_car (s))->set_property ("duration", (yyvsp[0].scm));
		}
		(yyval.music) = m;
	;}
    break;

  case 310:
#line 2213 "parser.yy"
    {
		Music *ev = 0;
 		if (ly_scm2string ((yyvsp[-1].scm)) == "s") {
			/* Space */
			ev = MY_MAKE_MUSIC ("SkipEvent");
		  }
		else {
			ev = MY_MAKE_MUSIC ("RestEvent");
		
		    }
		ev->set_property ("duration", (yyvsp[0].scm));
		ev->set_spot ((yyloc));
 		Music *velt = MY_MAKE_MUSIC ("EventChord");
		velt->set_property ("elements", scm_list_1 (ev->self_scm ()));
		velt->set_spot ((yyloc));

		ev->unprotect();

 		(yyval.music) = velt;
	;}
    break;

  case 311:
#line 2233 "parser.yy"
    {
		SCM proc = ly_lily_module_constant ("make-multi-measure-rest");
		SCM mus = scm_call_2 (proc, (yyvsp[0].scm), make_input ((yyloc)));
		(yyval.music) = unsmob_music (mus);
		(yyval.music)->protect ();
	;}
    break;

  case 312:
#line 2240 "parser.yy"
    {
		if (!THIS->lexer_->is_lyric_state ())
			THIS->parser_error ((yylsp[-1]), _ ("have to be in Lyric mode for lyrics"));

		Music *levent = MY_MAKE_MUSIC ("LyricEvent");
		levent->set_property ("text", (yyvsp[-1].scm));
		levent->set_property ("duration",(yyvsp[0].scm));
		levent->set_spot ((yyloc));
		Music *velt = MY_MAKE_MUSIC ("EventChord");
		velt->set_property ("elements", scm_list_1 (levent->self_scm ()));

		(yyval.music)= velt;
	;}
    break;

  case 313:
#line 2253 "parser.yy"
    {
                if (!THIS->lexer_->is_chord_state ())
                        THIS->parser_error ((yylsp[0]), _ ("have to be in Chord mode for chords"));
                (yyval.music) = unsmob_music ((yyvsp[0].scm));
	;}
    break;

  case 314:
#line 2261 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 315:
#line 2264 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 316:
#line 2270 "parser.yy"
    {
		(yyval.scm) = make_chord ((yyvsp[-1].scm), (yyvsp[0].scm), SCM_EOL);
	;}
    break;

  case 317:
#line 2273 "parser.yy"
    {
		SCM its = scm_reverse_x ((yyvsp[0].scm), SCM_EOL);
		(yyval.scm) = make_chord ((yyvsp[-3].scm), (yyvsp[-2].scm), scm_cons ((yyvsp[-1].scm), its));
	;}
    break;

  case 318:
#line 2280 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;		
	;}
    break;

  case 319:
#line 2283 "parser.yy"
    {
		(yyval.scm) = scm_cons ((yyvsp[0].scm), (yyval.scm));
	;}
    break;

  case 320:
#line 2289 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("chord-colon");
	;}
    break;

  case 321:
#line 2292 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("chord-caret");
	;}
    break;

  case 322:
#line 2295 "parser.yy"
    {
 		(yyval.scm) = scm_list_2 (ly_symbol2scm ("chord-slash"), (yyvsp[0].scm));
	;}
    break;

  case 323:
#line 2298 "parser.yy"
    {
		(yyval.scm) = scm_list_2 (ly_symbol2scm ("chord-bass"), (yyvsp[0].scm));
	;}
    break;

  case 324:
#line 2304 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 325:
#line 2307 "parser.yy"
    {
		(yyval.scm) = scm_reverse_x ((yyvsp[0].scm), SCM_EOL);
	;}
    break;

  case 326:
#line 2310 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 327:
#line 2316 "parser.yy"
    { (yyval.scm) = scm_cons ((yyvsp[0].scm), SCM_EOL); ;}
    break;

  case 328:
#line 2317 "parser.yy"
    {
		(yyval.scm) = scm_cons ((yyvsp[0].scm), (yyval.scm));
	;}
    break;

  case 329:
#line 2323 "parser.yy"
    {
		(yyval.scm) = make_chord_step ((yyvsp[0].i), 0);
        ;}
    break;

  case 330:
#line 2326 "parser.yy"
    {
		(yyval.scm) = make_chord_step ((yyvsp[-1].i), SHARP);
	;}
    break;

  case 331:
#line 2329 "parser.yy"
    {
		(yyval.scm) = make_chord_step ((yyvsp[-1].i), FLAT);
	;}
    break;

  case 332:
#line 2341 "parser.yy"
    {
		(yyval.scm) = scm_sum ((yyvsp[-2].scm), (yyvsp[0].scm));
	;}
    break;

  case 333:
#line 2344 "parser.yy"
    {
		(yyval.scm) = scm_difference ((yyvsp[-2].scm), (yyvsp[0].scm));
	;}
    break;

  case 335:
#line 2351 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 336:
#line 2354 "parser.yy"
    {
		(yyval.scm) = scm_product ((yyvsp[-2].scm), (yyvsp[0].scm));
	;}
    break;

  case 337:
#line 2357 "parser.yy"
    {
		(yyval.scm) = scm_divide ((yyvsp[-2].scm), (yyvsp[0].scm));
	;}
    break;

  case 338:
#line 2363 "parser.yy"
    { /* %prec UNARY_MINUS */
		(yyval.scm) = scm_difference ((yyvsp[0].scm), SCM_UNDEFINED);
	;}
    break;

  case 340:
#line 2371 "parser.yy"
    {
		(yyval.scm) = scm_from_int ((yyvsp[0].i));
	;}
    break;

  case 341:
#line 2374 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 342:
#line 2377 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 343:
#line 2380 "parser.yy"
    {
		(yyval.scm) = scm_from_double (scm_to_double ((yyvsp[-1].scm)) *scm_to_double ((yyvsp[0].scm)));
	;}
    break;

  case 344:
#line 2383 "parser.yy"
    {
		(yyval.scm) = scm_from_double ((yyvsp[-1].i) *scm_to_double ((yyvsp[0].scm)));
	;}
    break;

  case 345:
#line 2390 "parser.yy"
    {
			(yyval.i) = (yyvsp[0].i);
	;}
    break;

  case 346:
#line 2393 "parser.yy"
    {
		(yyval.i) = (yyvsp[0].i);
	;}
    break;

  case 347:
#line 2399 "parser.yy"
    { (yyval.i) = 0; ;}
    break;

  case 348:
#line 2400 "parser.yy"
    { (yyval.i) ++; ;}
    break;

  case 349:
#line 2404 "parser.yy"
    { (yyval.i) = 0; ;}
    break;

  case 350:
#line 2405 "parser.yy"
    { (yyval.i) ++; ;}
    break;

  case 351:
#line 2413 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 352:
#line 2417 "parser.yy"
    { THIS->lexer_->push_markup_state (); ;}
    break;

  case 353:
#line 2418 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
		THIS->lexer_->pop_state ();
	;}
    break;

  case 354:
#line 2425 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 355:
#line 2429 "parser.yy"
    { THIS->lexer_->push_markup_state (); ;}
    break;

  case 356:
#line 2430 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
		THIS->lexer_->pop_state ();
	;}
    break;

  case 357:
#line 2437 "parser.yy"
    { 
		(yyval.scm) = scm_list_2 (ly_lily_module_constant ("line-markup"),  (yyvsp[0].scm)); 
	;}
    break;

  case 358:
#line 2440 "parser.yy"
    {
		(yyval.scm) = scm_car (scm_call_2 (ly_lily_module_constant ("map-markup-command-list"), (yyvsp[-1].scm), scm_list_1 ((yyvsp[0].scm))));
	;}
    break;

  case 359:
#line 2443 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 360:
#line 2449 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 361:
#line 2452 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 362:
#line 2458 "parser.yy"
    {
		(yyval.scm) = scm_call_2 (ly_lily_module_constant ("map-markup-command-list"), (yyvsp[-1].scm), (yyvsp[0].scm));
		
	;}
    break;

  case 363:
#line 2465 "parser.yy"
    {
		(yyval.scm) = scm_reverse_x ((yyvsp[-1].scm), SCM_EOL);
	;}
    break;

  case 364:
#line 2471 "parser.yy"
    {  (yyval.scm) = SCM_EOL; ;}
    break;

  case 365:
#line 2472 "parser.yy"
    {
		(yyval.scm) = scm_cons ((yyvsp[0].scm), (yyvsp[-1].scm));
	;}
    break;

  case 366:
#line 2475 "parser.yy"
    {
		(yyval.scm) = scm_append_x (scm_list_2 (scm_reverse_x ((yyvsp[0].scm), SCM_EOL), (yyvsp[-1].scm)));
	;}
    break;

  case 367:
#line 2481 "parser.yy"
    {
		(yyval.scm) = scm_list_1 ((yyvsp[0].scm));
	;}
    break;

  case 368:
#line 2484 "parser.yy"
    {
		(yyval.scm) = scm_list_2 ((yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 369:
#line 2487 "parser.yy"
    {
		(yyval.scm) = scm_list_3 ((yyvsp[-2].scm), (yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 370:
#line 2493 "parser.yy"
    {
		(yyval.scm) = scm_list_1 ((yyvsp[0].scm));
	;}
    break;

  case 371:
#line 2496 "parser.yy"
    {
		(yyval.scm) = scm_cons ((yyvsp[0].scm), (yyvsp[-1].scm));
	;}
    break;

  case 372:
#line 2502 "parser.yy"
    {
		(yyval.scm) = make_simple_markup ((yyvsp[0].scm));
	;}
    break;

  case 373:
#line 2505 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 374:
#line 2508 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 375:
#line 2511 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 376:
#line 2514 "parser.yy"
    {
		SCM nn = THIS->lexer_->lookup_identifier ("pitchnames");
		THIS->lexer_->push_note_state (alist_to_hashq (nn));
	;}
    break;

  case 377:
#line 2517 "parser.yy"
    {
		Score * sc = (yyvsp[-1].score);
		(yyval.scm) = scm_list_2 (ly_lily_module_constant ("score-markup"), sc->self_scm ());
		sc->unprotect ();
		THIS->lexer_->pop_state ();
	;}
    break;

  case 378:
#line 2523 "parser.yy"
    {
		(yyval.scm) = scm_list_2 ((yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 379:
#line 2526 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-3].scm), (yyvsp[-2].scm), (yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 380:
#line 2529 "parser.yy"
    {
		(yyval.scm) = scm_list_3 ((yyvsp[-2].scm), (yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 381:
#line 2532 "parser.yy"
    {
		(yyval.scm) = scm_list_1 ((yyvsp[0].scm));
	;}
    break;

  case 382:
#line 2535 "parser.yy"
    {
		(yyval.scm) = scm_list_2 ((yyvsp[-1].scm),(yyvsp[0].scm));
	;}
    break;

  case 383:
#line 2538 "parser.yy"
    {
		(yyval.scm) = scm_list_3 ((yyvsp[-2].scm), (yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 384:
#line 2544 "parser.yy"
    {
		SCM mapper = ly_lily_module_constant ("map-markup-command-list");
		(yyval.scm) = scm_car (scm_call_2 (mapper, (yyvsp[-1].scm), scm_list_1 ((yyvsp[0].scm))));
	;}
    break;

  case 385:
#line 2548 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;


      default: break;
    }

/* Line 1052 of yacc.c.  */
#line 5473 "out/parser.cc"

  yyvsp -= yylen;
  yyssp -= yylen;
  yylsp -= yylen;

  YY_STACK_PRINT (yyss, yyssp);

  *++yyvsp = yyval;
  *++yylsp = yyloc;

  /* 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)
	{
	  int yytype = YYTRANSLATE (yychar);
	  YYSIZE_T yysize0 = yystrlen (yytname[yytype]);
	  YYSIZE_T yysize = yysize0;
	  YYSIZE_T yysize1;
	  int yysize_overflow = 0;
	  char *yymsg = 0;
#	  define YYERROR_VERBOSE_ARGS_MAXIMUM 5
	  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
	  int yyx;

#if 0
	  /* This is so xgettext sees the translatable formats that are
	     constructed on the fly.  */
	  _("syntax error, unexpected %s");
	  _("syntax error, unexpected %s, expecting %s");
	  _("syntax error, unexpected %s, expecting %s or %s");
	  _("syntax error, unexpected %s, expecting %s or %s or %s");
	  _("syntax error, unexpected %s, expecting %s or %s or %s or %s");
#endif
	  char *yyfmt;
	  char const *yyf;
	  static char const yyunexpected[] = "syntax error, unexpected %s";
	  static char const yyexpecting[] = ", expecting %s";
	  static char const yyor[] = " or %s";
	  char yyformat[sizeof yyunexpected
			+ sizeof yyexpecting - 1
			+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
			   * (sizeof yyor - 1))];
	  char const *yyprefix = yyexpecting;

	  /* Start YYX at -YYN if negative to avoid negative indexes in
	     YYCHECK.  */
	  int yyxbegin = yyn < 0 ? -yyn : 0;

	  /* Stay within bounds of both yycheck and yytname.  */
	  int yychecklim = YYLAST - yyn;
	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
	  int yycount = 1;

	  yyarg[0] = yytname[yytype];
	  yyfmt = yystpcpy (yyformat, yyunexpected);

	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
	      {
		if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
		  {
		    yycount = 1;
		    yysize = yysize0;
		    yyformat[sizeof yyunexpected - 1] = '\0';
		    break;
		  }
		yyarg[yycount++] = yytname[yyx];
		yysize1 = yysize + yystrlen (yytname[yyx]);
		yysize_overflow |= yysize1 < yysize;
		yysize = yysize1;
		yyfmt = yystpcpy (yyfmt, yyprefix);
		yyprefix = yyor;
	      }

	  yyf = _(yyformat);
	  yysize1 = yysize + strlen (yyf);
	  yysize_overflow |= yysize1 < yysize;
	  yysize = yysize1;

	  if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
	    yymsg = (char *) YYSTACK_ALLOC (yysize);
	  if (yymsg)
	    {
	      /* Avoid sprintf, as that infringes on the user's name space.
		 Don't have undefined behavior even if the translation
		 produced a string with the wrong number of "%s"s.  */
	      char *yyp = yymsg;
	      int yyi = 0;
	      while ((*yyp = *yyf))
		{
		  if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
		    {
		      yyp = yystpcpy (yyp, yyarg[yyi++]);
		      yyf += 2;
		    }
		  else
		    {
		      yyp++;
		      yyf++;
		    }
		}
	      yyerror (yymsg);
	      YYSTACK_FREE (yymsg);
	    }
	  else
	    yyerror (_("syntax error; also memory exhausted"));
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror (_("syntax error"));
    }

  yyerror_range[0] = yylloc;

  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse look-ahead token after an
	 error, discard it.  */

      if (yychar <= YYEOF)
        {
          /* If at end of input, pop the error token,
	     then the rest of the stack, then return failure.  */
	  if (yychar == YYEOF)
	     for (;;)
	       {
                 yyerror_range[0] = *yylsp;
		 YYPOPSTACK;
		 if (yyssp == yyss)
		   YYABORT;
		 yydestruct (_("Error: popping"),
                             yystos[*yyssp], yyvsp, yylsp);
	       }
        }
      else
	{
	  yydestruct (_("Error: discarding"), yytoken, &yylval, &yylloc);
	  yychar = YYEMPTY;
	}
    }

  /* Else will try to reuse look-ahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:

  /* Pacify compilers like GCC when the user code never invokes
     YYERROR and the label yyerrorlab therefore never appears in user
     code.  */
  if (0)
     goto yyerrorlab;

  yyerror_range[0] = yylsp[1-yylen];
  yylsp -= yylen;
  yyvsp -= yylen;
  yyssp -= yylen;
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  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;

      yyerror_range[0] = *yylsp;
      yydestruct (_("Error: popping"), yystos[yystate], yyvsp, yylsp);
      YYPOPSTACK;
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  if (yyn == YYFINAL)
    YYACCEPT;

  *++yyvsp = yylval;

  yyerror_range[1] = yylloc;
  /* Using YYLLOC is tempting, but would change the location of
     the look-ahead.  YYLOC is available though. */
  YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
  *++yylsp = yyloc;

  /* Shift the error token. */
  YY_SYMBOL_PRINT (_("Shifting"), yystos[yyn], yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yydestruct (_("Error: discarding lookahead"),
              yytoken, &yylval, &yylloc);
  yychar = YYEMPTY;
  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 2553 "parser.yy"


void
Lily_parser::set_yydebug (bool )
{
#if 0
	yydebug = 1;
#endif
}

void
Lily_parser::do_yyparse ()
{
	yyparse ((void*)this);
}





/*

It is a little strange to have this function in this file, but
otherwise, we have to import music classes into the lexer.

*/
int
Lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
{
	if (scm_is_string (sid)) {
		*destination = sid;
		return STRING_IDENTIFIER;
	} else if (unsmob_book (sid)) {
		*destination = unsmob_book (sid)->clone ()->self_scm ();
		return BOOK_IDENTIFIER;
	} else if (scm_is_number (sid)) {
		*destination = sid;
		return NUMBER_IDENTIFIER;
	} else if (unsmob_context_def (sid)) {
		*destination = unsmob_context_def (sid)->clone_scm ();
		return CONTEXT_DEF_IDENTIFIER;
	} else if (unsmob_score (sid)) {
		Score *score = new Score (*unsmob_score (sid));
		*destination = score->self_scm ();
		return SCORE_IDENTIFIER;
	} else if (Music *mus = unsmob_music (sid)) {
		mus = mus->clone ();
		*destination = mus->self_scm ();
		unsmob_music (*destination)->
			set_property ("origin", make_input (last_input_));

		bool is_event = scm_memq (ly_symbol2scm ("event"), mus->get_property ("types"))
			!= SCM_BOOL_F;

		return is_event ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
	} else if (unsmob_duration (sid)) {
		*destination = unsmob_duration (sid)->smobbed_copy ();
		return DURATION_IDENTIFIER;
	} else if (unsmob_output_def (sid)) {
		Output_def *p = unsmob_output_def (sid);
		p = p->clone ();

		*destination = p->self_scm ();
		return OUTPUT_DEF_IDENTIFIER;
	} else if (Text_interface::is_markup (sid)) {
		*destination = sid;
		if (is_lyric_state ())
			return LYRIC_MARKUP_IDENTIFIER;
		return MARKUP_IDENTIFIER;
	}

	return -1;	
}

Music *
property_op_to_music (SCM op)
{
	Music *m = 0;
	SCM tag = scm_car (op);
	SCM symbol = scm_cadr (op);
	SCM args = scm_cddr (op);
	SCM grob_val = SCM_UNDEFINED;
	SCM grob_path = SCM_UNDEFINED;
	SCM val = SCM_UNDEFINED;
	
	if (tag == ly_symbol2scm ("assign"))
		{
		m = MY_MAKE_MUSIC ("PropertySet");
		val = scm_car (args);
		}
	else if (tag == ly_symbol2scm ("unset"))
		m = MY_MAKE_MUSIC ("PropertyUnset");
	else if (tag == ly_symbol2scm ("push"))
		{
		m = MY_MAKE_MUSIC ("OverrideProperty");
		grob_val = scm_car (args);
		grob_path = scm_cdr (args);
		m->set_property ("pop-first", SCM_BOOL_T);
		}
	else if (tag == ly_symbol2scm ("pop")) {
		m = MY_MAKE_MUSIC ("RevertProperty");
		grob_path = args;
		}

	m->set_property ("symbol", symbol);

	if (val != SCM_UNDEFINED)
		m->set_property ("value", val);
	if (grob_val != SCM_UNDEFINED)
		m->set_property ("grob-value", grob_val);
	if (grob_path != SCM_UNDEFINED)
		m->set_property ("grob-property-path", grob_path);

	return m;
}

Music*
context_spec_music (SCM type, SCM id, Music *m, SCM ops)
{
	Music *csm = MY_MAKE_MUSIC ("ContextSpeccedMusic");

	csm->set_property ("element", m->self_scm ());
	m->unprotect ();

	csm->set_property ("context-type",
		scm_is_symbol (type) ? type : scm_string_to_symbol (type));
	csm->set_property ("property-operations", ops);

	if (scm_is_string (id))
		csm->set_property ("context-id", id);
	return csm;
}

SCM
get_next_unique_context_id ()
{
	return scm_makfrom0str ("$uniqueContextId");
}


SCM
get_next_unique_lyrics_context_id ()
{
	static int new_context_count;
	char s[128];
	snprintf (s, sizeof (s)-1, "uniqueContext%d", new_context_count++);
	return scm_makfrom0str (s);
}


Music *
run_music_function (Lily_parser *parser, SCM expr)
{
	SCM func = scm_car (expr);
	Input *loc = unsmob_input (scm_cadr (expr));
	SCM args = scm_cddr (expr);
	SCM sig = scm_object_property (func, ly_symbol2scm ("music-function-signature"));

	SCM type_check_proc = ly_lily_module_constant ("type-check-list");
	bool ok  = true;

	if (!to_boolean (scm_call_3  (type_check_proc, scm_cadr (expr), sig, args)))
	{
		parser->error_level_ = 1;
		ok = false;
	}

	SCM m = SCM_EOL;
	if (ok)
		m = scm_apply_0 (func, scm_cons (parser->self_scm(),
						 scm_cdr (expr)));


	Music* retval = 0;
	if (unsmob_music (m))
		{
		retval = unsmob_music (m);
		retval->protect ();
		}
	else
		{
		if (ok)
			loc->error (_ ("music head function must return Music object")); 
		retval = MY_MAKE_MUSIC ("Music");
		}
	retval->set_spot (*loc);
	return retval;
}

bool
is_regular_identifier (SCM id)
{
  String str = ly_scm2string (id);
  char const *s = str.to_str0 ();

  bool v = true;
#if 0
  isalpha (*s);
  s++;
#endif
  while (*s && v)
   {
        v = v && isalnum (*s);
        s++;
   }
  return v;
}


SCM
get_first_context_id (SCM type, Music *m)
{
	SCM id = m->get_property ("context-id");
	if (SCM_BOOL_T == scm_equal_p (m->get_property ("context-type"), type)
	    && scm_is_string (m->get_property ("context-id"))
	    && scm_c_string_length (id) > 0)
	{
		return id;
	}
	return SCM_EOL;
}

SCM
make_simple_markup (SCM a)
{
	return a;
}

bool
is_duration (int t)
{
  return t && t == 1 << intlog2 (t);
}

void
set_music_properties (Music *p, SCM a)
{
  for (SCM k = a; scm_is_pair (k); k = scm_cdr (k))
 	p->internal_set_property (scm_caar (k), scm_cdar (k));
}


SCM
make_chord_step (int step, int alter)
{
	if (step == 7)
		alter += FLAT;

	while (step < 0)
		step += 7;
	Pitch m ((step -1) / 7, (step - 1) % 7, alter);
	return m.smobbed_copy ();
}


SCM
make_chord (SCM pitch, SCM dur, SCM modification_list)
{
	SCM chord_ctor = ly_lily_module_constant ("construct-chord");
	SCM ch = scm_call_3 (chord_ctor, pitch, dur, modification_list);

	unsmob_music (ch)->protect();	
	return ch;
}


/* Todo: actually also use apply iso. call too ...  */
bool
ly_input_procedure_p (SCM x)
{
	return ly_is_procedure (x)
		|| (scm_is_pair (x) && ly_is_procedure (scm_car (x)));
}

Music*
set_property_music (SCM sym, SCM value)
{
	Music *p = MY_MAKE_MUSIC ("PropertySet");
	p->set_property ("symbol", sym);
	p->set_property ("value", value);
	return p;
}

Music*
make_music_relative (Pitch start, Music *music)
{
	Music *relative = MY_MAKE_MUSIC ("RelativeOctaveMusic");
 	relative->set_property ("element", music->self_scm ());
	
 	Pitch last = music->to_relative_octave (start);
 	if (lily_1_8_relative)
 		music->set_property ("last-pitch", last.smobbed_copy ());
	return relative;
}

Music *
make_lyric_combine_music (SCM name, Music *music)
{
	Music *combine = MY_MAKE_MUSIC ("LyricCombineMusic");
	combine->set_property ("element", music->self_scm ());
 	combine->set_property ("associated-context", name);
	return combine;
}


int
yylex (YYSTYPE *s, YYLTYPE *loc, void *v)
{
	Lily_parser *pars = (Lily_parser*) v;
	Lily_lexer *lex = pars->lexer_;

	lex->lexval = (void*) s;
	lex->lexloc = loc;
	lex->prepare_for_next_token ();
	return lex->yylex ();
}


