/* A Bison parser, made by GNU Bison 2.1.  */

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, 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

/* Bison version.  */
#define YYBISON_VERSION "2.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
/* Tokens.  */
#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 "file-path.hh"
#include "input-smob.hh"
#include "input.hh"
#include "international.hh"
#include "lily-guile.hh"
#include "lily-lexer.hh"
#include "lily-parser.hh"
#include "lilypond-input-version.hh"
#include "main.hh"
#include "misc.hh"
#include "music.hh"
#include "music.hh"
#include "output-def.hh"
#include "paper-book.hh"
#include "program-option.hh"
#include "scm-hash.hh"
#include "score.hh"
#include "text-interface.hh"
#include "warn.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

/* Enabling the token table.  */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif

#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 100 "parser.yy"
typedef union YYSTYPE {
	Book *book;
	Output_def *outputdef;
	SCM scm;
	std::string *string;
 	Music *music;
 	Score *score;
 	int i;
} YYSTYPE;
/* Line 196 of yacc.c.  */
#line 429 "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 110 "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, bool create_new);
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 219 of yacc.c.  */
#line 487 "out/parser.cc"

#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) && (defined (__STDC__) || defined (__cplusplus))
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif

#ifndef YY_
# if YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(msgid) msgid
# endif
#endif

#if ! defined (yyoverflow) || YYERROR_VERBOSE

/* 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
#    if defined (__STDC__) || defined (__cplusplus)
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#     define YYINCLUDED_STDLIB_H
#    endif
#   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
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
#  endif
# else
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
#  endif
#  ifdef __cplusplus
extern "C" {
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
#   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
	&& (defined (__STDC__) || defined (__cplusplus)))
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
#   if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
	&& (defined (__STDC__) || defined (__cplusplus)))
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifdef __cplusplus
}
#  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   1894

/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS  161
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS  131
/* YYNRULES -- Number of rules. */
#define YYNRULES  384
/* YYNRULES -- Number of states. */
#define YYNSTATES  568

