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

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

/* Written by Richard Stallman by simplifying the original so called
   ``semantic'' parser.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output.  */
#define YYBISON 1

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

/* Pure parsers.  */
#define YYPURE 1

/* Using locations.  */
#define YYLSP_NEEDED 1



/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     ADDLYRICS = 258,
     ACCEPTS = 259,
     ADDQUOTE = 260,
     ALIAS = 261,
     ALTERNATIVE = 262,
     BAR = 263,
     BOOK = 264,
     CHANGE = 265,
     CHORDMODE = 266,
     CHORDS = 267,
     CLEF = 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,
     TAG = 308,
     TEMPO = 309,
     TIMES = 310,
     TRANSPOSE = 311,
     TRANSPOSITION = 312,
     TYPE = 313,
     UNSET = 314,
     WITH = 315,
     TIME_T = 316,
     NEWCONTEXT = 317,
     CHORD_BASS = 318,
     CHORD_CARET = 319,
     CHORD_COLON = 320,
     CHORD_MINUS = 321,
     CHORD_SLASH = 322,
     DOUBLE_ANGLE_CLOSE = 323,
     DOUBLE_ANGLE_OPEN = 324,
     E_BACKSLASH = 325,
     E_ANGLE_CLOSE = 326,
     E_CHAR = 327,
     E_CLOSE = 328,
     E_EXCLAMATION = 329,
     E_BRACKET_OPEN = 330,
     E_OPEN = 331,
     E_BRACKET_CLOSE = 332,
     E_ANGLE_OPEN = 333,
     E_TILDE = 334,
     EXTENDER = 335,
     FIGURE_CLOSE = 336,
     FIGURE_OPEN = 337,
     FIGURE_SPACE = 338,
     HYPHEN = 339,
     CHORDMODIFIERS = 340,
     COMMANDSPANREQUEST = 341,
     LYRIC_MARKUP = 342,
     MULTI_MEASURE_REST = 343,
     SCM_T = 344,
     DIGIT = 345,
     E_UNSIGNED = 346,
     UNSIGNED = 347,
     IDENTIFIER = 348,
     CHORDMODIFIER_PITCH = 349,
     CHORD_MODIFIER = 350,
     CONTEXT_DEF_IDENTIFIER = 351,
     DRUM_PITCH = 352,
     DURATION_IDENTIFIER = 353,
     EVENT_IDENTIFIER = 354,
     FRACTION = 355,
     LYRICS_STRING = 356,
     LYRIC_MARKUP_IDENTIFIER = 357,
     MARKUP_HEAD_EMPTY = 358,
     MARKUP_HEAD_LIST0 = 359,
     MARKUP_HEAD_MARKUP0 = 360,
     MARKUP_HEAD_MARKUP0_MARKUP1 = 361,
     MARKUP_HEAD_SCM0 = 362,
     MARKUP_HEAD_SCM0_MARKUP1 = 363,
     MARKUP_HEAD_SCM0_SCM1 = 364,
     MARKUP_HEAD_SCM0_SCM1_MARKUP2 = 365,
     MARKUP_HEAD_SCM0_SCM1_SCM2 = 366,
     MARKUP_IDENTIFIER = 367,
     MUSIC_FUNCTION = 368,
     MUSIC_FUNCTION_MARKUP = 369,
     MUSIC_FUNCTION_MARKUP_MARKUP = 370,
     MUSIC_FUNCTION_MARKUP_MARKUP_MUSIC = 371,
     MUSIC_FUNCTION_MARKUP_MUSIC = 372,
     MUSIC_FUNCTION_MARKUP_MUSIC_MUSIC = 373,
     MUSIC_FUNCTION_MUSIC = 374,
     MUSIC_FUNCTION_MUSIC_MUSIC = 375,
     MUSIC_FUNCTION_SCM = 376,
     MUSIC_FUNCTION_SCM_MUSIC = 377,
     MUSIC_FUNCTION_SCM_MUSIC_MUSIC = 378,
     MUSIC_FUNCTION_SCM_SCM = 379,
     MUSIC_FUNCTION_SCM_SCM_MUSIC = 380,
     MUSIC_IDENTIFIER = 381,
     NOTENAME_PITCH = 382,
     NUMBER_IDENTIFIER = 383,
     OUTPUT_DEF_IDENTIFIER = 384,
     REAL = 385,
     RESTNAME = 386,
     SCM_IDENTIFIER = 387,
     SCORE_IDENTIFIER = 388,
     STRING = 389,
     STRING_IDENTIFIER = 390,
     TONICNAME_PITCH = 391,
     UNARY_MINUS = 392
   };
#endif
#define ADDLYRICS 258
#define ACCEPTS 259
#define ADDQUOTE 260
#define ALIAS 261
#define ALTERNATIVE 262
#define BAR 263
#define BOOK 264
#define CHANGE 265
#define CHORDMODE 266
#define CHORDS 267
#define CLEF 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 TAG 308
#define TEMPO 309
#define TIMES 310
#define TRANSPOSE 311
#define TRANSPOSITION 312
#define TYPE 313
#define UNSET 314
#define WITH 315
#define TIME_T 316
#define NEWCONTEXT 317
#define CHORD_BASS 318
#define CHORD_CARET 319
#define CHORD_COLON 320
#define CHORD_MINUS 321
#define CHORD_SLASH 322
#define DOUBLE_ANGLE_CLOSE 323
#define DOUBLE_ANGLE_OPEN 324
#define E_BACKSLASH 325
#define E_ANGLE_CLOSE 326
#define E_CHAR 327
#define E_CLOSE 328
#define E_EXCLAMATION 329
#define E_BRACKET_OPEN 330
#define E_OPEN 331
#define E_BRACKET_CLOSE 332
#define E_ANGLE_OPEN 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 COMMANDSPANREQUEST 341
#define LYRIC_MARKUP 342
#define MULTI_MEASURE_REST 343
#define SCM_T 344
#define DIGIT 345
#define E_UNSIGNED 346
#define UNSIGNED 347
#define IDENTIFIER 348
#define CHORDMODIFIER_PITCH 349
#define CHORD_MODIFIER 350
#define CONTEXT_DEF_IDENTIFIER 351
#define DRUM_PITCH 352
#define DURATION_IDENTIFIER 353
#define EVENT_IDENTIFIER 354
#define FRACTION 355
#define LYRICS_STRING 356
#define LYRIC_MARKUP_IDENTIFIER 357
#define MARKUP_HEAD_EMPTY 358
#define MARKUP_HEAD_LIST0 359
#define MARKUP_HEAD_MARKUP0 360
#define MARKUP_HEAD_MARKUP0_MARKUP1 361
#define MARKUP_HEAD_SCM0 362
#define MARKUP_HEAD_SCM0_MARKUP1 363
#define MARKUP_HEAD_SCM0_SCM1 364
#define MARKUP_HEAD_SCM0_SCM1_MARKUP2 365
#define MARKUP_HEAD_SCM0_SCM1_SCM2 366
#define MARKUP_IDENTIFIER 367
#define MUSIC_FUNCTION 368
#define MUSIC_FUNCTION_MARKUP 369
#define MUSIC_FUNCTION_MARKUP_MARKUP 370
#define MUSIC_FUNCTION_MARKUP_MARKUP_MUSIC 371
#define MUSIC_FUNCTION_MARKUP_MUSIC 372
#define MUSIC_FUNCTION_MARKUP_MUSIC_MUSIC 373
#define MUSIC_FUNCTION_MUSIC 374
#define MUSIC_FUNCTION_MUSIC_MUSIC 375
#define MUSIC_FUNCTION_SCM 376
#define MUSIC_FUNCTION_SCM_MUSIC 377
#define MUSIC_FUNCTION_SCM_MUSIC_MUSIC 378
#define MUSIC_FUNCTION_SCM_SCM 379
#define MUSIC_FUNCTION_SCM_SCM_MUSIC 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 1 "parser.yy"
 // -*-Fundamental-*-

/*
  parser.yy -- Bison/C++ parser for LilyPond

  source file of the GNU LilyPond music typesetter

  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
                 Jan Nieuwenhuizen <janneke@gnu.org>
*/

/*
FIXME:

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

   * There are too many lexical modes?
*/

#include "config.hh"

#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>


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

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

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

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

#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]))


/* Add symbols to the TAGS field of a music object.  */

void
tag_music (Music *m, SCM tag, Input ip)
{
	SCM tags = m->get_property ("tags");
	if (scm_is_symbol (tag))
		tags = scm_cons (tag, tags);
	else if (ly_c_list_p (tag))
		tags = ly_append2 (tag, tags);
	else
		ip.warning (_ ("tag must be symbol or list of symbols"));

	m->set_property ("tags", tags);
}

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

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


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

SCM
make_simple_markup (SCM a)
{
	SCM simple = ly_lily_module_constant ("simple-markup");
	return scm_list_2 (simple, 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);
	scm_gc_protect_object (ch);
	return ch;
}

/* Todo: actually also use apply iso. call too ...  */
bool
ly_input_procedure_p (SCM x)
{
	return ly_c_procedure_p (x)
		|| (scm_is_pair (x) && ly_c_procedure_p (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;
}



/* Enabling traces.  */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif

/* Enabling verbose error messages.  */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif

#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 216 "parser.yy"
typedef union YYSTYPE {
	Book *book;
	Output_def *outputdef;
	SCM scm;
	String *string;
 	Music *music;
 	Score *score;
 	int i;
} YYSTYPE;
/* Line 191 of yacc.c.  */
#line 569 "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 225 "parser.yy"


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




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

#if ! defined (yyoverflow) || YYERROR_VERBOSE

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

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

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

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


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

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

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE))	\
      + 2 * YYSTACK_GAP_MAXIMUM)

/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined (__GNUC__) && 1 < __GNUC__
#   define YYCOPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define YYCOPY(To, From, Count)		\
      do					\
	{					\
	  YYSIZE_T yyi;				\
	  for (yyi = 0; yyi < (Count); yyi++)	\
	    (To)[yyi] = (From)[yyi];		\
	}					\
      while (0)
#  endif
# endif

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack)					\
    do									\
      {									\
	YYSIZE_T yynewbytes;						\
	YYCOPY (&yyptr->Stack, Stack, yysize);				\
	Stack = &yyptr->Stack;						\
	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
	yyptr += yynewbytes / sizeof (*yyptr);				\
      }									\
    while (0)