/* 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,    38,    41,
      46,    48,    50,    54,    56,    58,    60,    62,    64,    66,
      68,    70,    72,    74,    76,    78,    83,    84,    86,    90,
      93,    98,    99,   101,   104,   107,   110,   113,   116,   119,
     124,   126,   128,   131,   134,   137,   140,   142,   145,   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,   305,   308,   310,   316,   322,   326,   328,   333,   336,
     340,   342,   344,   346,   348,   350,   352,   354,   356,   358,
     360,   362,   366,   369,   370,   374,   375,   380,   383,   384,
     389,   394,   398,   401,   407,   414,   418,   420,   422,   424,
     426,   428,   430,   432,   434,   436,   438,   441,   443,   447,
     453,   460,   464,   469,   472,   475,   477,   479,   483,   485,
     487,   489,   491,   493,   495,   497,   499,   501,   502,   506,
     508,   510,   514,   516,   518,   520,   522,   526,   527,   530,
     536,   539,   541,   543,   546,   550,   555,   557,   560,   562,
     564,   566,   568,   571,   574,   577,   580,   582,   585,   587,
     590,   594,   595,   598,   601,   605,   610,   612,   615,   617,
     619,   622,   625,   627,   629,   631,   633,   635,   637,   639,
     641,   643,   645,   647,   649,   651,   653,   655,   657,   659,
     660,   662,   665,   668,   670,   673,   675,   678,   680,   683,
     686,   688,   691,   694,   696,   698,   700,   702,   704,   706,
     708,   710,   712,   714,   716,   718,   720,   722,   724,   726,
     728,   730,   731,   733,   736,   739,   741,   745,   749,   751,
     755,   756,   759,   761,   764,   766,   768,   770,   772,   774,
     776,   778,   780,   782,   785,   788,   791,   793,   795,   797,
     799,   802,   803,   806,   810,   811,   813,   820,   823,   826,
     829,   832,   835,   837,   839,   841,   844,   849,   850,   853,
     855,   857,   860,   863,   865,   867,   869,   871,   875,   877,
     880,   883,   887,   891,   893,   895,   899,   903,   906,   908,
     910,   912,   914,   917,   920,   922,   924,   925,   928,   929,
     932,   934,   935,   939,   941,   942,   946,   948,   951,   953,
     955,   957,   960,   964,   965,   968,   971,   973,   976,   980,
     982,   985,   987,   989,   991,   993,   994,  1000,  1003,  1008,
    1012,  1014,  1017,  1021,  1024
};

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

/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
static const unsigned short int yyrline[] =
{
       0,   433,   433,   434,   436,   438,   441,   448,   452,   455,
     461,   468,   474,   478,   495,   500,   501,   506,   510,   516,
     525,   526,   530,   550,   555,   559,   563,   567,   570,   574,
     578,   581,   584,   587,   590,   596,   603,   607,   611,   622,
     630,   639,   646,   650,   654,   659,   662,   665,   669,   675,
     681,   692,   696,   699,   702,   714,   725,   737,   746,   751,
     756,   765,   772,   776,   784,   787,   790,   800,   806,   821,
     824,   835,   838,   855,   856,   860,   863,   870,   930,   935,
     943,   949,   957,   958,   961,   962,   966,   967,   967,   976,
     977,   983,   984,   988,   989,   993,   994,   998,  1001,  1004,
    1008,  1012,  1015,  1018,  1022,  1025,  1029,  1032,  1037,  1042,
    1050,  1051,  1058,  1061,  1064,  1068,  1084,  1085,  1095,  1109,
    1120,  1121,  1125,  1131,  1138,  1143,  1151,  1158,  1164,  1169,
    1176,  1184,  1190,  1200,  1200,  1209,  1209,  1218,  1246,  1246,
    1258,  1269,  1273,  1277,  1281,  1285,  1292,  1293,  1295,  1296,
    1297,  1299,  1300,  1301,  1302,  1306,  1307,  1313,  1322,  1329,
    1336,  1343,  1351,  1358,  1364,  1374,  1377,  1380,  1385,  1388,
    1391,  1396,  1399,  1402,  1405,  1408,  1411,  1435,  1439,  1452,
    1453,  1458,  1474,  1477,  1480,  1483,  1487,  1497,  1498,  1505,
    1533,  1545,  1552,  1555,  1559,  1563,  1573,  1581,  1587,  1597,
    1607,  1611,  1621,  1630,  1641,  1648,  1658,  1661,  1665,  1668,
    1672,  1690,  1693,  1701,  1704,  1707,  1714,  1717,  1722,  1727,
    1732,  1737,  1742,  1746,  1755,  1758,  1761,  1764,  1767,  1770,
    1773,  1776,  1779,  1782,  1788,  1802,  1805,  1814,  1817,  1828,
    1829,  1830,  1831,  1835,  1838,  1844,  1847,  1853,  1856,  1861,
    1873,  1876,  1881,  1890,  1896,  1897,  1901,  1907,  1915,  1924,
    1927,  1930,  1933,  1936,  1939,  1942,  1948,  1949,  1950,  1955,
    1961,  1967,  1971,  1978,  1987,  1996,  1999,  2002,  2010,  2011,
    2017,  2020,  2026,  2029,  2037,  2040,  2043,  2044,  2048,  2049,
    2050,  2054,  2060,  2072,  2076,  2087,  2106,  2109,  2112,  2118,
    2121,  2128,  2131,  2137,  2147,  2148,  2152,  2184,  2197,  2206,
    2226,  2233,  2246,  2254,  2257,  2263,  2266,  2273,  2276,  2282,
    2285,  2288,  2291,  2297,  2300,  2303,  2309,  2310,  2316,  2319,
    2322,  2334,  2337,  2340,  2344,  2347,  2350,  2356,  2359,  2364,
    2367,  2370,  2373,  2376,  2383,  2386,  2392,  2393,  2397,  2398,
    2406,  2410,  2409,  2418,  2422,  2421,  2430,  2433,  2436,  2442,
    2445,  2451,  2458,  2464,  2465,  2468,  2474,  2477,  2480,  2486,
    2489,  2495,  2498,  2501,  2504,  2507,  2507,  2516,  2519,  2522,
    2525,  2528,  2531,  2537,  2541
};
#endif

#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[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_head_with_mode_switch", "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", "optional_id", "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",
  "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

# 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,   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,   182,   182,   182,   182,   182,   182,   183,   184,
     184,   184,   184,   185,   185,   186,   186,   187,   188,   188,
     189,   189,   190,   190,   190,   190,   191,   192,   191,   193,
     193,   194,   194,   195,   195,   196,   196,   197,   197,   197,
     197,   197,   197,   197,   197,   197,   197,   197,   197,   197,
     198,   198,   199,   199,   199,   199,   199,   199,   199,   199,
     199,   199,   200,   200,   200,   200,   200,   201,   201,   201,
     201,   202,   202,   204,   203,   205,   203,   206,   207,   206,
     208,   209,   209,   209,   209,   209,   210,   210,   210,   210,
     210,   210,   210,   210,   210,   211,   211,   212,   212,   213,
     213,   213,   213,   213,   213,   214,   214,   214,   215,   215,
     215,   216,   216,   216,   216,   216,   216,   217,   218,   218,
     218,   219,   220,   221,   222,   223,   224,   225,   225,   226,
     226,   226,   227,   227,   227,   227,   228,   228,   228,   228,
     228,   228,   228,   228,   228,   228,   229,   229,   229,   229,
     229,   230,   230,   231,   231,   231,   232,   232,   232,   232,
     232,   232,   232,   233,   234,   234,   234,   234,   234,   234,
     234,   234,   234,   234,   235,   235,   235,   236,   236,   237,
     237,   237,   237,   238,   238,   239,   239,   240,   240,   240,
     241,   241,   241,   242,   243,   243,   244,   244,   244,   245,
     245,   245,   245,   245,   245,   245,   246,   246,   246,   247,
     248,   249,   249,   250,   250,   251,   251,   251,   252,   252,
     253,   253,   254,   254,   255,   255,   255,   255,   256,   256,
     256,   257,   257,   257,   257,   257,   258,   258,   258,   259,
     259,   260,   260,   261,   262,   262,   263,   263,   263,   263,
     263,   263,   263,   264,   264,   265,   265,   266,   266,   267,
     267,   267,   267,   268,   268,   268,   269,   269,   270,   270,
     270,   271,   271,   271,   272,   272,   272,   273,   273,   274,
     274,   274,   274,   274,   275,   275,   276,   276,   277,   277,
     278,   279,   278,   280,   281,   280,   282,   282,   282,   283,
     283,   284,   285,   286,   286,   286,   287,   287,   287,   288,
     288,   289,   289,   289,   289,   290,   289,   289,   289,   289,
     289,   289,   289,   291,   291
};

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

/* YYDEFGOTO[NTERM-NUM]. */
static const short int yydefgoto[] =
{
      -1,     1,   350,    50,    51,   138,   165,   351,    54,    55,
     290,   153,   422,    56,   162,    57,   198,   322,   352,    59,
      60,    61,   124,   146,   268,   439,    62,    63,    64,   126,
     159,   312,   502,   127,    66,   139,    67,   164,    68,    69,
      70,    71,   156,   310,   424,    72,   166,   128,   498,   499,
     500,   228,   129,   223,   140,   224,   130,   131,   132,   133,
     388,    73,   315,   134,   256,   389,   390,   135,   136,   380,
     400,   470,   298,   299,   300,   413,   523,   191,   192,    95,
      96,   391,    98,   414,   415,   301,    86,   231,   257,   232,
     258,    93,   366,   302,   457,   516,   458,   517,   459,   372,
     251,   560,   252,   253,   254,   520,   466,   542,   543,   544,
     303,   304,   305,   306,   234,   378,   468,   255,   373,   226,
      82,   182,   183,   184,   185,   341,   186,   187,   334,   330,
     335
};

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
#define YYPACT_NINF -355
static const short int yypact[] =
{
    -355,  1379,  -355,  -355,   -82,  -355,  -355,   152,  -355,  -355,
    -355,  -355,   -61,  -355,  -355,  -355,  -355,   152,  -355,  -355,
    -355,  -355,  1754,   152,   -33,   -11,     8,    67,   -71,   152,
    -355,  -355,  -355,  -355,  -355,    19,    19,    19,    19,  1624,
    1624,   105,   105,   105,   105,   105,   105,  -355,  -355,  -355,
    -355,  -355,  -355,  -355,   -72,  -355,  -355,  -355,  -355,  -355,
      22,    94,  -355,  -355,  -355,  -355,   120,  -355,  -355,    72,
     126,  -355,  -355,  -355,  -355,    77,  -355,  -355,  -355,    59,
    -355,  -355,  1347,   -17,  -355,  -355,  1624,     5,  1494,  -355,
    -355,    52,  -355,  1624,   -17,  -355,  -355,  -355,   -71,    59,
    -355,    19,  1624,  1624,    82,    30,   257,   294,   152,   141,
     152,   152,   141,   141,    95,   152,    67,  -355,  -355,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,
     701,  -355,  -355,  -355,   141,  -355,  -355,  1624,  -355,  -355,
    -355,  1624,  1624,   105,   105,   105,   698,   547,   107,  -355,
      89,  -355,  -355,  -355,  -355,  -355,   247,  -355,  -355,    72,
     834,  -355,    49,   152,   126,   131,  1624,  -355,  -355,  -355,
     157,  -355,  1487,    29,    29,    29,    29,    29,  -355,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,  -355,  1347,  -355,  -355,
    -355,   104,   109,  -355,  -355,  -355,  1624,  -355,   100,  -355,
     970,  1106,   176,  -355,   104,   109,  1624,   126,  -355,  -355,
    1624,   132,  -355,   144,  -355,  -355,   156,  -355,  -355,   161,
    -355,  -355,  -355,   158,  -355,  -355,  -355,  -355,    29,   162,
    -355,  -355,  -355,   151,  -355,    29,   166,  -355,   170,  -355,
    -355,  -355,  -355,  -355,   141,   141,  -355,  -355,   141,   141,
    -355,   141,  -355,   141,  -355,  -355,   529,  -355,   151,  -355,
    -355,  1624,  -355,  1624,   105,  -355,  -355,  -355,  -355,   110,
    -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,
     192,  -355,  -355,  -355,  -355,  -355,  -355,  -355,     5,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,   158,  -355,  -355,  -355,
    -355,   328,  -355,   165,  -355,    21,  -355,  -355,  -355,   205,
      72,  -355,   175,  -355,  -355,  -355,  -355,   185,  -355,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,  1624,  -355,  -355,  -355,
     187,  -355,   157,  1487,  -355,  1487,  -355,  -355,    29,    29,
      29,   406,  -355,  -355,  -355,  -355,  -355,   314,  -355,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,  -355,  1624,  -355,   191,
    -355,  -355,  -355,   108,    10,   152,   186,   169,   186,  -355,
     369,     5,   293,  1347,  -355,  -355,  -355,   296,   171,  -355,
    1681,  -355,  -355,  -355,   522,   105,   105,  -355,  -355,  -355,
    -355,  -355,  1681,  -355,  -355,  -355,  1681,   105,   105,   -37,
    -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,
    -355,   158,  -355,  -355,  -355,  -355,  -355,   -37,   -37,   -37,
     -37,  -355,    45,  -355,    72,  -355,  -355,  -355,  1494,  -355,
    -355,  -355,  -355,    29,  -355,  -355,  1347,  -355,   188,  -355,
    -355,  -355,  -355,   369,   194,  -355,  -355,  -355,  -355,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,   164,  -355,    66,  -355,
    -355,  -355,   204,  -355,  -355,   204,  -355,  -355,   -94,    97,
    -355,  1681,  -355,   522,   105,   171,  -355,  1681,   105,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,    29,
    -355,   152,  -355,   152,  -355,   152,   207,  -355,  -355,   213,
    -355,  -355,   274,   183,  -355,  -355,  -355,   369,    66,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,
     331,   -17,  -355,   141,  -355,   522,   -94,  -355,  1681,  -355,
      29,    29,  -355,   369,  -355,  -355,  -355,  -355,  1242,  -355,
    -355,  -355,  -355,   208,  -355,   -18,   104,   109,   310,  -355,
    -355,  -355,    11,  -355,  -355,  -355,     5,  -355,  -355,  -355,
    -355,  1681,    29,   222,  -355,  -355,    29,  -355
};

/* YYPGOTO[NTERM-NUM].  */
static const short int yypgoto[] =
{
    -355,  -355,   210,  -355,  -355,    -1,  -355,    34,  -355,   -16,
    -355,   223,  -355,   226,  -355,   -90,   -51,  -355,    36,  -355,
    -355,  -355,   317,   -70,   -15,  -355,  -355,  -355,  -355,  -355,
     -89,  -355,  -355,    54,   -53,   -31,  -355,   280,  -355,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,  -355,
    -121,   184,   276,  -114,     0,  -327,  -355,  -355,  -355,  -355,
    -355,  -355,  -355,  -355,  -355,  -354,  -355,  -355,  -355,  -249,
    -355,  -142,  -355,  -355,    87,  -355,  -136,   -92,   -85,   374,
    -112,    40,   301,  -355,  -355,  -355,  -355,   297,  -217,   298,
     -28,   290,   178,  -355,  -355,  -355,   -46,  -355,  -355,  -355,
    -355,  -355,  -355,  -355,  -355,  -355,  -106,  -355,  -355,  -140,
    -355,  -139,  -231,  -100,   -86,    27,   -54,  -355,  -355,     3,
    -355,    46,  -149,  -355,  -165,  -355,  -177,  -128,   -56,  -355,
    -274
};