#endif

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

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

/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS  161
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS  128
/* YYNRULES -- Number of rules. */
#define YYNRULES  371
/* YYNRULES -- Number of states. */
#define YYNSTATES  546

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

#define YYTRANSLATE(YYX) 						\
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
static const unsigned char yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,   159,     2,     2,     2,     2,     2,   152,
     150,   151,   156,   138,   153,   137,   143,   157,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,   158,     2,
     144,   142,   145,   160,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,   147,     2,   148,   154,   155,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,   140,   146,   141,   149,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
      95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
     105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
     135,   136,   139
};

#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
   YYRHS.  */
static const unsigned short int yyprhs[] =
{
       0,     0,     3,     4,     7,    10,    13,    16,    19,    21,
      23,    25,    27,    29,    31,    33,    35,    37,    39,    40,
      43,    48,    50,    52,    56,    58,    60,    62,    64,    66,
      68,    70,    72,    74,    76,    78,    83,    84,    86,    90,
      93,    98,    99,   102,   105,   108,   111,   114,   117,   122,
     123,   125,   128,   131,   134,   137,   140,   142,   145,   147,
     149,   151,   154,   158,   161,   164,   167,   170,   175,   176,
     179,   182,   185,   187,   189,   190,   195,   201,   206,   210,
     215,   219,   221,   223,   225,   227,   228,   229,   235,   236,
     239,   241,   243,   245,   247,   249,   252,   255,   258,   262,
     266,   271,   275,   279,   283,   288,   293,   295,   297,   304,
     309,   314,   318,   320,   325,   328,   332,   334,   336,   340,
     342,   344,   346,   348,   350,   352,   354,   356,   358,   362,
     365,   366,   370,   371,   376,   379,   380,   385,   390,   394,
     397,   403,   407,   409,   411,   413,   415,   417,   419,   421,
     423,   425,   427,   430,   432,   436,   442,   446,   451,   454,
     457,   459,   461,   465,   467,   469,   471,   473,   475,   477,
     479,   481,   482,   486,   488,   490,   494,   496,   498,   500,
     502,   506,   507,   510,   516,   519,   523,   525,   528,   531,
     533,   535,   537,   539,   542,   545,   548,   551,   554,   557,
     559,   562,   564,   567,   571,   572,   575,   578,   583,   585,
     587,   589,   592,   595,   597,   599,   601,   603,   605,   607,
     609,   611,   613,   615,   617,   619,   621,   623,   625,   627,
     629,   630,   632,   635,   638,   640,   643,   645,   648,   650,
     653,   656,   658,   661,   664,   666,   668,   670,   672,   674,
     676,   678,   680,   682,   684,   686,   688,   690,   692,   694,
     696,   698,   700,   701,   703,   706,   709,   711,   715,   719,
     721,   725,   726,   729,   731,   734,   736,   738,   740,   742,
     744,   746,   748,   750,   752,   755,   758,   760,   763,   764,
     767,   771,   772,   774,   781,   784,   787,   790,   793,   796,
     798,   800,   802,   805,   810,   811,   814,   816,   818,   821,
     824,   826,   828,   830,   832,   836,   838,   841,   844,   848,
     852,   854,   856,   860,   864,   867,   869,   871,   873,   875,
     878,   881,   883,   885,   886,   889,   890,   893,   895,   896,
     900,   902,   903,   907,   909,   912,   914,   916,   918,   921,
     925,   926,   929,   932,   934,   937,   941,   943,   946,   948,
     950,   952,   954,   955,   961,   964,   969,   973,   975,   978,
     982,   985
};

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

/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
static const unsigned short int yyrline[] =
{
       0,   551,   551,   552,   554,   556,   559,   566,   570,   573,
     576,   582,   589,   595,   599,   616,   621,   622,   627,   631,
     637,   646,   647,   651,   667,   672,   676,   680,   683,   687,
     691,   694,   697,   700,   703,   709,   716,   720,   724,   735,
     743,   752,   759,   763,   768,   771,   774,   778,   784,   790,
     794,   798,   801,   806,   809,   821,   832,   844,   853,   858,
     863,   873,   878,   887,   890,   893,   903,   909,   924,   927,
     938,   941,   958,   959,   963,   966,   973,  1032,  1037,  1045,
    1051,  1059,  1060,  1063,  1064,  1069,  1070,  1070,  1079,  1080,
    1087,  1088,  1092,  1093,  1097,  1100,  1103,  1106,  1110,  1114,
    1117,  1120,  1124,  1127,  1132,  1137,  1145,  1182,  1185,  1189,
    1192,  1197,  1213,  1214,  1224,  1238,  1250,  1251,  1252,  1259,
    1265,  1272,  1277,  1285,  1292,  1298,  1303,  1310,  1318,  1324,
    1334,  1334,  1343,  1343,  1352,  1380,  1380,  1392,  1403,  1407,
    1411,  1415,  1422,  1423,  1425,  1426,  1427,  1429,  1430,  1431,
    1432,  1436,  1437,  1443,  1452,  1459,  1466,  1474,  1481,  1487,
    1497,  1500,  1503,  1508,  1511,  1516,  1519,  1522,  1534,  1537,
    1540,  1564,  1568,  1581,  1582,  1587,  1603,  1606,  1609,  1612,
    1616,  1626,  1627,  1634,  1662,  1677,  1686,  1694,  1700,  1706,
    1716,  1726,  1730,  1740,  1749,  1758,  1768,  1775,  1782,  1792,
    1795,  1799,  1802,  1806,  1824,  1827,  1832,  1841,  1849,  1852,
    1857,  1862,  1867,  1872,  1876,  1885,  1888,  1891,  1894,  1897,
    1900,  1903,  1906,  1909,  1912,  1918,  1932,  1935,  1944,  1947,
    1958,  1959,  1960,  1961,  1965,  1968,  1974,  1977,  1983,  1986,
    1991,  2003,  2006,  2011,  2020,  2026,  2027,  2031,  2037,  2045,
    2054,  2057,  2060,  2063,  2066,  2069,  2072,  2078,  2079,  2080,
    2085,  2091,  2097,  2101,  2108,  2117,  2126,  2129,  2132,  2140,
    2141,  2147,  2150,  2156,  2159,  2167,  2172,  2177,  2178,  2182,
    2183,  2184,  2188,  2193,  2201,  2215,  2219,  2222,  2229,  2232,
    2238,  2248,  2249,  2253,  2285,  2298,  2307,  2327,  2334,  2347,
    2355,  2358,  2364,  2367,  2374,  2377,  2383,  2386,  2389,  2392,
    2398,  2401,  2404,  2410,  2411,  2417,  2420,  2423,  2435,  2438,
    2441,  2445,  2448,  2451,  2457,  2460,  2465,  2468,  2471,  2474,
    2477,  2484,  2487,  2493,  2494,  2498,  2499,  2507,  2511,  2510,
    2519,  2523,  2522,  2531,  2534,  2537,  2543,  2546,  2552,  2559,
    2565,  2566,  2569,  2575,  2578,  2581,  2587,  2590,  2596,  2599,
    2602,  2605,  2608,  2608,  2617,  2620,  2623,  2626,  2629,  2632,
    2638,  2642
};
#endif

#if YYDEBUG || YYERROR_VERBOSE
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "\\addlyrics", "\\accepts", "\\addquote",
  "\\alias", "\\alternative", "\\bar", "\book", "\\change", "\\chordmode",
  "\\chords", "\\clef", "\\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", "\\tag", "\\tempo",
  "\\times", "\\transpose", "\\transposition", "\\type", "\\unset",
  "\\with", "\\time", "\\new", "/+", "^", ":", "-", "/", ">>", "<<", "\\",
  "\\>", "\\C[haracter]", "\\)", "\\!", "\\[", "\\(", "\\]", "\\<", "\\~",
  "__", "FIGURE_CLOSE", "FIGURE_OPEN", "_", "--", "CHORDMODIFIERS",
  "COMMANDSPANREQUEST", "LYRIC_MARKUP", "MULTI_MEASURE_REST", "SCM_T",
  "DIGIT", "E_UNSIGNED", "UNSIGNED", "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_IDENTIFIER", "NOTENAME_PITCH",
  "NUMBER_IDENTIFIER", "OUTPUT_DEF_IDENTIFIER", "REAL", "RESTNAME",
  "SCM_IDENTIFIER", "SCORE_IDENTIFIER", "STRING", "STRING_IDENTIFIER",
  "TONICNAME_PITCH", "'-'", "'+'", "UNARY_MINUS", "'{'", "'}'", "'='",
  "'.'", "'<'", "'>'", "'|'", "'['", "']'", "'~'", "'('", "')'", "'''",
  "','", "'^'", "'_'", "'*'", "'/'", "':'", "'!'", "'?'", "$accept",
  "lilypond", "object_id_setting", "toplevel_expression", "toplevel_music",
  "embedded_scm", "lilypond_header_body", "lilypond_header",
  "assignment_id", "assignment", "identifier_init",
  "context_def_spec_block", "context_def_spec_body", "book_block",
  "book_body", "score_block", "score_body", "paper_block", "output_def",
  "output_def_head", "output_def_body", "tempo_event", "Music_list",
  "Music", "Alternative_music", "Repeated_music", "Sequential_music",
  "Simultaneous_music", "Simple_music", "optional_context_mod", "@1",
  "context_mod_list", "Composite_music", "Grouped_music_list",
  "Generic_prefix_music_scm", "Generic_prefix_music",
  "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", "add_quote", "command_element", "command_req",
  "post_events", "tagged_post_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", "bass_mod",
  "bass_figure", "br_bass_figure", "figure_list", "figure_spec",
  "optional_rest", "simple_element", "lyric_element", "new_chord",
  "chord_items", "chord_separator", "chord_item", "step_numbers",
  "step_number", "number_expression", "number_term", "number_factor",
  "bare_number", "bare_unsigned", "exclamations", "questions",
  "lyric_markup", "@5", "full_markup", "@6", "markup_top", "markup_list",
  "markup_composed_list", "markup_braced_list", "markup_braced_list_body",
  "markup_head_1_item", "markup_head_1_list", "simple_markup", "@7",
  "markup", 0
};
#endif

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

# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
   token YYLEX-NUM.  */
static const unsigned short int yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
     385,   386,   387,   388,   389,   390,   391,    45,    43,   392,
     123,   125,    61,    46,    60,    62,   124,    91,    93,   126,
      40,    41,    39,    44,    94,    95,    42,    47,    58,    33,
      63
};
# endif

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

/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
static const unsigned char yyr2[] =
{
       0,     2,     0,     2,     2,     2,     2,     2,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     0,     2,
       4,     1,     1,     3,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     4,     0,     1,     3,     2,
       4,     0,     2,     2,     2,     2,     2,     2,     4,     0,
       1,     2,     2,     2,     2,     2,     1,     2,     1,     1,
       1,     2,     3,     2,     2,     2,     2,     4,     0,     2,
       2,     2,     1,     1,     0,     4,     5,     4,     3,     4,
       3,     1,     1,     1,     1,     0,     0,     5,     0,     2,
       1,     1,     1,     1,     1,     2,     2,     2,     3,     3,
       4,     3,     3,     3,     4,     4,     1,     1,     6,     4,
       4,     3,     1,     4,     2,     3,     1,     1,     3,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     3,     2,
       0,     3,     0,     4,     2,     0,     4,     4,     3,     2,
       5,     3,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     2,     1,     3,     5,     3,     4,     2,     2,
       1,     1,     3,     1,     1,     1,     1,     1,     1,     1,
       1,     0,     3,     1,     1,     3,     1,     1,     1,     1,
       3,     0,     2,     5,     2,     3,     1,     2,     2,     1,
       1,     1,     1,     2,     2,     2,     2,     2,     2,     1,
       2,     1,     2,     3,     0,     2,     2,     4,     1,     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,     1,     2,     0,     2,
       3,     0,     1,     6,     2,     2,     2,     2,     2,     1,
       1,     1,     2,     4,     0,     2,     1,     1,     2,     2,
       1,     1,     1,     1,     3,     1,     2,     2,     3,     3,
       1,     1,     3,     3,     2,     1,     1,     1,     1,     2,
       2,     1,     1,     0,     2,     0,     2,     1,     0,     3,
       1,     0,     3,     1,     2,     1,     1,     1,     2,     3,
       0,     2,     2,     1,     2,     3,     1,     2,     1,     1,
       1,     1,     0,     5,     2,     4,     3,     1,     2,     3,
       2,     1
};

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

/* YYDEFGOTO[NTERM-NUM]. */
static const short int yydefgoto[] =
{
      -1,     1,   356,    51,    52,   273,   171,   357,    55,    56,
     296,   158,   418,    57,   168,    58,   204,   328,   358,    60,
      61,   132,   151,   274,   435,    62,    63,    64,   134,   164,
     317,   490,   135,    66,    67,    68,    69,    70,    71,    72,
     161,   315,   420,    73,   172,   136,   486,   487,   488,   235,
     137,   229,   236,   230,   138,   139,   140,   141,   390,    74,
     320,   142,   263,   391,    75,   143,   144,   386,   463,   464,
     303,   304,   305,   409,   507,   197,   198,   100,   101,   102,
     103,   410,   411,   306,    90,   238,   264,   239,   265,    98,
     372,   307,   450,   500,   451,   452,   378,   258,   539,   259,
     260,   261,   504,   459,   522,   523,   524,   308,   309,   310,
     311,   241,   384,   461,   262,   379,   232,    86,   188,   189,
     190,   191,   347,   192,   193,   340,   336,   341
};

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
#define YYPACT_NINF -360
static const short int yypact[] =
{
    -360,  1618,  -360,  -360,    19,   -66,  -360,  -360,   -35,  -360,
    -360,  -360,  -360,   -48,  -360,  -360,  -360,  -360,   -35,  -360,
    -360,  -360,  -360,  2013,   -35,   -45,   -30,   -11,   -34,     1,
     -54,   -35,  -360,  -360,  -360,  -360,  -360,    15,    15,    15,
      15,  1886,  1886,   -34,   -34,   -34,   -34,   -34,  -360,  -360,
    -360,  -360,  -360,  -360,  -360,    -4,  -360,  -360,  -360,  -360,
       5,    71,  -360,  -360,  -360,  -360,   153,  -360,  -360,  -360,
     -17,   107,  -360,  -360,  -360,  -360,  -360,  -360,  -360,  1749,
    -360,  -360,  -360,   -29,  -360,  -360,  1742,   -19,  -360,  -360,
    1886,    97,    40,  -360,  -360,  1886,    41,  -360,  1886,   -19,
    -360,  -360,  -360,   -54,   107,  -360,    15,  1886,  1886,    43,
      67,    94,    14,  1592,   108,   186,   -35,   -15,   -35,   -35,
     -15,   -15,   108,   -35,     1,  -360,  -360,  -360,  -360,  -360,
    -360,  -360,  -360,  -360,  -360,  -360,  -360,  -360,   286,  -360,
    -360,  -360,   -15,  -360,  -360,  1886,  -360,  1886,  1886,   -34,
     -34,   932,   507,   115,  -360,   106,  -360,  -360,  -360,  -360,
    -360,   247,  -360,  -360,   -17,  1069,    19,  -360,    63,   -35,
    1886,    58,  1886,  -360,  -360,  -360,   103,  -360,  1879,   -34,
     -34,   -34,   -34,   -34,  -360,  -360,  -360,  -360,  -360,  -360,
    -360,  -360,  -360,  1742,  -360,  -360,  -360,   104,   114,  -360,
    -360,  -360,  1886,  -360,   658,  1206,  1343,  -360,   167,  -360,
     104,   114,  1886,  1886,  -360,  -360,  1886,  -360,   134,  -360,
    -360,   145,  -360,  -360,   150,  -360,  -360,   155,  -360,   146,
    -360,  -360,  -360,  -360,  -360,   -34,   144,  -360,  -360,  -360,
     130,  -360,   -34,   148,  -360,   152,  -360,  -360,  -360,  -360,
    -360,   -15,   -15,  -360,  -360,   -15,   -15,  -360,   -15,  -360,
     -15,  -360,  -360,   -64,  -360,   130,  -360,  -360,  1886,  -360,
    1886,  -360,  -360,  -360,  -360,   -25,  -360,  -360,  -360,  -360,
    -360,  -360,  -360,  -360,  -360,  -360,     2,  -360,  -360,  -360,
    -360,  -360,  -360,  -360,    97,  -360,  -360,  -360,  -360,  -360,
    -360,   146,  -360,  -360,  -360,  -360,   308,  -360,    57,  -360,
      82,  -360,  -360,  -360,   192,   -17,  -360,   156,  -360,  -360,
    -360,  -360,  -360,   158,  -360,  -360,  -360,  -360,  -360,  -360,
    -360,   107,  -360,  -360,  -360,  -360,   160,  -360,   103,  1879,
    -360,  1879,  -360,  -360,   -34,   -34,   -34,   391,  -360,  -360,
    -360,  -360,  -360,   288,  -360,  -360,  -360,  -360,  -360,  -360,
    -360,  -360,  -360,  -360,  -360,  -360,   159,  -360,  -360,  -360,
     161,   -35,   165,   173,   165,  -360,   190,    97,    24,  1742,
    -360,  -360,  -360,   151,   139,  -360,  2007,  -360,  -360,  -360,
    -360,  -360,  -360,  2007,  -360,  -360,    -2,  -360,  -360,  -360,
    -360,  -360,  -360,  -360,  -360,  -360,  -360,   146,  -360,  -360,
    -360,  -360,  -360,    -2,    -2,    -2,    -2,  -360,   213,  -360,
     -17,  -360,  -360,  1886,    40,  -360,  -360,  -360,  -360,   -34,
    -360,  -360,  1742,  -360,   169,  -360,  -360,   190,  -360,  -360,
    -360,  -360,  -360,  -360,  -360,  -360,  -360,  -360,  -360,   117,
    -360,   -16,   166,  -360,  -360,   177,  -360,  -360,   177,  -360,
    -360,   -71,   248,  -360,  -360,  2007,   139,  -360,  -360,  -360,
    -360,  -360,  -360,  -360,  -360,  -360,  -360,   -34,  -360,   -35,
    -360,   -35,  -360,   -35,   174,  -360,  -360,   181,  -360,  -360,
     293,  -360,   795,  -360,  -360,  -360,   -16,  -360,  -360,  -360,
    -360,  -360,  -360,  -360,   157,   -19,  -360,   -15,   -34,   -71,
    -360,   -34,   -34,  -360,   190,  -360,  -360,  -360,  -360,  1480,
    -360,  -360,  -360,   176,  -360,    -7,   104,   114,   271,  2023,
    -360,   179,  -360,  -360,  -360,    97,  -360,  -360,  -360,  -360,
    -360,  -360,  2007,   -34,  -360,  -360
};

/* YYPGOTO[NTERM-NUM].  */
static const short int yypgoto[] =
{
    -360,  -360,   164,  -360,  -360,    -1,  -360,    28,  -360,   -14,
    -360,   182,  -360,  -360,  -360,   -84,   -98,  -360,    34,  -360,
    -360,   268,   -70,   -28,  -360,  -360,  -360,  -360,  -360,   -63,
    -360,  -360,    64,   -61,  -360,  -360,  -360,  -360,  -360,  -360,
    -360,  -360,  -360,  -360,  -360,  -360,  -360,  -360,  -155,   143,
     221,    17,    -6,  -359,  -360,  -360,  -360,  -360,  -360,  -360,
    -360,  -360,  -360,  -360,  -360,  -360,  -360,  -249,  -360,  -144,
    -360,  -360,    32,  -360,  -170,   -94,   -93,   319,  -128,   -53,
     243,  -360,  -360,  -360,  -360,   228,  -202,   229,    20,   225,
     112,  -360,  -360,  -360,   -91,  -360,  -360,  -360,  -360,  -360,
    -360,  -360,  -360,  -149,  -360,  -360,  -179,  -360,  -139,  -250,
    -106,   -88,   -32,  -105,  -360,  -360,     0,  -360,   -13,  -154,
    -360,  -174,  -360,  -177,  -150,   -75,  -360,  -239
};

/* 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 -172
static const short int yytable[] =
{
      53,    76,    83,   202,   165,   210,   211,   231,   302,   162,
     256,   194,    85,   133,   145,   393,   349,   442,    91,   348,
     170,    79,   337,   205,   206,   104,   338,    95,   339,    54,
     220,   163,    26,   388,    27,    59,   397,   105,   106,   107,
     108,   213,   146,   147,   148,   149,   150,   157,    19,   380,
     381,   167,    32,   382,   383,    33,   385,    19,   387,   536,
      53,   233,   199,    87,   322,    65,    81,   207,   298,   246,
     209,   505,   154,    87,    80,   200,    81,   201,   495,   215,
     216,   389,    99,   237,   327,   257,   155,    88,    13,   506,
     224,    15,    84,    96,   224,    92,    19,    20,    48,    82,
     323,    97,   426,   318,    22,   444,   214,   445,   433,    82,
      93,    25,   228,   169,   446,   314,   447,   266,   350,   267,
     268,   497,   498,    50,   300,   121,   226,    35,   227,    94,
     226,   537,   227,   195,   196,   396,    35,   240,   152,   465,
     240,   221,   332,   499,   335,   153,   397,    33,   269,   270,
      19,   295,   312,    77,    78,   533,   160,   334,   448,    34,
      33,   349,   349,   331,   348,   469,   470,   163,   330,   301,
      53,   449,    34,   203,   353,    35,   359,   217,   342,   343,
     344,   345,   346,   321,   363,   364,   299,   200,   365,   201,
      48,   339,    49,   431,   413,   414,   326,   432,   208,   333,
     445,   218,   329,    48,   324,    49,   398,   446,   177,   447,
     392,   180,   156,   182,   455,   456,   457,   471,   458,   472,
     455,   456,   457,    19,   458,   115,   116,   473,   219,    35,
     474,   475,   476,   118,   370,    87,   119,   477,   415,   416,
     394,   375,   395,   187,   313,   123,   314,   200,   478,   201,
     316,   448,   520,   479,   419,   349,   351,   480,   348,   362,
     481,   242,   243,   200,   425,   201,   247,   352,   423,    83,
     231,   482,   483,   440,   467,   468,   366,   367,   368,    33,
     223,   542,   224,   369,   166,   441,   373,   371,   417,   443,
     376,   225,   422,   436,   377,   434,   421,   471,   460,   472,
     424,   508,    35,   437,   194,   528,   412,   473,   439,   494,
     474,   475,   476,    99,   501,   515,   514,   538,   226,   535,
     227,   543,    48,   407,    77,    78,   492,   502,   478,   159,
     503,   231,   325,   479,   297,   517,   234,   480,   408,   530,
     481,    19,    89,   427,   428,   429,   212,   484,   244,   248,
     245,   482,   483,   374,   485,   521,   544,   425,   496,   489,
     466,   509,     0,     0,     0,   438,   454,     0,   249,     0,
       0,     0,     0,   250,   251,   228,     0,     0,   453,   276,
       0,   277,   278,   252,   279,   541,   280,   253,   254,     0,
       0,     0,     0,     0,     0,   491,     0,     0,   399,     0,
       0,     0,     0,     0,     0,     0,     0,   285,   231,     0,
       0,   526,   527,    87,     0,     0,   525,   255,     0,     0,
      35,     0,    99,     0,   519,     0,     0,   484,   493,     0,
       0,     0,     0,     0,   516,     0,   228,     0,     0,   173,
       0,     0,    77,    78,     0,   400,   401,   525,     0,   453,
       0,   402,     0,   403,   404,   287,   288,   289,   290,   291,
       0,     0,   405,   406,   359,     0,   294,     0,     0,     0,
       0,     0,     0,   511,     0,   512,   510,   513,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   174,   175,   176,   177,   178,   179,   180,
     181,   182,   183,   184,     0,     0,     0,   529,     0,     0,
     531,   532,     0,   228,     0,   109,     0,   110,     6,     7,
     111,     0,   275,     0,     0,   185,   186,     9,    10,    11,
      12,   187,   430,     0,   112,    15,    16,    17,    18,   113,
      19,    20,   545,    21,     0,   114,   115,   116,    22,   117,
      23,     0,    24,     0,   118,    25,    26,   119,    27,   120,
      28,   121,    29,    30,   122,     0,   123,     0,   124,    31,
       0,     0,     0,     0,     0,     0,    32,   125,   276,     0,
     277,   278,   126,   279,   127,   280,   128,   281,     0,     0,
       0,   282,     0,     0,     0,     0,    33,   283,   284,   224,
       0,     0,     0,     0,     0,     0,   285,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    35,
      36,    37,    38,     0,    39,    40,    41,    42,    43,    44,
      45,    46,    47,   129,     0,   226,     0,   227,     0,    48,
       0,    77,    78,     0,   286,     0,     0,    50,     0,     0,
       0,   130,     0,   131,   287,   288,   289,   290,   291,   354,
       0,   292,   293,     0,     0,   294,   109,     0,   110,     6,
       7,   111,     0,     8,     0,     0,     0,     0,     9,    10,
      11,    12,     0,    13,     0,   112,    15,    16,    17,    18,
     113,     0,    20,     0,    21,   323,   114,   115,   116,    22,
     117,    23,     0,    24,     0,   118,     0,    26,   119,    27,
     120,    28,   121,    29,    30,   122,     0,   123,     0,   124,
      31,     0,     0,     0,     0,     0,     0,    32,   125,     0,
       0,     0,     0,   126,     0,   127,     0,   128,     0,     0,
    -171,     0,     0,     0,     0,  -171,  -171,     0,     0,     0,
       0,     0,     0,     0,     0,  -171,     0,     0,     0,  -171,
    -171,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,    36,    37,    38,     0,    39,    40,    41,    42,    43,
      44,    45,    46,    47,   129,  -171,     0,     0,     0,  -171,
       0,     0,     0,     0,  -171,     0,   354,     0,    50,   355,
       0,     0,   130,   109,   131,   110,     6,     7,   111,     0,
       8,     0,     0,     0,     0,     9,    10,    11,    12,     0,
      13,     0,   112,    15,    16,    17,    18,   113,     0,    20,
       0,    21,   323,   114,   115,   116,    22,   117,    23,     0,
      24,     0,   118,     0,    26,   119,    27,   120,    28,   121,
      29,    30,   122,     0,   123,     0,   124,    31,     0,     0,
       0,     0,     0,     0,    32,   125,     0,     0,     0,     0,
     126,     0,   127,     0,   128,     0,     0,  -171,     0,     0,
       0,     0,  -171,  -171,     0,     0,     0,     0,     0,     0,
       0,     0,  -171,     0,     0,     0,  -171,  -171,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,    36,    37,
      38,     0,    39,    40,    41,    42,    43,    44,    45,    46,
      47,   129,  -171,     0,     0,     0,  -171,     0,     0,     0,
       0,  -171,     0,   271,     0,    50,   518,     0,     0,   130,
     109,   131,   110,     6,     7,   111,     0,     8,     0,     0,
       0,     0,     9,    10,    11,    12,     0,     0,     0,   112,
       0,    16,    17,    18,   113,     0,     0,     0,    21,     0,
     114,   115,   116,     0,   117,    23,     0,    24,     0,   118,
       0,    26,   119,    27,   120,    28,   121,    29,    30,   122,
       0,   123,     0,   124,    31,     0,     0,     0,     0,     0,
       0,    32,   125,     0,     0,     0,     0,   126,     0,   127,
       0,   128,     0,     0,  -171,     0,     0,     0,     0,  -171,
    -171,    33,     0,     0,     0,     0,     0,     0,     0,  -171,
       0,     0,     0,  -171,  -171,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,    36,    37,    38,     0,    39,
      40,    41,    42,    43,    44,    45,    46,    47,   129,  -171,
       0,     0,     0,  -171,    48,     0,     0,     0,  -171,     0,
     271,     0,    50,   272,     0,     0,   130,   109,   131,   110,
       6,     7,   111,     0,     8,     0,     0,     0,     0,     9,
      10,    11,    12,     0,     0,     0,   112,     0,    16,    17,
      18,   113,     0,     0,     0,    21,     0,   114,   115,   116,
       0,   117,    23,     0,    24,     0,   118,     0,    26,   119,
      27,   120,    28,   121,    29,    30,   122,     0,   123,     0,
     124,    31,     0,     0,     0,     0,     0,   319,    32,   125,
       0,     0,     0,     0,   126,     0,   127,     0,   128,     0,
       0,  -171,     0,     0,     0,     0,  -171,  -171,    33,     0,
       0,     0,     0,     0,     0,     0,  -171,     0,     0,     0,
    -171,  -171,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    36,    37,    38,     0,    39,    40,    41,    42,
      43,    44,    45,    46,    47,   129,  -171,     0,     0,     0,
    -171,    48,     0,     0,     0,  -171,     0,   271,     0,    50,
       0,     0,     0,   130,   109,   131,   110,     6,     7,   111,
       0,     8,     0,     0,     0,     0,     9,    10,    11,    12,
       0,     0,     0,   112,     0,    16,    17,    18,   113,     0,
       0,     0,    21,     0,   114,   115,   116,     0,   117,    23,
       0,    24,     0,   118,     0,    26,   119,    27,   120,    28,
     121,    29,    30,   122,     0,   123,     0,   124,    31,     0,
       0,     0,     0,     0,     0,    32,   125,     0,     0,     0,
       0,   126,     0,   127,     0,   128,     0,     0,  -171,     0,
       0,     0,     0,  -171,  -171,    33,     0,     0,     0,     0,
       0,     0,     0,  -171,     0,     0,     0,  -171,  -171,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    36,
      37,    38,     0,    39,    40,    41,    42,    43,    44,    45,
      46,    47,   129,  -171,     0,     0,     0,  -171,    48,     0,
       0,     0,  -171,     0,   271,     0,    50,   360,     0,     0,
     130,   109,   131,   110,     6,     7,   111,     0,     8,     0,
       0,     0,     0,     9,    10,    11,    12,     0,     0,     0,
     112,     0,    16,    17,    18,   113,     0,     0,     0,    21,
       0,   114,   115,   116,     0,   117,    23,     0,    24,     0,
     118,     0,    26,   119,    27,   120,    28,   121,    29,    30,
     122,     0,   123,     0,   124,    31,     0,     0,     0,     0,
       0,     0,    32,   125,     0,     0,     0,     0,   126,     0,
     127,     0,   128,     0,     0,  -171,     0,     0,     0,     0,
    -171,  -171,    33,     0,     0,     0,     0,     0,     0,     0,
    -171,     0,     0,     0,  -171,  -171,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    36,    37,    38,     0,
      39,    40,    41,    42,    43,    44,    45,    46,    47,   129,
    -171,     0,     0,     0,  -171,    48,     0,     0,     0,  -171,
       0,   271,     0,    50,   361,     0,     0,   130,   109,   131,
     110,     6,     7,   111,     0,     8,     0,     0,     0,     0,
       9,    10,    11,    12,     0,     0,     0,   112,     0,    16,
      17,    18,   113,     0,     0,     0,    21,     0,   114,   115,
     116,     0,   117,    23,     0,    24,     0,   118,     0,    26,
     119,    27,   120,    28,   121,    29,    30,   122,     0,   123,
       0,   124,    31,     0,     0,     0,     0,     0,     0,    32,
     125,     0,     0,     0,     0,   126,     0,   127,     0,   128,
       0,     0,  -171,     0,     0,     0,     0,  -171,  -171,    33,
       0,     0,     0,     0,     0,     0,     0,  -171,     0,     0,
       0,  -171,  -171,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,    36,    37,    38,     0,    39,    40,    41,
      42,    43,    44,    45,    46,    47,   129,  -171,   222,     0,
       0,  -171,    48,     0,     0,     0,  -171,     0,     2,     3,
      50,   534,     0,     4,   130,    19,   131,     5,     0,     6,
       7,     0,     0,     8,     0,     0,     0,     0,     9,    10,
      11,    12,     0,    13,    14,     0,    15,    16,    17,    18,
       0,    19,    20,     0,    21,     0,     0,     0,     0,    22,
       0,    23,     0,    24,     0,     0,    25,    26,     0,    27,
       0,    28,     0,    29,    30,     0,     0,     0,     0,     0,
      31,    33,   223,     0,   224,     0,     0,    32,     0,     0,
       0,     0,     0,   225,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,    35,     0,     0,    33,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    34,
     226,     0,   227,     0,    48,     0,    77,    78,     0,     0,
      35,    36,    37,    38,     0,    39,    40,    41,    42,    43,
      44,    45,    46,    47,     0,     0,     0,     0,     0,     0,
      48,     0,    49,     0,     0,     0,     0,   109,    50,   110,
       6,     7,   111,     0,     8,     0,     0,     0,     0,     9,
      10,    11,    12,     0,     0,     0,   112,     0,    16,    17,
      18,   113,     0,     0,     0,    21,     0,   114,   115,   116,
     173,   117,    23,     0,    24,     0,   118,     0,    26,   119,
      27,   120,    28,   121,    29,    30,   122,     0,   123,     0,
     124,    31,     0,     0,     0,     0,     0,     0,    32,   125,
       0,     0,     0,     0,   126,     0,   127,     0,   128,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,   174,   175,   176,   177,   178,   179,
     180,   181,   182,   183,   184,     0,     0,     0,     0,     0,
       0,     0,    36,    37,    38,     0,    39,    40,    41,    42,
      43,    44,    45,    46,    47,   129,   185,   186,     0,     0,
       0,     0,   187,     0,     0,     0,     0,   166,     0,    50,
       0,     0,     0,   130,   109,   131,   110,     6,     7,   111,
       0,     8,     0,     0,     0,     0,     9,    10,    11,    12,
       0,     0,     0,   112,     0,    16,    17,    18,   113,     0,
       0,     0,    21,     0,   114,   115,   116,   173,   117,    23,
       0,    24,     0,   118,     0,    26,   119,    27,   120,    28,
     121,    29,    30,   122,     0,   123,     0,   124,    31,     0,
       0,     0,     0,     0,     0,    32,   125,     0,     0,     0,
       0,   126,     0,   127,     0,   128,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   174,   175,   176,   177,   178,   179,   180,   181,   182,
     183,   184,     0,     0,     0,     0,     0,     0,     0,    36,
      37,    38,     0,    39,    40,    41,    42,    43,    44,    45,
      46,    47,   129,   185,   186,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     6,     7,    50,     0,     8,     0,
     130,     0,   131,     9,    10,    11,    12,     0,     0,     0,
       0,     0,    16,    17,    18,     0,     0,     0,     0,    21,
       0,     0,     0,     0,     0,     0,    23,     0,    24,     0,
       0,     0,    26,     0,    27,     0,    28,     0,    29,    30,
       0,     0,     0,     0,     0,    31,     0,     0,   276,     0,
     277,   278,    32,   279,     0,   280,     0,   281,     0,     0,
       0,   282,     0,     0,   276,     0,   277,   278,   284,   279,
       0,   280,     0,   281,     0,     0,   285,   282,     0,     0,
       0,     0,     0,     0,   284,     0,     0,     0,     0,     0,
       0,     0,   285,     0,     0,     0,    36,    37,    38,     0,
      39,    40,    41,    42,    43,    44,    45,    46,    47,     0,
      87,     0,     0,     0,   462,     0,     0,     0,     0,     0,
       0,     0,     0,    50,   287,   288,   289,   290,   291,     0,
     540,   292,   293,     0,     0,   294,     0,     0,     0,     0,
     287,   288,   289,   290,   291,     0,     0,   292,   293,     0,
       0,   294
};

static const short int yycheck[] =
{
       1,     1,     8,    91,    74,    99,    99,   113,   152,    70,
     138,    86,    18,    41,    42,   264,   193,   376,    24,   193,
      83,     4,   176,    93,    94,    31,   176,    28,   178,     1,
      16,    60,    49,    97,    51,     1,   286,    37,    38,    39,
      40,   104,    43,    44,    45,    46,    47,    61,    33,   251,
     252,    79,    69,   255,   256,    89,   258,    33,   260,    66,
      61,   114,    90,   127,     1,     1,   101,    95,   152,   122,
      98,   142,     1,   127,   140,    90,   101,    92,   437,   107,
     108,   145,   136,    98,   168,   138,    15,    23,    25,   160,
      92,    28,   140,    92,    92,   140,    33,    34,   132,   134,
      37,   100,   341,   164,    41,    81,   106,    83,   347,   134,
     140,    48,   113,   142,    90,   140,    92,   145,   193,   147,
     148,   137,   138,   140,   152,    54,   128,   112,   130,   140,
     128,   138,   130,   152,   153,   137,   112,   117,   142,   388,
     120,   127,   170,   159,   172,   140,   396,    89,   149,   150,
      33,   152,   152,   134,   135,   514,     3,   171,   134,   101,
      89,   338,   339,   169,   338,   415,   416,    60,   168,   152,
     171,   147,   101,   133,   202,   112,   204,   134,   179,   180,
     181,   182,   183,   166,   212,   213,   152,    90,   216,    92,
     132,   341,   134,   347,   137,   138,   168,   347,   157,   141,
      83,   134,   168,   132,   141,   134,   294,    90,   105,    92,
     263,   108,   141,   110,    63,    64,    65,     4,    67,     6,
      63,    64,    65,    33,    67,    39,    40,    14,   134,   112,
      17,    18,    19,    47,   235,   127,    50,    24,   156,   157,
     268,   242,   270,   140,   129,    59,   140,    90,    35,    92,
       3,   134,    95,    40,   315,   432,   152,    44,   432,    92,
      47,   118,   119,    90,   339,    92,   123,   153,   331,   275,
     376,    58,    59,   100,   413,   414,   142,   132,   128,    89,
      90,   530,    92,   128,   138,   373,   156,   143,    96,   377,
     142,   101,   134,   134,   142,     7,   140,     4,   159,     6,
     140,    53,   112,   142,   379,   507,   306,    14,   143,   140,
      17,    18,    19,   136,   148,   134,   142,    46,   128,   143,
     130,   142,   132,   306,   134,   135,   424,   455,    35,    61,
     458,   437,   168,    40,   152,   490,   115,    44,   306,   509,
      47,    33,    23,   344,   345,   346,   103,   134,   120,   124,
     121,    58,    59,   241,   141,   504,   535,   432,   449,   420,
     392,   466,    -1,    -1,    -1,   371,   379,    -1,    82,    -1,
      -1,    -1,    -1,    87,    88,   376,    -1,    -1,   378,    71,
      -1,    73,    74,    97,    76,   529,    78,   101,   102,    -1,
      -1,    -1,    -1,    -1,    -1,   423,    -1,    -1,    90,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    99,   514,    -1,
      -1,   505,   505,   127,    -1,    -1,   504,   131,    -1,    -1,
     112,    -1,   136,    -1,   494,    -1,    -1,   134,   429,    -1,
      -1,    -1,    -1,    -1,   141,    -1,   437,    -1,    -1,    48,
      -1,    -1,   134,   135,    -1,   137,   138,   535,    -1,   449,
      -1,   143,    -1,   145,   146,   147,   148,   149,   150,   151,
      -1,    -1,   154,   155,   492,    -1,   158,    -1,    -1,    -1,
      -1,    -1,    -1,   479,    -1,   481,   477,   483,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   102,   103,   104,   105,   106,   107,   108,
     109,   110,   111,   112,    -1,    -1,    -1,   508,    -1,    -1,
     511,   512,    -1,   514,    -1,     8,    -1,    10,    11,    12,
      13,    -1,    15,    -1,    -1,   134,   135,    20,    21,    22,
      23,   140,   141,    -1,    27,    28,    29,    30,    31,    32,
      33,    34,   543,    36,    -1,    38,    39,    40,    41,    42,
      43,    -1,    45,    -1,    47,    48,    49,    50,    51,    52,
      53,    54,    55,    56,    57,    -1,    59,    -1,    61,    62,
      -1,    -1,    -1,    -1,    -1,    -1,    69,    70,    71,    -1,
      73,    74,    75,    76,    77,    78,    79,    80,    -1,    -1,
      -1,    84,    -1,    -1,    -1,    -1,    89,    90,    91,    92,
      -1,    -1,    -1,    -1,    -1,    -1,    99,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   112,
     113,   114,   115,    -1,   117,   118,   119,   120,   121,   122,
     123,   124,   125,   126,    -1,   128,    -1,   130,    -1,   132,
      -1,   134,   135,    -1,   137,    -1,    -1,   140,    -1,    -1,
      -1,   144,    -1,   146,   147,   148,   149,   150,   151,     1,
      -1,   154,   155,    -1,    -1,   158,     8,    -1,    10,    11,
      12,    13,    -1,    15,    -1,    -1,    -1,    -1,    20,    21,
      22,    23,    -1,    25,    -1,    27,    28,    29,    30,    31,
      32,    -1,    34,    -1,    36,    37,    38,    39,    40,    41,
      42,    43,    -1,    45,    -1,    47,    -1,    49,    50,    51,
      52,    53,    54,    55,    56,    57,    -1,    59,    -1,    61,
      62,    -1,    -1,    -1,    -1,    -1,    -1,    69,    70,    -1,
      -1,    -1,    -1,    75,    -1,    77,    -1,    79,    -1,    -1,
      82,    -1,    -1,    -1,    -1,    87,    88,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    97,    -1,    -1,    -1,   101,
     102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   113,   114,   115,    -1,   117,   118,   119,   120,   121,
     122,   123,   124,   125,   126,   127,    -1,    -1,    -1,   131,
      -1,    -1,    -1,    -1,   136,    -1,     1,    -1,   140,   141,
      -1,    -1,   144,     8,   146,    10,    11,    12,    13,    -1,
      15,    -1,    -1,    -1,    -1,    20,    21,    22,    23,    -1,
      25,    -1,    27,    28,    29,    30,    31,    32,    -1,    34,
      -1,    36,    37,    38,    39,    40,    41,    42,    43,    -1,
      45,    -1,    47,    -1,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    -1,    59,    -1,    61,    62,    -1,    -1,
      -1,    -1,    -1,    -1,    69,    70,    -1,    -1,    -1,    -1,
      75,    -1,    77,    -1,    79,    -1,    -1,    82,    -1,    -1,
      -1,    -1,    87,    88,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    97,    -1,    -1,    -1,   101,   102,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   113,   114,
     115,    -1,   117,   118,   119,   120,   121,   122,   123,   124,
     125,   126,   127,    -1,    -1,    -1,   131,    -1,    -1,    -1,
      -1,   136,    -1,     1,    -1,   140,   141,    -1,    -1,   144,
       8,   146,    10,    11,    12,    13,    -1,    15,    -1,    -1,
      -1,    -1,    20,    21,    22,    23,    -1,    -1,    -1,    27,
      -1,    29,    30,    31,    32,    -1,    -1,    -1,    36,    -1,
      38,    39,    40,    -1,    42,    43,    -1,    45,    -1,    47,
      -1,    49,    50,    51,    52,    53,    54,    55,    56,    57,
      -1,    59,    -1,    61,    62,    -1,    -1,    -1,    -1,    -1,
      -1,    69,    70,    -1,    -1,    -1,    -1,    75,    -1,    77,
      -1,    79,    -1,    -1,    82,    -1,    -1,    -1,    -1,    87,
      88,    89,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    97,
      -1,    -1,    -1,   101,   102,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   113,   114,   115,    -1,   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,     8,   146,    10,
      11,    12,    13,    -1,    15,    -1,    -1,    -1,    -1,    20,
      21,    22,    23,    -1,    -1,    -1,    27,    -1,    29,    30,
      31,    32,    -1,    -1,    -1,    36,    -1,    38,    39,    40,
      -1,    42,    43,    -1,    45,    -1,    47,    -1,    49,    50,
      51,    52,    53,    54,    55,    56,    57,    -1,    59,    -1,
      61,    62,    -1,    -1,    -1,    -1,    -1,    68,    69,    70,
      -1,    -1,    -1,    -1,    75,    -1,    77,    -1,    79,    -1,
      -1,    82,    -1,    -1,    -1,    -1,    87,    88,    89,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    97,    -1,    -1,    -1,
     101,   102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,   113,   114,   115,    -1,   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,     8,   146,    10,    11,    12,    13,
      -1,    15,    -1,    -1,    -1,    -1,    20,    21,    22,    23,
      -1,    -1,    -1,    27,    -1,    29,    30,    31,    32,    -1,
      -1,    -1,    36,    -1,    38,    39,    40,    -1,    42,    43,
      -1,    45,    -1,    47,    -1,    49,    50,    51,    52,    53,
      54,    55,    56,    57,    -1,    59,    -1,    61,    62,    -1,
      -1,    -1,    -1,    -1,    -1,    69,    70,    -1,    -1,    -1,
      -1,    75,    -1,    77,    -1,    79,    -1,    -1,    82,    -1,
      -1,    -1,    -1,    87,    88,    89,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    97,    -1,    -1,    -1,   101,   102,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   113,
     114,   115,    -1,   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,     8,   146,    10,    11,    12,    13,    -1,    15,    -1,
      -1,    -1,    -1,    20,    21,    22,    23,    -1,    -1,    -1,
      27,    -1,    29,    30,    31,    32,    -1,    -1,    -1,    36,
      -1,    38,    39,    40,    -1,    42,    43,    -1,    45,    -1,
      47,    -1,    49,    50,    51,    52,    53,    54,    55,    56,
      57,    -1,    59,    -1,    61,    62,    -1,    -1,    -1,    -1,
      -1,    -1,    69,    70,    -1,    -1,    -1,    -1,    75,    -1,
      77,    -1,    79,    -1,    -1,    82,    -1,    -1,    -1,    -1,
      87,    88,    89,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      97,    -1,    -1,    -1,   101,   102,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,   113,   114,   115,    -1,
     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,     8,   146,
      10,    11,    12,    13,    -1,    15,    -1,    -1,    -1,    -1,
      20,    21,    22,    23,    -1,    -1,    -1,    27,    -1,    29,
      30,    31,    32,    -1,    -1,    -1,    36,    -1,    38,    39,
      40,    -1,    42,    43,    -1,    45,    -1,    47,    -1,    49,
      50,    51,    52,    53,    54,    55,    56,    57,    -1,    59,
      -1,    61,    62,    -1,    -1,    -1,    -1,    -1,    -1,    69,
      70,    -1,    -1,    -1,    -1,    75,    -1,    77,    -1,    79,
      -1,    -1,    82,    -1,    -1,    -1,    -1,    87,    88,    89,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    97,    -1,    -1,
      -1,   101,   102,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   113,   114,   115,    -1,   117,   118,   119,
     120,   121,   122,   123,   124,   125,   126,   127,    16,    -1,
      -1,   131,   132,    -1,    -1,    -1,   136,    -1,     0,     1,
     140,   141,    -1,     5,   144,    33,   146,     9,    -1,    11,
      12,    -1,    -1,    15,    -1,    -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,    53,    -1,    55,    56,    -1,    -1,    -1,    -1,    -1,
      62,    89,    90,    -1,    92,    -1,    -1,    69,    -1,    -1,
      -1,    -1,    -1,   101,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   112,    -1,    -1,    89,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   101,
     128,    -1,   130,    -1,   132,    -1,   134,   135,    -1,    -1,
     112,   113,   114,   115,    -1,   117,   118,   119,   120,   121,
     122,   123,   124,   125,    -1,    -1,    -1,    -1,    -1,    -1,
     132,    -1,   134,    -1,    -1,    -1,    -1,     8,   140,    10,
      11,    12,    13,    -1,    15,    -1,    -1,    -1,    -1,    20,
      21,    22,    23,    -1,    -1,    -1,    27,    -1,    29,    30,
      31,    32,    -1,    -1,    -1,    36,    -1,    38,    39,    40,
      48,    42,    43,    -1,    45,    -1,    47,    -1,    49,    50,
      51,    52,    53,    54,    55,    56,    57,    -1,    59,    -1,
      61,    62,    -1,    -1,    -1,    -1,    -1,    -1,    69,    70,
      -1,    -1,    -1,    -1,    75,    -1,    77,    -1,    79,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   102,   103,   104,   105,   106,   107,
     108,   109,   110,   111,   112,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,   113,   114,   115,    -1,   117,   118,   119,   120,
     121,   122,   123,   124,   125,   126,   134,   135,    -1,    -1,
      -1,    -1,   140,    -1,    -1,    -1,    -1,   138,    -1,   140,
      -1,    -1,    -1,   144,     8,   146,    10,    11,    12,    13,
      -1,    15,    -1,    -1,    -1,    -1,    20,    21,    22,    23,
      -1,    -1,    -1,    27,    -1,    29,    30,    31,    32,    -1,
      -1,    -1,    36,    -1,    38,    39,    40,    48,    42,    43,
      -1,    45,    -1,    47,    -1,    49,    50,    51,    52,    53,
      54,    55,    56,    57,    -1,    59,    -1,    61,    62,    -1,
      -1,    -1,    -1,    -1,    -1,    69,    70,    -1,    -1,    -1,
      -1,    75,    -1,    77,    -1,    79,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   102,   103,   104,   105,   106,   107,   108,   109,   110,
     111,   112,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   113,
     114,   115,    -1,   117,   118,   119,   120,   121,   122,   123,
     124,   125,   126,   134,   135,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    11,    12,   140,    -1,    15,    -1,
     144,    -1,   146,    20,    21,    22,    23,    -1,    -1,    -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,    53,    -1,    55,    56,
      -1,    -1,    -1,    -1,    -1,    62,    -1,    -1,    71,    -1,
      73,    74,    69,    76,    -1,    78,    -1,    80,    -1,    -1,
      -1,    84,    -1,    -1,    71,    -1,    73,    74,    91,    76,
      -1,    78,    -1,    80,    -1,    -1,    99,    84,    -1,    -1,
      -1,    -1,    -1,    -1,    91,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    99,    -1,    -1,    -1,   113,   114,   115,    -1,
     117,   118,   119,   120,   121,   122,   123,   124,   125,    -1,
     127,    -1,    -1,    -1,   137,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   140,   147,   148,   149,   150,   151,    -1,
     137,   154,   155,    -1,    -1,   158,    -1,    -1,    -1,    -1,
     147,   148,   149,   150,   151,    -1,    -1,   154,   155,    -1,
      -1,   158
};

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

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

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		(-2)
#define YYEOF		0

#define YYACCEPT	goto yyacceptlab
#define YYABORT		goto yyabortlab
#define YYERROR		goto yyerrorlab


/* Like YYERROR except do call yyerror.  This remains here temporarily
   to ease the transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */

#define YYFAIL		goto yyerrlab

#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)					\
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    {								\
      yychar = (Token);						\
      yylval = (Value);						\
      yytoken = YYTRANSLATE (yychar);				\
      YYPOPSTACK;						\
      goto yybackup;						\
    }								\
  else								\
    { 								\
      yyerror (_("syntax error: cannot back up")); \
      YYERROR;							\
    }								\
while (0)


#define YYTERROR	1
#define YYERRCODE	256


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

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


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

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


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

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

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

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

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

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

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

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

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


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

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

# define YY_REDUCE_PRINT(Rule)		\
do {					\
  if (yydebug)				\
    yy_reduce_print (Rule);		\
} while (0)

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef	YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif



#if YYERROR_VERBOSE

# ifndef yystrlen
#  if defined (__GLIBC__) && defined (_STRING_H)
#   define yystrlen strlen
#  else
/* Return the length of YYSTR.  */
static YYSIZE_T
#   if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
#   else
yystrlen (yystr)
     const char *yystr;
#   endif
{
  const char *yys = yystr;

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

  return yys - yystr - 1;
}
#  endif
# endif

# ifndef yystpcpy
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
#   define yystpcpy stpcpy
#  else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
   YYDEST.  */
static char *
#   if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
#   else
yystpcpy (yydest, yysrc)
     char *yydest;
     const char *yysrc;