/* 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 -178
static const short int yytable[] =
{
      52,   196,   204,   160,    74,   297,   225,    79,   392,   205,
     343,   141,   142,   143,   144,   145,   157,    81,   249,   200,
     201,   331,   342,    87,   125,   137,   188,   374,   375,    99,
     472,   376,   377,   296,   379,    53,   381,    58,   100,   101,
     102,   103,   332,   449,   333,   152,   212,   557,   521,   401,
     316,   483,    18,   484,   216,    65,    83,   293,    75,   485,
      52,   430,   486,   487,   488,    94,   522,   437,    97,   489,
     147,   193,   321,   199,    12,   326,    84,    14,   203,    80,
     490,   233,    18,    19,   233,   491,   317,   209,   210,   492,
      21,   218,   493,   219,   194,   149,   195,    24,    31,    31,
     399,   348,   494,   495,   208,   222,   313,    88,   229,   150,
     229,   229,   262,   263,   264,   229,   506,    31,   357,   524,
     558,    25,   259,    26,   155,    12,   260,   261,    14,    89,
      33,   344,   295,   471,    19,   189,   190,   317,    97,   509,
      30,    21,    47,    47,   510,   267,   289,   113,    90,   328,
     307,   329,   443,   562,   239,   343,   343,   213,    91,   267,
      33,    47,   148,   325,    52,   324,    92,   342,   401,   161,
     250,   549,   336,   337,   338,   339,   340,   419,   420,   496,
     539,   347,    31,   294,   348,   158,   497,   411,   481,   482,
     318,   356,   435,    31,    32,   358,   320,    18,   323,   267,
     267,   163,   402,   511,   512,    76,   554,   333,    12,   202,
      76,    14,    49,   436,   513,   396,   211,    19,   397,    31,
     317,   398,    83,   514,    21,   515,    47,   364,    48,   309,
     194,    32,   195,   395,   369,   151,   308,    47,   230,    77,
      78,   349,   220,   221,    77,    78,   393,   452,   394,   442,
     309,   311,    76,   453,   476,   454,   345,   423,   194,   343,
     195,   171,   346,    47,   174,    48,   176,   355,   447,    79,
     225,   342,   327,   214,   359,    33,   360,   429,   479,   480,
     483,   448,   484,   216,   361,   450,    77,    78,   485,   362,
      18,   486,   487,   488,   235,   236,   363,   181,   455,   240,
     421,   561,   417,   418,   416,   365,   548,   367,   370,   490,
     396,   427,   371,   397,   491,   425,   398,   188,   492,   426,
     218,   493,   219,   438,   537,   441,    18,   428,   505,   446,
     467,   494,   495,   107,   108,   527,   507,   431,   432,   433,
      94,   110,   440,   225,   111,    31,   215,   534,   216,   533,
     518,   556,   115,   519,   473,   474,   559,   217,   462,   463,
     464,    18,   465,   444,   566,   445,   477,   478,    33,   222,
     291,   501,   319,   292,   451,   460,   452,   503,   154,   207,
     429,   536,   453,   227,   454,   218,   551,   219,   412,    47,
     550,   220,   221,   462,   463,   464,    85,   465,   270,   206,
     271,   272,    18,   273,    33,   274,   241,   225,   496,   237,
     508,   238,   368,   199,   541,   535,   564,   403,   475,   461,
     194,   526,   195,     0,     0,   540,   279,   455,     0,   546,
       0,     0,   504,   225,   545,   538,   547,     0,     0,    33,
     456,     0,   222,   525,     0,     0,     0,   528,     0,     0,
       0,     0,     0,     0,   167,     0,     0,    31,   215,   460,
     216,     0,   220,   221,     0,   404,   405,     0,     0,   217,
     545,   406,     0,   407,   408,   281,   282,   283,   284,   285,
      33,     0,   409,   410,     0,     0,   288,     0,   529,     0,
       0,   530,     0,   531,     0,   532,     0,   218,     0,   219,
       0,    47,     0,   220,   221,     0,   222,   168,   169,   170,
     171,   172,   173,   174,   175,   176,   177,   178,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   552,
     553,     0,   222,     0,     0,     0,     0,   267,     0,     0,
     179,   180,     0,     0,     0,     0,   181,   434,     0,     0,
       0,   563,     0,     0,     0,     0,     0,     4,   104,     5,
       6,   565,   269,     0,     0,   567,     0,     8,     9,    10,
      11,     0,     0,     0,   105,    14,    15,    16,    17,   106,
      18,    19,     0,    20,     0,     0,   107,   108,    21,   109,
      22,     0,    23,     0,   110,    24,    25,   111,    26,   112,
     113,    27,    28,   114,     0,   115,     0,   116,    29,     0,
       0,     0,     0,     0,     0,    30,   117,   270,   382,   271,
     272,   118,   273,   119,   274,   382,   120,   275,     0,     0,
       0,   276,     0,     0,   383,    31,   277,   278,   216,     0,
     384,   383,     0,   385,     0,   279,   386,   384,     0,    83,
     385,     0,     0,   386,     0,     0,    83,     0,    33,    34,
      35,    36,     0,    37,    38,    39,    40,    41,    42,    43,
      44,    45,    46,   121,   387,   218,     0,   219,     0,    47,
       0,   220,   221,     0,   280,     0,     0,    49,     0,     0,
       0,   122,     0,   123,   281,   282,   283,   284,   285,   265,
       0,   286,   287,     0,     0,   288,     0,     0,     0,   104,
       5,     6,     0,     7,     0,     0,     0,     0,     8,     9,
      10,    11,     0,     0,     0,   105,     0,    15,    16,    17,
     106,     0,     0,     0,    20,     0,     0,   107,   108,     0,
     109,    22,     0,    23,     0,   110,     0,    25,   111,    26,
     112,   113,    27,    28,   114,     0,   115,     0,   116,    29,
       0,     0,     0,     0,     0,     0,    30,   117,     0,     0,
       0,     0,   118,     0,   119,     0,     0,   120,     0,     0,
    -177,     0,     0,   242,  -177,  -177,    31,   243,   244,     0,
       0,     0,     0,     0,  -177,     0,     0,   245,  -177,  -177,
       0,   246,   247,     0,     0,     0,     0,     0,     0,     0,
      34,    35,    36,     0,    37,    38,    39,    40,    41,    42,
      43,    44,    45,    46,   121,  -177,     0,     0,    83,  -177,
      47,     0,   248,     0,  -177,   265,     0,    94,    49,   266,
       0,     0,   122,     0,   123,   104,     5,     6,     0,     7,
       0,     0,     0,     0,     8,     9,    10,    11,     0,     0,
       0,   105,     0,    15,    16,    17,   106,     0,     0,     0,
      20,     0,     0,   107,   108,     0,   109,    22,     0,    23,
       0,   110,     0,    25,   111,    26,   112,   113,    27,    28,
     114,     0,   115,     0,   116,    29,     0,     0,     0,     0,
       0,   314,    30,   117,     0,     0,     0,     0,   118,     0,
     119,     0,     0,   120,     0,     0,  -177,     0,     0,     0,
    -177,  -177,    31,     0,     0,     0,     0,     0,     0,     0,
    -177,     0,     0,     0,  -177,  -177,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    34,    35,    36,     0,
      37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
     121,  -177,     0,     0,     0,  -177,    47,     0,     0,     0,
    -177,   265,     0,     0,    49,     0,     0,     0,   122,     0,
     123,   104,     5,     6,     0,     7,     0,     0,     0,     0,
       8,     9,    10,    11,     0,     0,     0,   105,     0,    15,
      16,    17,   106,     0,     0,     0,    20,     0,     0,   107,
     108,     0,   109,    22,     0,    23,     0,   110,     0,    25,
     111,    26,   112,   113,    27,    28,   114,     0,   115,     0,
     116,    29,     0,     0,     0,     0,     0,     0,    30,   117,
       0,     0,     0,     0,   118,     0,   119,     0,     0,   120,
       0,     0,  -177,     0,     0,     0,  -177,  -177,    31,     0,
       0,     0,     0,     0,     0,     0,  -177,     0,     0,     0,
    -177,  -177,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    34,    35,    36,     0,    37,    38,    39,    40,
      41,    42,    43,    44,    45,    46,   121,  -177,     0,     0,
       0,  -177,    47,     0,     0,     0,  -177,   265,     0,     0,
      49,   353,     0,     0,   122,     0,   123,   104,     5,     6,
       0,     7,     0,     0,     0,     0,     8,     9,    10,    11,
       0,     0,     0,   105,     0,    15,    16,    17,   106,     0,
       0,     0,    20,     0,     0,   107,   108,     0,   109,    22,
       0,    23,     0,   110,     0,    25,   111,    26,   112,   113,
      27,    28,   114,     0,   115,     0,   116,    29,     0,     0,
       0,     0,     0,     0,    30,   117,     0,     0,     0,     0,
     118,     0,   119,     0,     0,   120,     0,     0,  -177,     0,
       0,     0,  -177,  -177,    31,     0,     0,     0,     0,     0,
       0,     0,  -177,     0,     0,     0,  -177,  -177,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,    34,    35,
      36,     0,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,   121,  -177,     0,     0,     0,  -177,    47,     0,
       0,     0,  -177,   265,     0,     0,    49,   354,     0,     0,
     122,     0,   123,   104,     5,     6,     0,     7,     0,     0,
       0,     0,     8,     9,    10,    11,     0,     0,     0,   105,
       0,    15,    16,    17,   106,     0,     0,     0,    20,     0,
       0,   107,   108,     0,   109,    22,     0,    23,     0,   110,
       0,    25,   111,    26,   112,   113,    27,    28,   114,     0,
     115,     0,   116,    29,     0,     0,     0,     0,     0,     0,
      30,   117,     0,     0,     0,     0,   118,     0,   119,     0,
       0,   120,     0,     0,  -177,     0,     0,     0,  -177,  -177,
      31,     0,     0,     0,     0,     0,     0,     0,  -177,     0,
       0,     0,  -177,  -177,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,    34,    35,    36,     0,    37,    38,
      39,    40,    41,    42,    43,    44,    45,    46,   121,  -177,
       0,     0,     0,  -177,    47,     0,     0,     0,  -177,     2,
       3,     0,    49,   555,     0,     0,   122,     0,   123,     4,
       0,     5,     6,     0,     7,   167,     0,     0,     0,     8,
       9,    10,    11,     0,    12,    13,     0,    14,    15,    16,
      17,     0,    18,    19,     0,    20,     0,     0,     0,     0,
      21,     0,    22,     0,    23,     0,     0,    24,    25,     0,
      26,     0,     0,    27,    28,     0,     0,     0,     0,     0,
      29,     0,     0,     0,     0,     0,     0,    30,   168,   169,
     170,   171,   172,   173,   174,   175,   176,   177,   178,     0,
       0,     0,     0,     0,     0,     0,     0,    31,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    32,
       0,   179,   180,     0,     0,     0,     0,   181,     0,     0,
      33,    34,    35,    36,     0,    37,    38,    39,    40,    41,
      42,    43,    44,    45,    46,   104,     5,     6,     0,     7,
       0,    47,     0,    48,     8,     9,    10,    11,     0,    49,
       0,   105,     0,    15,    16,    17,   106,     0,     0,     0,
      20,     0,     0,   107,   108,   167,   109,    22,     0,    23,
       0,   110,     0,    25,   111,    26,   112,   113,    27,    28,
     114,     0,   115,     0,   116,    29,     0,     0,     0,     0,
       0,     0,    30,   117,     0,     0,     0,     0,   118,     0,
     119,     0,     0,   120,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   168,   169,
     170,   171,   172,   173,   174,   175,   176,   177,   178,     0,
       0,     0,     0,     0,     0,     0,    34,    35,    36,     0,
      37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
     121,   179,   180,     0,     0,     0,     0,   197,     0,     0,
       0,     0,     0,     0,    49,   104,     5,     6,   122,     7,
     123,     0,     0,     0,     8,     9,    10,    11,     0,     0,
       0,   105,     0,    15,    16,    17,   106,     0,     0,     0,
      20,     0,     0,   107,   108,     0,   109,    22,     0,    23,
       0,   110,     0,    25,   111,    26,   112,   113,    27,    28,
     114,     0,   115,     0,   116,    29,     0,     0,     0,     0,
       0,     0,    30,   117,     0,     0,     0,     0,   118,     0,
     119,     0,     0,   120,     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,    34,    35,    36,     0,
      37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
     121,   270,     0,   271,   272,     0,   273,     0,   274,     0,
       0,   275,     0,     0,    49,   276,     5,     6,   122,     7,
     123,   278,     0,     0,     8,     9,    10,    11,     0,   279,
       0,     0,     0,    15,    16,    17,     0,     0,     0,     0,
      20,     0,     0,     0,     0,     0,     0,    22,     0,    23,
       0,     0,     0,    25,     0,    26,     0,     0,    27,    28,
       0,     0,     0,     0,     0,    29,     0,     0,   469,     0,
       0,     0,    30,     0,     0,     0,     0,     0,   281,   282,
     283,   284,   285,     0,     0,   286,   287,     0,     0,   288,
       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,    34,    35,    36,     0,
      37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
       0,    83,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,    49
};

static const short int yycheck[] =
{
       1,    87,    94,    73,     1,   147,   106,     7,   257,    94,
     187,    42,    43,    44,    45,    46,    69,    17,   130,    89,
      90,   170,   187,    23,    39,    40,    82,   244,   245,    29,
     384,   248,   249,   147,   251,     1,   253,     1,    35,    36,
      37,    38,   170,   370,   172,    61,    16,    65,   142,   280,
       1,     6,    33,     8,    91,     1,   127,   147,   140,    14,
      61,   335,    17,    18,    19,   136,   160,   341,    28,    24,
     142,    86,   162,    88,    25,   164,    22,    28,    93,   140,
      35,   109,    33,    34,   112,    40,    37,   102,   103,    44,
      41,   128,    47,   130,    89,     1,    91,    48,    88,    88,
     137,     1,    57,    58,   101,   106,   159,   140,   108,    15,
     110,   111,   143,   144,   145,   115,   443,    88,   207,   473,
     138,    49,   137,    51,     4,    25,   141,   142,    28,   140,
     111,   187,   147,   382,    34,   152,   153,    37,    98,    73,
      68,    41,   132,   132,    78,   146,   147,    53,   140,   165,
     147,   166,   142,   142,   114,   332,   333,   127,    91,   160,
     111,   132,   140,   163,   165,   162,    99,   332,   399,    92,
     130,   525,   173,   174,   175,   176,   177,   156,   157,   134,
     507,   196,    88,   147,     1,    59,   141,   301,   419,   420,
     141,   206,   341,    88,   100,   210,   162,    33,   162,   200,
     201,   142,   288,   137,   138,   100,   533,   335,    25,   157,
     100,    28,   140,   341,   148,   118,   134,    34,   121,    88,
      37,   124,   127,   157,    41,   159,   132,   228,   134,   140,
      89,   100,    91,   264,   235,   141,   129,   132,    97,   134,
     135,   141,   134,   135,   134,   135,   261,    83,   263,   363,
     140,     4,   100,    89,   396,    91,   152,   310,    89,   436,
      91,   104,   153,   132,   107,   134,   109,    91,    99,   269,
     370,   436,   141,    16,   142,   111,   132,   333,   417,   418,
       6,   367,     8,    91,   128,   371,   134,   135,    14,   128,
      33,    17,    18,    19,   110,   111,   138,   140,   134,   115,
      95,   550,   137,   138,   301,   143,   523,   156,   142,    35,
     118,   326,   142,   121,    40,   140,   124,   373,    44,   134,
     128,    47,   130,     9,   141,   134,    33,   140,   140,   143,
     159,    57,    58,    39,    40,   477,   142,   338,   339,   340,
     136,    47,   357,   443,    50,    88,    89,   134,    91,   142,
     462,   143,    58,   465,   385,   386,    46,   100,    62,    63,
      64,    33,    66,   364,   142,   365,   397,   398,   111,   370,
     147,   424,   162,   147,    81,   372,    83,   428,    61,    99,
     436,   502,    89,   107,    91,   128,   528,   130,   301,   132,
     526,   134,   135,    62,    63,    64,    22,    66,    70,    98,
      72,    73,    33,    75,   111,    77,   116,   507,   134,   112,
     456,   113,   234,   428,   520,   141,   556,    89,   391,   373,
      89,   475,    91,    -1,    -1,    94,    98,   134,    -1,   521,
      -1,    -1,   433,   533,   520,   505,   521,    -1,    -1,   111,
     147,    -1,   443,   474,    -1,    -1,    -1,   478,    -1,    -1,
      -1,    -1,    -1,    -1,    48,    -1,    -1,    88,    89,   456,
      91,    -1,   134,   135,    -1,   137,   138,    -1,    -1,   100,
     556,   143,    -1,   145,   146,   147,   148,   149,   150,   151,
     111,    -1,   154,   155,    -1,    -1,   158,    -1,   489,    -1,
      -1,   491,    -1,   493,    -1,   495,    -1,   128,    -1,   130,
      -1,   132,    -1,   134,   135,    -1,   507,   101,   102,   103,
     104,   105,   106,   107,   108,   109,   110,   111,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   530,
     531,    -1,   533,    -1,    -1,    -1,    -1,   538,    -1,    -1,
     134,   135,    -1,    -1,    -1,    -1,   140,   141,    -1,    -1,
      -1,   552,    -1,    -1,    -1,    -1,    -1,    10,    11,    12,
      13,   562,    15,    -1,    -1,   566,    -1,    20,    21,    22,
      23,    -1,    -1,    -1,    27,    28,    29,    30,    31,    32,
      33,    34,    -1,    36,    -1,    -1,    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,    96,    72,
      73,    74,    75,    76,    77,    96,    79,    80,    -1,    -1,
      -1,    84,    -1,    -1,   112,    88,    89,    90,    91,    -1,
     118,   112,    -1,   121,    -1,    98,   124,   118,    -1,   127,
     121,    -1,    -1,   124,    -1,    -1,   127,    -1,   111,   112,
     113,   114,    -1,   116,   117,   118,   119,   120,   121,   122,
     123,   124,   125,   126,   145,   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,    -1,    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,    82,    86,    87,    88,    86,    87,    -1,
      -1,    -1,    -1,    -1,    96,    -1,    -1,    96,   100,   101,
      -1,   100,   101,    -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,   127,   131,
     132,    -1,   131,    -1,   136,     1,    -1,   136,   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,    -1,    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,    -1,    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,    -1,    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,
      -1,    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,     0,
       1,    -1,   140,   141,    -1,    -1,   144,    -1,   146,    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,    -1,    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,   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,    -1,    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,    70,    -1,    72,    73,    -1,    75,    -1,    77,    -1,
      -1,    80,    -1,    -1,   140,    84,    12,    13,   144,    15,
     146,    90,    -1,    -1,    20,    21,    22,    23,    -1,    98,
      -1,    -1,    -1,    29,    30,    31,    -1,    -1,    -1,    -1,
      36,    -1,    -1,    -1,    -1,    -1,    -1,    43,    -1,    45,
      -1,    -1,    -1,    49,    -1,    51,    -1,    -1,    54,    55,
      -1,    -1,    -1,    -1,    -1,    61,    -1,    -1,   137,    -1,
      -1,    -1,    68,    -1,    -1,    -1,    -1,    -1,   147,   148,
     149,   150,   151,    -1,    -1,   154,   155,    -1,    -1,   158,
      -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,
      -1,   127,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   140
};

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

#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 (YY_("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 long int yylno = yyrline[yyrule];
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
             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

# ifndef yytnamerr
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
   quotes and backslashes, so that it's suitable for yyerror.  The
   heuristic is that double-quoting is unnecessary unless the string
   contains an apostrophe, a comma, or backslash (other than
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
   null, do not copy; instead, return the length of what the result
   would have been.  */