#   endif
{
  char *yyd = yydest;
  const char *yys = yysrc;

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

  return yyd - 1;
}
#  endif
# endif

#endif /* !YYERROR_VERBOSE */



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

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

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

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

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

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

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

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

  switch (yytype)
    {

      default:
        break;
    }
}


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

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






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

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

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

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

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

  int yystate;
  int yyn;
  int yyresult;
  /* Number of tokens to shift before error messages enabled.  */
  int yyerrstatus;
  /* Look-ahead token as an internal (translated) token number.  */
  int yytoken = 0;

  /* Three stacks and their tools:
     `yyss': related to states,
     `yyvs': related to semantic values,
     `yyls': related to locations.

     Refer to the stacks thru separate pointers, to allow yyoverflow
     to reallocate them elsewhere.  */

  /* The state stack.  */
  short int yyssa[YYINITDEPTH];
  short int *yyss = yyssa;
  short int *yyssp;

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

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

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

  YYSIZE_T yystacksize = YYINITDEPTH;

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

  /* When reducing, the number of symbols on the RHS of the reduced
     rule.  */
  int yylen;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss;
  yyvsp = yyvs;
  yylsp = yyls;
#if YYLTYPE_IS_TRIVIAL
  /* Initialize the default location before parsing starts.  */
  yylloc.first_line   = yylloc.last_line   = 1;
  yylloc.first_column = yylloc.last_column = 0;
#endif


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

  goto yysetstate;

/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed. so pushing a state here evens the stacks.
     */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyss + yystacksize - 1 <= yyssp)
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = yyssp - yyss + 1;

#ifdef yyoverflow
      {
	/* Give user a chance to reallocate the stack. Use copies of
	   these so that the &'s don't force the real ones into
	   memory.  */
	YYSTYPE *yyvs1 = yyvs;
	short int *yyss1 = yyss;
	YYLTYPE *yyls1 = yyls;

	/* Each stack pointer address is followed by the size of the
	   data in use in that stack, in bytes.  This used to be a
	   conditional around just the two extra args, but that might
	   be undefined if yyoverflow is a macro.  */
	yyoverflow (_("parser stack overflow"),
		    &yyss1, yysize * sizeof (*yyssp),
		    &yyvs1, yysize * sizeof (*yyvsp),
		    &yyls1, yysize * sizeof (*yylsp),
		    &yystacksize);
	yyls = yyls1;
	yyss = yyss1;
	yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyoverflowlab;
# else
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
	goto yyoverflowlab;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
	yystacksize = YYMAXDEPTH;

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

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

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

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

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

  goto yybackup;

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

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

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

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

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

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

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

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yyn == 0 || yyn == YYTABLE_NINF)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the look-ahead token.  */
  YY_SYMBOL_PRINT (_("Shifting"), yytoken, &yylval, &yylloc);

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

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

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  yystate = yyn;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];

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

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

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

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

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

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

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

  case 10:
#line 576 "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 ());
 		scm_gc_unprotect_object (book->self_scm ());
	;}
    break;

  case 11:
#line 582 "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 ());
 		scm_gc_unprotect_object (score->self_scm ());
	;}
    break;

  case 12:
#line 589 "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 ());
 		scm_gc_unprotect_object (music->self_scm ());
	;}
    break;

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

  case 14:
#line 599 "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 ());
		scm_gc_unprotect_object (od->self_scm ());
	;}
    break;

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

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

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

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

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

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

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

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

/*
 TODO: devise standard for protection in parser.

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

*/
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 41:
#line 752 "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 ());
		scm_gc_unprotect_object ((yyval.book)->paper_->self_scm ());
		(yyval.book)->header_ = THIS->lexer_->lookup_identifier ("$globalheader"); 
	;}
    break;

  case 42:
#line 759 "parser.yy"
    {
		(yyval.book)->paper_ = (yyvsp[0].outputdef);
		scm_gc_unprotect_object ((yyvsp[0].outputdef)->self_scm ());
	;}
    break;

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

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

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

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

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

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

  case 49:
#line 790 "parser.yy"
    {
		(yyval.score) = new Score;
		(yyval.score)->set_spot ((yyloc));
	;}
    break;

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

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

  case 52:
#line 801 "parser.yy"
    {
		SCM m = (yyvsp[0].music)->self_scm ();
		scm_gc_unprotect_object (m);
		(yyval.score)->set_music (m, THIS->self_scm ());
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

  case 63:
#line 887 "parser.yy"
    {

	;}
    break;

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

  case 65:
#line 893 "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);
		scm_gc_unprotect_object ((yyvsp[0].music)->self_scm ());
	;}
    break;

  case 66:
#line 903 "parser.yy"
    {

	;}
    break;

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

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

  case 69:
#line 927 "parser.yy"
    {
		SCM s = (yyval.scm);
 		SCM c = scm_cons ((yyvsp[0].music)->self_scm (), SCM_EOL);
		scm_gc_unprotect_object ((yyvsp[0].music)->self_scm ()); /* 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 70:
#line 938 "parser.yy"
    {

	;}
    break;

  case 71:
#line 941 "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);
		scm_gc_unprotect_object (m->self_scm ()); /* 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 74:
#line 963 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;
	;}
    break;

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

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


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

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

		r-> set_property ("elements",alts);
		if (ly_c_equal_p ((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_int2num (shift), scm_int2num (dots));

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

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

  case 77:
#line 1032 "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 78:
#line 1037 "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 1045 "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 80:
#line 1051 "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 1059 "parser.yy"
    { (yyval.music) = (yyvsp[0].music); ;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 104:
#line 1132 "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 ());
		scm_gc_unprotect_object ((yyvsp[0].music)->self_scm ());
		scm_gc_unprotect_object ((yyvsp[-1].music)->self_scm ());
	;}
    break;

  case 105:
#line 1137 "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 ());
		scm_gc_unprotect_object ((yyvsp[-1].music)->self_scm ());
		scm_gc_unprotect_object ((yyvsp[0].music)->self_scm ());
	;}
    break;

  case 106:
#line 1145 "parser.yy"
    {
		SCM func = scm_car ((yyvsp[0].scm));
		Input *loc = unsmob_input (scm_cadr ((yyvsp[0].scm)));
		SCM args = scm_cddr ((yyvsp[0].scm));
		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 ((yyvsp[0].scm)), sig, args)))
		{
			THIS->error_level_ = 1;
			ok = false;
		}

		SCM m = SCM_EOL;
  		if (ok)
			m = scm_apply_0 (func, scm_cons (THIS->self_scm(),
							 scm_cdr ((yyvsp[0].scm))));

		if (unsmob_music (m))
			{
			(yyval.music) = unsmob_music (m);
			scm_gc_protect_object (m);
			}
		else
			{
			if (ok)
 				loc->error (_ ("music head function must return Music object")); 
			(yyval.music) = MY_MAKE_MUSIC ("Music");
			}
		(yyval.music)->set_spot (*loc);
	;}
    break;

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

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

	;}
    break;

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

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

  case 111:
#line 1199 "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 ());
		scm_gc_unprotect_object (mp->self_scm ());
		(yyval.music)->set_property ("numerator", scm_int2num (n));
		(yyval.music)->set_property ("denominator", scm_int2num (d));
		(yyval.music)->compress (Moment (Rational (n,d)));

	;}
    break;

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

  case 113:
#line 1214 "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 ());
		scm_gc_unprotect_object (p->self_scm ());
	;}
    break;

  case 114:
#line 1224 "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;
		  scm_gc_unprotect_object ((yyvsp[0].music)->self_scm ());
		}
		else
		{
		  (yyval.music) = (yyvsp[0].music);
		}
		THIS->lexer_->pop_state ();
	;}
    break;

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

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

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

  case 118:
#line 1252 "parser.yy"
    {
		tag_music ((yyvsp[0].music), (yyvsp[-1].scm), (yyloc));
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

  case 119:
#line 1259 "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 120:
#line 1266 "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 121:
#line 1272 "parser.yy"
    {
		THIS->lexer_->push_figuredbass_state ();

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

  case 122:
#line 1277 "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 123:
#line 1286 "parser.yy"
    { THIS->lexer_->push_lyric_state ();
		(yyval.scm) = ly_symbol2scm ("lyrics");
	;}
    break;

  case 124:
#line 1292 "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 125:
#line 1298 "parser.yy"
    {
		THIS->lexer_->push_figuredbass_state ();

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

  case 126:
#line 1303 "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 127:
#line 1311 "parser.yy"
    { THIS->lexer_->push_lyric_state ();
		(yyval.scm) = ly_symbol2scm ("Lyrics");
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

  case 137:
#line 1392 "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 138:
#line 1403 "parser.yy"
    {
		(yyval.scm) = scm_list_3 (ly_symbol2scm ("assign"),
			scm_string_to_symbol ((yyvsp[-2].scm)), (yyvsp[0].scm));
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 159:
#line 1487 "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 160:
#line 1497 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

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

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

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

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

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

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

  case 167:
#line 1522 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
/*		if (scm_integer_p ($1) == SCM_BOOL_T)
		{
			int k = scm_to_int (scm_inexact_to_exact ($1));
			$$ = k;
		} else
		{
			THIS->parser_error (@1, _ ("need integer number arg"));
			$$ = 0;
		}*/
	;}
    break;

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

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

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

  case 172:
#line 1568 "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 175:
#line 1588 "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 180:
#line 1617 "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 181:
#line 1626 "parser.yy"
    { (yyval.scm) = SCM_EOL; ;}
    break;

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

  case 183:
#line 1635 "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_int2num (q-1));
		}

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

  case 184:
#line 1662 "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 185:
#line 1677 "parser.yy"
    {
		SCM adder = ly_lily_module_constant ("add-quotable");
		
		scm_call_2 (adder, (yyvsp[-1].scm), (yyvsp[0].music)->self_scm ());
		scm_gc_unprotect_object ((yyvsp[0].music)->self_scm ());
	;}
    break;

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

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

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

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

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

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

  case 190:
#line 1716 "parser.yy"
    {
		Music *m = MY_MAKE_MUSIC ("LigatureEvent");
		m->set_property ("span-direction", scm_int2num (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));
		scm_gc_unprotect_object (m->self_scm ());
	;}
    break;

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

  case 192:
#line 1730 "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 193:
#line 1740 "parser.yy"
    {
		Pitch middle_c;
		Pitch sounds_as_c = pitch_interval (*unsmob_pitch ((yyvsp[0].scm)), middle_c);
		(yyval.music) = set_property_music (ly_symbol2scm ("instrumentTransposition"),
					 sounds_as_c.smobbed_copy());
		(yyval.music)->set_spot ((yyloc));
		(yyval.music) = context_spec_music (ly_symbol2scm ("Staff"), SCM_UNDEFINED,
			(yyval.music), SCM_EOL);
	;}
    break;

  case 194:
#line 1749 "parser.yy"
    {
		Music *t = set_property_music (ly_symbol2scm ("whichBar"), (yyvsp[0].scm));

		Music *csm = context_spec_music (ly_symbol2scm ("Timing"), SCM_UNDEFINED,
					t, SCM_EOL);
		(yyval.music) = context_spec_music (ly_symbol2scm ("Score"), SCM_UNDEFINED, csm, SCM_EOL);
		(yyval.music)->set_spot ((yyloc));
		t->set_spot ((yyloc));
	;}
    break;

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

  case 196:
#line 1768 "parser.yy"
    {
		SCM proc = ly_lily_module_constant ("make-clef-set");

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

  case 197:
#line 1775 "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);
		scm_gc_protect_object (result);
		(yyval.music) = unsmob_music (result);
	;}
    break;

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

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

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

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

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

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

  case 203:
#line 1806 "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 204:
#line 1824 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;
	;}
    break;

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

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

  case 207:
#line 1841 "parser.yy"
    {
		tag_music ((yyvsp[0].music), (yyvsp[-1].scm), (yyloc));
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

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

  case 209:
#line 1852 "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 210:
#line 1857 "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 211:
#line 1862 "parser.yy"
    {
		if ((yyvsp[-1].i))
			(yyvsp[0].music)->set_property ("direction", scm_int2num ((yyvsp[-1].i)));
		(yyval.music) = (yyvsp[0].music);
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

  case 225:
#line 1918 "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 226:
#line 1932 "parser.yy"
    {
		(yyval.music) = unsmob_music ((yyvsp[0].scm));
	;}
    break;

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

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

  case 229:
#line 1947 "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 230:
#line 1958 "parser.yy"
    { (yyval.scm) = SCM_EOL; ;}
    break;

  case 231:
#line 1959 "parser.yy"
    { (yyval.scm) = scm_int2num (0); ;}
    break;

  case 232:
#line 1960 "parser.yy"
    { (yyval.scm) = scm_int2num ((yyvsp[0].i)); ;}
    break;

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

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

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

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

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

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

  case 239:
#line 1986 "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 240:
#line 1991 "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 241:
#line 2003 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

  case 242:
#line 2006 "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 243:
#line 2011 "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 244:
#line 2020 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

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

  case 248:
#line 2037 "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 249:
#line 2045 "parser.yy"
    {
		Music *t = MY_MAKE_MUSIC ("FingerEvent");
		t->set_property ("digit", scm_int2num ((yyvsp[0].i)));
		t->set_spot ((yyloc));
		(yyval.music) = t;
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 264:
#line 2108 "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 265:
#line 2117 "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 266:
#line 2126 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

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

  case 268:
#line 2132 "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 269:
#line 2140 "parser.yy"
    { (yyval.scm) = (yyvsp[0].scm); ;}
    break;

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

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

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

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

  case 274:
#line 2159 "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 275:
#line 2167 "parser.yy"
    {
		(yyval.scm) = scm_number_to_string (scm_int2num ((yyvsp[0].i)), scm_int2num (10));
		(yyval.scm) = scm_list_2 (ly_lily_module_constant ("number-markup"),
				(yyval.scm));
	;}
    break;

  case 276:
#line 2172 "parser.yy"
    {
		(yyval.scm) = scm_number_to_string (scm_int2num ((yyvsp[0].i)), scm_int2num (10));
		(yyval.scm) = scm_list_2 (ly_lily_module_constant ("number-markup"),
				(yyval.scm));
	;}
    break;

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

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

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

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

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

  case 282:
#line 2188 "parser.yy"
    {
		Music *bfr = MY_MAKE_MUSIC ("BassFigureEvent");
		(yyval.scm) = bfr->self_scm ();
		scm_gc_unprotect_object ((yyval.scm));
	;}
    break;

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

		bfr->set_property ("figure", (yyvsp[0].scm));

		scm_gc_unprotect_object ((yyval.scm));
	;}
    break;

  case 284:
#line 2201 "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_int2num (alter + (yyvsp[0].i)));
		} else {
			m->set_property ("alteration", scm_int2num (0));
		}
	;}
    break;

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

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

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

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

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

  case 290:
#line 2238 "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 291:
#line 2248 "parser.yy"
    { (yyval.i) = 0; ;}
    break;

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

  case 293:
#line 2253 "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_int2num (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 ()));
		scm_gc_unprotect_object (n->self_scm ());

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

  case 294:
#line 2285 "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 ()));
		scm_gc_unprotect_object (n->self_scm ());
		v->set_spot ((yyloc));
		n->set_spot ((yyloc));
		(yyval.music) = v;
		
	;}
    break;

  case 295:
#line 2298 "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 296:
#line 2307 "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));

		scm_gc_unprotect_object (ev->self_scm ());

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

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

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

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

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

  case 299:
#line 2347 "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 300:
#line 2355 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;

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

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

  case 303:
#line 2367 "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 304:
#line 2374 "parser.yy"
    {
		(yyval.scm) = SCM_EOL;		
	;}
    break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  case 370:
#line 2638 "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 371:
#line 2642 "parser.yy"
    {
		(yyval.scm) = (yyvsp[0].scm);
	;}
    break;


      default: break;
    }

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

  YY_STACK_PRINT (yyss, yyssp);

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

  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTOKENS];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
#if YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (YYPACT_NINF < yyn && yyn < YYLAST)
	{
	  int yytype = YYTRANSLATE (yychar);
	  YYSIZE_T yysize0 = yystrlen (yytname[yytype]);
	  YYSIZE_T yysize = yysize0;
	  YYSIZE_T yysize1;
	  int yysize_overflow = 0;
	  char *yymsg = 0;
#	  define YYERROR_VERBOSE_ARGS_MAXIMUM 5
	  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
	  int yyx;

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

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

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

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

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

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

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

  yyerror_range[0] = yylloc;

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

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

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


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

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

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


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;	/* Each real token shifted decrements this.  */

  for (;;)
    {
      yyn = yypact[yystate];
      if (yyn != YYPACT_NINF)
	{
	  yyn += YYTERROR;
	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
	    {
	      yyn = yytable[yyn];
	      if (0 < yyn)
		break;
	    }
	}

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
	YYABORT;

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

  if (yyn == YYFINAL)
    YYACCEPT;

  *++yyvsp = yylval;

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

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

  yystate = yyn;
  goto yynewstate;


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

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yydestruct (_("Error: discarding lookahead"),
              yytoken, &yylval, &yylloc);
  yychar = YYEMPTY;
  yyresult = 1;
  goto yyreturn;

#ifndef yyoverflow
/*----------------------------------------------.
| yyoverflowlab -- parser overflow comes here.  |
`----------------------------------------------*/
yyoverflowlab:
  yyerror (_("parser stack overflow"));
  yyresult = 2;
  /* Fall through.  */
#endif

yyreturn:
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}


#line 2647 "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 (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_));
		return dynamic_cast<Event*> (mus)
			? 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::markup_p (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_sym = 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 ("poppush")
		 || tag == ly_symbol2scm ("push"))
		{
		m = MY_MAKE_MUSIC ("OverrideProperty");
		grob_sym = scm_car (args);
		grob_val = scm_cadr (args);
		}
	else if (tag == ly_symbol2scm ("pop")) {
		m = MY_MAKE_MUSIC ("RevertProperty");
		grob_sym = scm_car (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_sym != SCM_UNDEFINED)
		{
		bool itc = do_internal_type_checking_global;
		/* UGH.
		*/
		bool autobeam = ly_c_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
		if (autobeam)
			do_internal_type_checking_global = false;
		m->set_property ("grob-property", grob_sym);
		if (autobeam)
			do_internal_type_checking_global = itc;
		}

	if (tag == ly_symbol2scm ("poppush"))
		m->set_property ("pop-first", SCM_BOOL_T);


	return m;
}

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

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

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

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

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


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