static YYSIZE_T
yytnamerr (char *yyres, const char *yystr)
{
  if (*yystr == '"')
    {
      size_t yyn = 0;
      char const *yyp = yystr;

      for (;;)
	switch (*++yyp)
	  {
	  case '\'':
	  case ',':
	    goto do_not_strip_quotes;

	  case '\\':
	    if (*++yyp != '\\')
	      goto do_not_strip_quotes;
	    /* Fall through.  */
	  default:
	    if (yyres)
	      yyres[yyn] = *yyp;
	    yyn++;
	    break;

	  case '"':
	    if (yyres)
	      yyres[yyn] = '\0';
	    return yyn;
	  }
    do_not_strip_quotes: ;
    }

  if (! yyres)
    return yystrlen (yystr);

  return yystpcpy (yyres, yystr) - yyres;
}
# 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);
  YYFPRINTF (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

  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 (YY_("memory exhausted"),
		    &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 yyexhaustedlab;
# else
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
	goto yyexhaustedlab;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
	yystacksize = YYMAXDEPTH;

      {
	short int *yyss1 = yyss;
	union yyalloc *yyptr =
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
	if (! yyptr)
	  goto yyexhaustedlab;
	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 434 "parser.yy"
    {
	;}
    break;

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

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

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

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

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

  case 9:
#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 10:
#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 11:
#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 12:
#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 13:
#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 14:
#line 495 "parser.yy"
    {
	;}
    break;

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

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

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

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

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

  case 22:
#line 530 "parser.yy"
    {
		if (! is_regular_identifier ((yyvsp[-2].scm)))
		{
#if 0
			/* no longer valid with dashes in \paper{} block. */ 
			(yylsp[-2]).warning (_ ("identifier should have alphabetic characters only"));
#endif
		}


	        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 23:
#line 550 "parser.yy"
    { ;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 38:
#line 611 "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 39:
#line 622 "parser.yy"
    {
		unsmob_context_def ((yyval.scm))->add_context_mod ((yyvsp[0].scm));		
	;}
    break;

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

  case 41:
#line 639 "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 42:
#line 646 "parser.yy"
    {
		(yyval.book) = unsmob_book ((yyvsp[0].scm));
		(yyval.book)->set_spot ((yyloc));
	;}
    break;

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

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

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

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

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

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

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

  case 50:
#line 681 "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 51:
#line 692 "parser.yy"
    {
		(yyval.score) = unsmob_score ((yyvsp[0].scm));
		(yyval.score)->set_spot ((yyloc));
	;}
    break;

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

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

  case 54:
#line 702 "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)->add_output_def ((yyvsp[0].outputdef));
		}
		(yyvsp[0].outputdef)->unprotect ();
	;}
    break;

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

  case 56:
#line 725 "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 57:
#line 737 "parser.yy"
    {
		(yyval.outputdef) = (yyvsp[-1].outputdef);

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

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

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

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

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

  case 61:
#line 765 "parser.yy"
    {
		THIS->lexer_->push_initial_state ();
		(yyval.outputdef) = (yyvsp[0].outputdef);
	;}
    break;

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

  case 63:
#line 776 "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_);
	;}
    break;

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

	;}
    break;

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

  case 66:
#line 790 "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 800 "parser.yy"
    {

	;}
    break;

  case 68:
#line 806 "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 821 "parser.yy"
    {
		(yyval.scm) = scm_cons (SCM_EOL, SCM_EOL);
	;}
    break;

  case 70:
#line 824 "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 835 "parser.yy"
    {

	;}
    break;

  case 72:
#line 838 "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 860 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;
	;}
    break;

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

  case 77:
#line 871 "parser.yy"
    {
		/*TODO: move to Scheme.*/
		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 930 "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 935 "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 943 "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 949 "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 957 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 100:
#line 1008 "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 1012 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-2].scm), make_input ((yyloc)), (yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 102:
#line 1015 "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 1018 "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 1022 "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 1025 "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 1029 "parser.yy"
    {
		(yyval.scm) = scm_list_4 ((yyvsp[-2].scm), make_input ((yyloc)), (yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

  case 107:
#line 1032 "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 1037 "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 1042 "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 1050 "parser.yy"
    { (yyval.scm) = SCM_EOL; ;}
    break;

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

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

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

  case 114:
#line 1064 "parser.yy"
    {
		(yyval.music) = context_spec_music ((yyvsp[-3].scm), (yyvsp[-2].scm), (yyvsp[0].music), (yyvsp[-1].scm), true);
	;}
    break;

  case 115:
#line 1069 "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 116:
#line 1084 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

  case 117:
#line 1085 "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 118:
#line 1095 "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 119:
#line 1109 "parser.yy"
    {
		(yyval.music) = context_spec_music ((yyvsp[-2].scm), SCM_UNDEFINED, (yyvsp[0].music), (yyvsp[-1].scm), true);
		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 120:
#line 1120 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

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

  case 122:
#line 1125 "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 123:
#line 1132 "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 124:
#line 1138 "parser.yy"
    {
		THIS->lexer_->push_figuredbass_state ();

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

  case 125:
#line 1143 "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 126:
#line 1152 "parser.yy"
    { THIS->lexer_->push_lyric_state ();
		(yyval.scm) = ly_symbol2scm ("lyrics");
	;}
    break;

  case 127:
#line 1158 "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 128:
#line 1164 "parser.yy"
    {
		THIS->lexer_->push_figuredbass_state ();

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

  case 129:
#line 1169 "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 130:
#line 1177 "parser.yy"
    { THIS->lexer_->push_lyric_state ();
		(yyval.scm) = ly_symbol2scm ("Lyrics");
	;}
    break;

  case 131:
#line 1184 "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 132:
#line 1190 "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 133:
#line 1200 "parser.yy"
    { THIS->lexer_->push_lyric_state (); ;}
    break;

  case 134:
#line 1202 "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 135:
#line 1209 "parser.yy"
    {
		THIS->lexer_->push_lyric_state ();
	;}
    break;

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

  case 137:
#line 1218 "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, false);
		}

		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,
				SCM_UNDEFINED, com, SCM_EOL, true);
			lst = scm_cons (csm->self_scm (), lst);
		}
		all->set_property ("elements", scm_cons (voice->self_scm (),
			lst));
		(yyval.music) = all;
		voice->unprotect ();
	;}
    break;

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

  case 139:
#line 1248 "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 140:
#line 1258 "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 141:
#line 1269 "parser.yy"
    {
		(yyval.scm) = scm_list_3 (ly_symbol2scm ("assign"),
			scm_string_to_symbol ((yyvsp[-2].scm)), (yyvsp[0].scm));
	;}
    break;

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

  case 143:
#line 1277 "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 144:
#line 1281 "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 145:
#line 1285 "parser.yy"
    {
		(yyval.scm) = scm_list_3 (ly_symbol2scm ("pop"),
			scm_string_to_symbol ((yyvsp[-1].scm)), (yyvsp[0].scm));
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

  case 157:
#line 1313 "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 158:
#line 1322 "parser.yy"
    {
		(yyval.scm) = scm_list_2 (scm_string_to_symbol ((yyvsp[-2].scm)),
			scm_string_to_symbol ((yyvsp[0].scm)));
	;}
    break;

  case 159:
#line 1329 "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, false);
	;}
    break;

  case 160:
#line 1336 "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, false);
	;}
    break;

  case 161:
#line 1343 "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, false);
	;}
    break;

  case 162:
#line 1351 "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, false);
	;}
    break;

  case 163:
#line 1358 "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, false);
	;}
    break;

  case 164:
#line 1364 "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 165:
#line 1374 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

  case 178:
#line 1439 "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 181:
#line 1459 "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 186:
#line 1488 "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 187:
#line 1497 "parser.yy"
    { (yyval.scm) = SCM_EOL; ;}
    break;

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

  case 189:
#line 1506 "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 190:
#line 1533 "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 191:
#line 1545 "parser.yy"
    { 
		(yyval.music) = run_music_function (THIS, (yyvsp[0].scm));
		(yyval.music)->set_spot ((yyloc));
	;}
    break;

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

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

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

  case 195:
#line 1564 "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 196:
#line 1573 "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 1581 "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 1587 "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 199:
#line 1597 "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 200:
#line 1607 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("VoiceSeparator");
		(yyval.music)->set_spot ((yyloc));
	;}
    break;

  case 201:
#line 1611 "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 202:
#line 1621 "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, false);
	;}
    break;

  case 203:
#line 1630 "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, false);
		p = context_spec_music (ly_symbol2scm ("Score"), SCM_UNDEFINED,
					p, SCM_EOL, false);
		(yyval.music) = p;
	;}
    break;

  case 204:
#line 1641 "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 205:
#line 1648 "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 206:
#line 1658 "parser.yy"
    {
		(yyval.music) = MY_MAKE_MUSIC ("PesOrFlexaEvent");
	;}
    break;

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

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

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

  case 210:
#line 1672 "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 211:
#line 1690 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;
	;}
    break;

  case 212:
#line 1693 "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 213:
#line 1701 "parser.yy"
    {
		(yyval.scm) = scm_list_3 ((yyvsp[-1].scm), make_input ((yyloc)), (yyvsp[0].music)->self_scm ());
	;}
    break;

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

  case 215:
#line 1707 "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 216:
#line 1714 "parser.yy"
    {
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

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

  case 218:
#line 1722 "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 219:
#line 1727 "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 220:
#line 1732 "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 221:
#line 1737 "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 223:
#line 1746 "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 224:
#line 1755 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("bracketOpenSymbol");
	;}
    break;

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

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

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

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

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

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

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

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

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

  case 234:
#line 1788 "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 235:
#line 1802 "parser.yy"
    {
		(yyval.music) = unsmob_music ((yyvsp[0].scm));
	;}
    break;

  case 236:
#line 1805 "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 237:
#line 1814 "parser.yy"
    {
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

  case 238:
#line 1817 "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 239:
#line 1828 "parser.yy"
    { (yyval.scm) = SCM_EOL; ;}
    break;

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

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

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

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

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

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

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

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

  case 248:
#line 1856 "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 249:
#line 1861 "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 1873 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 251:
#line 1876 "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 252:
#line 1881 "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 1890 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

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

  case 257:
#line 1907 "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 258:
#line 1915 "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 259:
#line 1924 "parser.yy"
    {
		(yyval.scm) = scm_makfrom0str ("Hat");
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 273:
#line 1978 "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 274:
#line 1987 "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 275:
#line 1996 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

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

  case 277:
#line 2002 "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 278:
#line 2010 "parser.yy"
    { (yyval.scm) = (yyvsp[0].scm); ;}
    break;

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

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

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

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

  case 283:
#line 2029 "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 284:
#line 2037 "parser.yy"
    {
		(yyval.scm) = scm_from_int ((yyvsp[0].i));
	;}
    break;

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

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

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

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

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

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

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

  case 292:
#line 2060 "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 293:
#line 2072 "parser.yy"
    {
		(yyval.scm) = (yyvsp[-1].scm);
		unsmob_music ((yyvsp[-1].scm))->set_property ("bracket-stop", SCM_BOOL_T);
	;}
    break;

  case 294:
#line 2076 "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 295:
#line 2087 "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 296:
#line 2106 "parser.yy"
    {
		(yyval.scm) = ly_symbol2scm ("plus");
	;}
    break;

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

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

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

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

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

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

  case 303:
#line 2137 "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 304:
#line 2147 "parser.yy"
    { (yyval.i) = 0; ;}
    break;

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

  case 306:
#line 2152 "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 307:
#line 2184 "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 308:
#line 2197 "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 309:
#line 2206 "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 310:
#line 2226 "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 311:
#line 2233 "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 312:
#line 2246 "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 313:
#line 2254 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

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

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

  case 316:
#line 2266 "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 317:
#line 2273 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;		
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 357:
#line 2433 "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 358:
#line 2436 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 376:
#line 2510 "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 377:
#line 2516 "parser.yy"
    {
		(yyval.scm) = scm_list_2 ((yyvsp[-1].scm), (yyvsp[0].scm));
	;}
    break;

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

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

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

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

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

  case 383:
#line 2537 "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 384:
#line 2541 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;


      default: break;
    }

/* Line 1126 of yacc.c.  */
#line 5505 "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 = yytnamerr (0, 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.  */
	  YY_("syntax error, unexpected %s");
	  YY_("syntax error, unexpected %s, expecting %s");
	  YY_("syntax error, unexpected %s, expecting %s or %s");
	  YY_("syntax error, unexpected %s, expecting %s or %s or %s");
	  YY_("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 + yytnamerr (0, yytname[yyx]);
		yysize_overflow |= yysize1 < yysize;
		yysize = yysize1;
		yyfmt = yystpcpy (yyfmt, yyprefix);
		yyprefix = yyor;
	      }

	  yyf = YY_(yyformat);
	  yysize1 = yysize + yystrlen (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 += yytnamerr (yyp, yyarg[yyi++]);
		      yyf += 2;
		    }
		  else
		    {
		      yyp++;
		      yyf++;
		    }
		}
	      yyerror (yymsg);
	      YYSTACK_FREE (yymsg);
	    }
	  else
	    {
	      yyerror (YY_("syntax error"));
	      goto yyexhaustedlab;
	    }
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror (YY_("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)
        {
	  /* Return failure if at end of input.  */
	  if (yychar == YYEOF)
	    YYABORT;
        }
      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:
  yyresult = 1;
  goto yyreturn;

#ifndef yyoverflow
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here.  |
`-------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  /* Fall through.  */
#endif

yyreturn:
  if (yychar != YYEOF && yychar != YYEMPTY)
     yydestruct ("Cleanup: discarding lookahead",
		 yytoken, &yylval, &yylloc);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
		  yystos[*yyssp], yyvsp, yylsp);
      YYPOPSTACK;
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}


#line 2546 "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, bool create_new)
{
	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 (create_new)
		csm->set_property ("create-new", SCM_BOOL_T);

	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.c_str ();

  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 ();
}

