Index: /libcuefile/trunk/cd.c
===================================================================
--- /libcuefile/trunk/cd.c	(revision 415)
+++ /libcuefile/trunk/cd.c	(revision 415)
@@ -0,0 +1,329 @@
+/*
+ * cd.c -- cd functions
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "cd.h"
+
+typedef struct Data Data;
+struct Data {
+	int type;			/* DataType */
+	char *name;			/* data source name */
+	long start;			/* start time for data */
+	long length;			/* length of data */
+};
+
+struct Track {
+	Data zero_pre;			/* pre-gap generated with zero data */
+	Data file;			/* track data file */
+	Data zero_post;			/* post-gap generated with zero data */
+	int mode;			/* track mode */
+	int sub_mode;			/* sub-channel mode */
+	int flags;			/* flags */
+	char *isrc;			/* IRSC Code (5.22.4) 12 bytes */
+	Cdtext *cdtext;			/* CD-TEXT */
+	int nindex;			/* number of indexes */
+	long index[MAXINDEX];		/* indexes (in frames) (5.29.2.5)
+					 * relative to start of track
+					 * index[0] should always be zero */
+};
+
+struct Cd {
+	int mode;			/* disc mode */
+	char *catalog;			/* Media Catalog Number (5.22.3) */
+	Cdtext *cdtext;			/* CD-TEXT */
+	int ntrack;			/* number of tracks in album */
+	Track *track[MAXTRACK];		/* array of tracks */
+};
+
+Cd *cd_init ()
+{
+	Cd *cd = NULL;
+	cd = malloc(sizeof(Cd));
+
+	if(NULL == cd) {
+		fprintf(stderr, "unable to create cd\n");
+	} else {
+		cd->mode = MODE_CD_DA;
+		cd->catalog = NULL;
+		cd->cdtext = cdtext_init();
+		cd->ntrack = 0;
+	}
+
+	return cd;
+}
+
+Track *track_init ()
+{
+	Track *track = NULL;
+	track = malloc(sizeof(Track));
+
+	if (NULL == track) {
+		fprintf(stderr, "unable to create track\n");
+	} else {
+		track->zero_pre.type = DATA_ZERO;
+		track->zero_pre.name = NULL;
+		track->zero_pre.start = 0;
+		track->zero_pre.length = 0;
+
+		track->file.type = DATA_AUDIO;
+		track->file.name = NULL;
+		track->file.start = 0;
+		track->file.length = 0;
+
+		track->zero_post.type = DATA_ZERO;
+		track->zero_post.name = NULL;
+		track->zero_post.start = 0;
+		track->zero_post.length = 0;
+
+		track->mode = MODE_AUDIO;
+		track->sub_mode = SUB_MODE_RW;
+		track->flags = FLAG_NONE;
+		track->isrc = NULL;
+		track->cdtext = cdtext_init();
+		track->nindex = 0;
+	}
+
+	return track;
+}
+
+/*
+ * cd structure functions
+ */
+void cd_set_mode (Cd *cd, int mode)
+{
+	cd->mode = mode;
+}
+
+int cd_get_mode (Cd *cd)
+{
+	return cd->mode;
+}
+
+void cd_set_catalog (Cd *cd, char *catalog)
+{
+	if (cd->catalog)
+		free(cd->catalog);
+
+	cd->catalog = strdup(catalog);
+}
+
+char *cd_get_catalog (Cd *cd)
+{
+	return cd->catalog;
+}
+
+Cdtext *cd_get_cdtext (Cd *cd)
+{
+	return cd->cdtext;
+}
+
+Track *cd_add_track (Cd *cd)
+{
+	if (MAXTRACK - 1 > cd->ntrack)
+		cd->ntrack++;
+	else
+		fprintf(stderr, "too many tracks\n");
+
+	/* this will reinit last track if there were too many */
+	cd->track[cd->ntrack - 1] = track_init();
+
+	return cd->track[cd->ntrack - 1];
+}
+
+
+int cd_get_ntrack (Cd *cd)
+{
+	return cd->ntrack;
+}
+
+Track *cd_get_track (Cd *cd, int i)
+{
+	if (0 < i <= cd->ntrack)
+		return cd->track[i - 1];
+
+	return NULL;
+}
+
+/*
+ * track structure functions
+ */
+
+void track_set_filename (Track *track, char *filename)
+{
+	if (track->file.name)
+		free(track->file.name);
+
+	track->file.name = strdup(filename);
+}
+
+char *track_get_filename (Track *track)
+{
+	return track->file.name;
+}
+
+void track_set_start (Track *track, long start)
+{
+	track->file.start = start;
+}
+
+long track_get_start (Track *track)
+{
+	return track->file.start;
+}
+
+void track_set_length (Track *track, long length)
+{
+	track->file.length = length;
+}
+
+long track_get_length (Track *track)
+{
+	return track->file.length;
+}
+
+void track_set_mode (Track *track, int mode)
+{
+	track->mode = mode;
+}
+
+int track_get_mode (Track *track)
+{
+	return track->mode;
+}
+
+void track_set_sub_mode (Track *track, int sub_mode)
+{
+	track->sub_mode = sub_mode;
+}
+
+int track_get_sub_mode (Track *track)
+{
+	return track->sub_mode;
+}
+
+void track_set_flag (Track *track, int flag)
+{
+	track->flags |= flag;
+}
+
+void track_clear_flag (Track *track, int flag)
+{
+	track->flags &= ~flag;
+}
+
+int track_is_set_flag (Track *track, int flag)
+{
+	return track->flags & flag;
+}
+
+void track_set_zero_pre (Track *track, long length)
+{
+	track->zero_pre.length = length;
+}
+
+long track_get_zero_pre (Track *track)
+{
+	return track->zero_pre.length;
+}
+
+void track_set_zero_post (Track *track, long length)
+{
+	track->zero_post.length = length;
+}
+
+long track_get_zero_post (Track *track)
+{
+	return track->zero_post.length;
+}
+void track_set_isrc (Track *track, char *isrc)
+{
+	if (track->isrc)
+		free(track->isrc);
+
+	track->isrc = strdup(isrc);
+}
+
+char *track_get_isrc (Track *track)
+{
+	return track->isrc;
+}
+
+Cdtext *track_get_cdtext (Track *track)
+{
+	return track->cdtext;
+}
+
+void track_add_index (Track *track, long index)
+{
+	if (MAXTRACK - 1 > track->nindex)
+		track->nindex++;
+	else
+		fprintf(stderr, "too many indexes\n");
+
+	/* this will overwrite last index if there were too many */
+	track->index[track->nindex - 1] = index;
+}
+
+int track_get_nindex (Track *track)
+{
+	return track->nindex;
+}
+
+long track_get_index (Track *track, int i)
+{
+	if (0 <= i < track->nindex)
+		return track->index[i];
+
+	return -1;
+}
+
+/*
+ * dump cd information
+ */
+void cd_track_dump (Track *track)
+{
+	int i;
+
+	printf("zero_pre: %ld\n", track->zero_pre.length);
+	printf("filename: %s\n", track->file.name);
+	printf("start: %ld\n", track->file.start);
+	printf("length: %ld\n", track->file.length);
+	printf("zero_post: %ld\n", track->zero_post.length);
+	printf("mode: %d\n", track->mode);
+	printf("sub_mode: %d\n", track->sub_mode);
+	printf("flags: 0x%x\n", track->flags);
+	printf("isrc: %s\n", track->isrc);
+	printf("indexes: %d\n", track->nindex);
+
+	for (i = 0; i < track->nindex; ++i)
+		printf("index %d: %ld\n", i, track->index[i]);
+
+	if (NULL != track->cdtext) {
+		printf("cdtext:\n");
+		cdtext_dump(track->cdtext, 1);
+	}
+}
+
+void cd_dump (Cd *cd)
+{
+	int i;
+
+	printf("Disc Info\n");
+	printf("mode: %d\n", cd->mode);
+	printf("catalog: %s\n", cd->catalog);
+	if (NULL != cd->cdtext) {
+		printf("cdtext:\n");
+		cdtext_dump(cd->cdtext, 0);
+	}
+
+	for (i = 0; i < cd->ntrack; ++i) {
+		printf("Track %d Info\n", i + 1);
+		cd_track_dump(cd->track[i]);
+	}
+}
Index: /libcuefile/trunk/cd.h
===================================================================
--- /libcuefile/trunk/cd.h	(revision 415)
+++ /libcuefile/trunk/cd.h	(revision 415)
@@ -0,0 +1,161 @@
+/*
+ * cd.h -- cd structure
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+/* references: MMC-3 draft revsion - 10g */
+
+#ifndef CD_H
+#define CD_H
+
+#include "cdtext.h"
+
+#define MAXTRACK	99	/* Red Book track limit */
+#define MAXINDEX	99	/* Red Book index limit */
+
+/*
+ * disc modes
+ * DATA FORM OF MAIN DATA (5.29.2.8)
+ */
+enum DiscMode {
+	MODE_CD_DA,		/* CD-DA */
+	MODE_CD_ROM,		/* CD-ROM mode 1 */
+	MODE_CD_ROM_XA		/* CD-ROM XA and CD-I */
+};
+
+/*
+ * track modes
+ * 5.29.2.8 DATA FORM OF MAIN DATA
+ * Table 350 - Data Block Type Codes
+ */
+enum TrackMode {
+	MODE_AUDIO,		/* 2352 byte block length */
+	MODE_MODE1,		/* 2048 byte block length */
+	MODE_MODE1_RAW,		/* 2352 byte block length */
+	MODE_MODE2,		/* 2336 byte block length */
+	MODE_MODE2_FORM1,	/* 2048 byte block length */
+	MODE_MODE2_FORM2,	/* 2324 byte block length */
+	MODE_MODE2_FORM_MIX,	/* 2332 byte block length */
+	MODE_MODE2_RAW		/* 2352 byte block length */
+};
+
+/*
+ * sub-channel mode
+ * 5.29.2.13 Data Form of Sub-channel
+ * NOTE: not sure if this applies to cue files
+ */
+enum TrackSubMode {
+	SUB_MODE_RW,		/* RAW Data */
+	SUB_MODE_RW_RAW		/* PACK DATA (written R-W */
+};
+
+/*
+ * track flags
+ * Q Sub-channel Control Field (4.2.3.3, 5.29.2.2)
+ */
+enum TrackFlag {
+	FLAG_NONE		=0x00,	/* no flags set */
+	FLAG_PRE_EMPHASIS	=0x01,	/* audio recorded with pre-emphasis */
+	FLAG_COPY_PERMITTED	=0x02,	/* digital copy permitted */
+	FLAG_DATA		=0x04,	/* data track */
+	FLAG_FOUR_CHANNEL	=0x08,	/* 4 audio channels */
+	FLAG_SCMS		=0x10,	/* SCMS (not Q Sub-ch.) (5.29.2.7) */
+	FLAG_ANY		=0xff	/* any flags set */
+};
+
+enum DataType {
+	DATA_AUDIO,
+	DATA_DATA,
+	DATA_FIFO,
+	DATA_ZERO
+};
+
+/* ADTs */
+typedef struct Cd Cd;
+typedef struct Track Track;
+
+/* return pointer to CD structure */
+Cd *cd_init ();
+
+/* dump all info from CD structure
+ * in human readable format (for debugging)
+ */
+void cd_dump (Cd *cd);
+
+/*
+ * Cd functions
+ */
+
+void cd_set_mode (Cd *cd, int mode);
+int cd_get_mode (Cd *cd);
+
+void cd_set_catalog (Cd *cd, char *catalog);
+char *cd_get_catalog (Cd *cd);
+
+/*
+ * return pointer to cd's Cdtext
+ */
+Cdtext *cd_get_cdtext (Cd *cd);
+
+/*
+ * add a new track to cd, increment number of tracks
+ * and return pointer to new track
+ */
+Track *cd_add_track (Cd *cd);
+
+/*
+ * return number of tracks in cd
+ */
+int cd_get_ntrack (Cd *cd);
+
+Track *cd_get_track (Cd *cd, int i);
+
+/*
+ * Track functions
+ */
+
+/* filename of data file */
+void track_set_filename (Track *track, char *filename);
+char *track_get_filename (Track *track);
+
+/* track start is starting position in data file */
+void track_set_start (Track *track, long start);
+long track_get_start (Track *track);
+
+/* track length is length of data file to use */
+void track_set_length (Track *track, long length);
+long track_get_length (Track *track);
+
+/* see enum TrackMode */
+void track_set_mode (Track *track, int mode);
+int track_get_mode (Track *track);
+
+/* see enum TrackSubMode */
+void track_set_sub_mode (Track *track, int sub_mode);
+int track_get_sub_mode (Track *track);
+
+/* see enum TrackFlag */
+void track_set_flag (Track *track, int flag);
+void track_clear_flag (Track *track, int flag);
+int track_is_set_flag (Track *track, int flag);
+
+/* zero data pregap */
+void track_set_zero_pre (Track *track, long length);
+long track_get_zero_pre (Track *track);
+
+/* zero data postgap */
+void track_set_zero_post (Track *track, long length);
+long track_get_zero_post (Track *track);
+
+void track_set_isrc (Track *track, char *isrc);
+char *track_get_isrc (Track *track);
+
+Cdtext *track_get_cdtext (Track *track);
+
+void track_add_index (Track *track, long index);
+int track_get_nindex (Track *track);
+long track_get_index (Track *track, int i);
+
+#endif
Index: /libcuefile/trunk/cdtext.c
===================================================================
--- /libcuefile/trunk/cdtext.c	(revision 415)
+++ /libcuefile/trunk/cdtext.c	(revision 415)
@@ -0,0 +1,166 @@
+/*
+ * cdtext.c -- cdtext data structure and functions
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "cdtext.h"
+
+struct Cdtext {
+	int pti;
+	int format;
+	char *value;
+};
+
+Cdtext *cdtext_init ()
+{
+	Cdtext *new_cdtext = NULL;
+
+	Cdtext cdtext[] = {
+		{PTI_TITLE,		FORMAT_CHAR,	NULL},
+		{PTI_PERFORMER,		FORMAT_CHAR,	NULL},
+		{PTI_SONGWRITER,	FORMAT_CHAR,	NULL},
+		{PTI_COMPOSER,		FORMAT_CHAR,	NULL},
+		{PTI_ARRANGER,		FORMAT_CHAR,	NULL},
+		{PTI_MESSAGE,		FORMAT_CHAR,	NULL},
+		{PTI_DISC_ID,		FORMAT_BINARY,	NULL},
+		{PTI_GENRE,		FORMAT_BINARY,	NULL},
+		{PTI_TOC_INFO1,		FORMAT_BINARY,	NULL},
+		{PTI_TOC_INFO2,		FORMAT_BINARY,	NULL},
+		{PTI_RESERVED1,		FORMAT_CHAR,	NULL},
+		{PTI_RESERVED2,		FORMAT_CHAR,	NULL},
+		{PTI_RESERVED3,		FORMAT_CHAR,	NULL},
+		{PTI_RESERVED4,		FORMAT_CHAR,	NULL},
+		{PTI_UPC_ISRC,		FORMAT_CHAR,	NULL},
+		{PTI_SIZE_INFO,		FORMAT_BINARY,	NULL},
+		{PTI_END,		FORMAT_CHAR,	NULL}
+	};
+
+	new_cdtext = (Cdtext *) calloc (sizeof (cdtext) / sizeof (Cdtext), sizeof (Cdtext));
+	if (NULL == new_cdtext)
+		fprintf (stderr, "problem allocating memory\n");
+	else
+		memcpy (new_cdtext, cdtext, sizeof(cdtext));
+
+	return new_cdtext;
+}
+
+void cdtext_delete (Cdtext *cdtext)
+{
+	int i;
+
+	if (NULL != cdtext) {
+		for (i = 0; PTI_END != cdtext[i].pti; i++)
+			free (cdtext[i].value);
+		free (cdtext);
+	}
+}
+
+/* return 0 if there is no cdtext, returns non-zero otherwise */
+int cdtext_is_empty (Cdtext *cdtext)
+{
+	for (; PTI_END != cdtext->pti; cdtext++)
+		if (NULL != cdtext->value)
+			return -1;
+
+	return 0;
+}
+
+/* sets cdtext's pti entry to field */
+void cdtext_set (int pti, char *value, Cdtext *cdtext)
+{
+	if (NULL != value)	/* don't pass NULL to strdup */
+		for (; PTI_END != cdtext->pti; cdtext++)
+			if (pti == cdtext->pti) {
+				free (cdtext->value);
+				cdtext->value = strdup (value);
+			}
+}
+
+/* returns value for pti, NULL if pti is not found */
+char *cdtext_get (int pti, Cdtext *cdtext)
+{
+	for (; PTI_END != cdtext->pti; cdtext++)
+		if (pti == cdtext->pti)
+			return cdtext->value;
+
+	return NULL;
+}
+
+const char *cdtext_get_key (int pti, int istrack)
+{
+	char *key = NULL;
+
+	switch (pti) {
+	case PTI_TITLE:
+		key = "TITLE";
+		break;
+	case PTI_PERFORMER:
+		key = "PERFORMER";
+		break;
+	case PTI_SONGWRITER:
+		key = "SONGWRITER";
+		break;
+	case PTI_COMPOSER:
+		key = "COMPOSER";
+		break;
+	case PTI_ARRANGER:
+		key = "ARRANGER";
+		break;
+	case PTI_MESSAGE:
+		key = "MESSAGE";
+		break;
+	case PTI_DISC_ID:
+		key = "DISC_ID";
+		break;
+	case PTI_GENRE:
+		key = "GENRE";
+		break;
+	case PTI_TOC_INFO1:
+		key = "TOC_INFO1";
+		break;
+	case PTI_TOC_INFO2:
+		key = "TOC_INFO1";
+		break;
+	case PTI_RESERVED1:
+		/* reserved */
+		break;
+	case PTI_RESERVED2:
+		/* reserved */
+		break;
+	case PTI_RESERVED3:
+		/* reserved */
+		break;
+	case PTI_RESERVED4:
+		/* reserved */
+		break;
+	case PTI_UPC_ISRC:
+		if (0 == istrack)
+			key = "UPC_EAN";
+		else
+			key = "ISRC";
+		break;
+	case PTI_SIZE_INFO:
+		key = "SIZE_INFO";
+		break;
+	}
+
+	return key;
+}
+
+void cdtext_dump (Cdtext *cdtext, int istrack)
+{
+	int pti;
+	char *value = NULL;
+
+	for (pti = 0; PTI_END != pti; pti++) {
+		if (NULL != (value = cdtext_get(pti, cdtext))) {
+			printf("%s: ", cdtext_get_key(pti, istrack));
+			printf("%s\n", value);
+		}
+	}
+}
Index: /libcuefile/trunk/cdtext.h
===================================================================
--- /libcuefile/trunk/cdtext.h	(revision 415)
+++ /libcuefile/trunk/cdtext.h	(revision 415)
@@ -0,0 +1,71 @@
+/*
+ * cdtext.h
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+/* references: MMC-3 draft revsion - 10g */
+
+#ifndef CDTEXT_H
+#define CDTEXT_H
+
+#include <stdio.h>
+
+/* cdtext pack type indicators */
+enum Pti {
+	PTI_TITLE,	/* title of album or track titles */
+	PTI_PERFORMER,	/* name(s) of the performer(s) */
+	PTI_SONGWRITER,	/* name(s) of the songwriter(s) */
+	PTI_COMPOSER,	/* name(s) of the composer(s) */
+	PTI_ARRANGER,	/* name(s) of the arranger(s) */
+	PTI_MESSAGE,	/* message(s) from the content provider and/or artist */
+	PTI_DISC_ID,	/* (binary) disc identification information */
+	PTI_GENRE,	/* (binary) genre identification and genre information */
+	PTI_TOC_INFO1,	/* (binary) table of contents information */
+	PTI_TOC_INFO2,	/* (binary) second table of contents information */
+	PTI_RESERVED1,	/* reserved */
+	PTI_RESERVED2,	/* reserved */
+	PTI_RESERVED3,	/* reserved */
+	PTI_RESERVED4,	/* reserved for content provider only */
+	PTI_UPC_ISRC,	/* UPC/EAN code of the album and ISRC code of each track */
+	PTI_SIZE_INFO,	/* (binary) size information of the block */
+	PTI_END		/* terminating PTI (for stepping through PTIs) */
+};
+
+enum PtiFormat {
+	FORMAT_CHAR,		/* single or double byte character string */
+	FORMAT_BINARY		/* binary data */
+};
+
+typedef struct Cdtext Cdtext;
+
+/* return a pointer to a new Cdtext */
+Cdtext *cdtext_init ();
+
+/* release a Cdtext */
+void cdtext_delete (Cdtext *cdtext);
+
+/* returns non-zero if there are no CD-TEXT fields set, zero otherwise */
+int cdtext_is_empty (Cdtext *cdtext);
+
+/* set CD-TEXT field to value for PTI pti */
+void cdtext_set (int pti, char *value, Cdtext *cdtext);
+
+/* returns pointer to CD-TEXT value for PTI pti */
+char *cdtext_get (int pti, Cdtext *cdtext);
+
+/*
+ * returns appropriate string for PTI pti
+ * if istrack is zero, UPC/EAN string will be returned for PTI_UPC_ISRC
+ * othwise ISRC string will be returned
+ */
+const char *cdtext_get_key (int pti, int istrack);
+
+/*
+ * dump all cdtext info
+ * in human readable format (for debugging)
+ */
+void cdtext_dump (Cdtext *cdtext, int istrack);
+
+#endif
Index: /libcuefile/trunk/cue.h
===================================================================
--- /libcuefile/trunk/cue.h	(revision 415)
+++ /libcuefile/trunk/cue.h	(revision 415)
@@ -0,0 +1,9 @@
+/*
+ * cue.h -- cue function declarations
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+Cd *cue_parse (FILE *fp);
+void cue_print (FILE *fp, Cd *cd);
Index: /libcuefile/trunk/cue_parse.c
===================================================================
--- /libcuefile/trunk/cue_parse.c	(revision 415)
+++ /libcuefile/trunk/cue_parse.c	(revision 415)
@@ -0,0 +1,1526 @@
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Written by Richard Stallman by simplifying the original so called
+   ``semantic'' parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     NUMBER = 258,
+     STRING = 259,
+     CATALOG = 260,
+     CDTEXTFILE = 261,
+     FFILE = 262,
+     BINARY = 263,
+     MOTOROLA = 264,
+     AIFF = 265,
+     WAVE = 266,
+     MP3 = 267,
+     TRACK = 268,
+     AUDIO = 269,
+     MODE1_2048 = 270,
+     MODE1_2352 = 271,
+     MODE2_2336 = 272,
+     MODE2_2048 = 273,
+     MODE2_2342 = 274,
+     MODE2_2332 = 275,
+     MODE2_2352 = 276,
+     TRACK_ISRC = 277,
+     FLAGS = 278,
+     PRE = 279,
+     DCP = 280,
+     FOUR_CH = 281,
+     SCMS = 282,
+     PREGAP = 283,
+     INDEX = 284,
+     POSTGAP = 285,
+     TITLE = 286,
+     PERFORMER = 287,
+     SONGWRITER = 288,
+     COMPOSER = 289,
+     ARRANGER = 290,
+     MESSAGE = 291,
+     DISC_ID = 292,
+     GENRE = 293,
+     TOC_INFO1 = 294,
+     TOC_INFO2 = 295,
+     UPC_EAN = 296,
+     ISRC = 297,
+     SIZE_INFO = 298
+   };
+#endif
+#define NUMBER 258
+#define STRING 259
+#define CATALOG 260
+#define CDTEXTFILE 261
+#define FFILE 262
+#define BINARY 263
+#define MOTOROLA 264
+#define AIFF 265
+#define WAVE 266
+#define MP3 267
+#define TRACK 268
+#define AUDIO 269
+#define MODE1_2048 270
+#define MODE1_2352 271
+#define MODE2_2336 272
+#define MODE2_2048 273
+#define MODE2_2342 274
+#define MODE2_2332 275
+#define MODE2_2352 276
+#define TRACK_ISRC 277
+#define FLAGS 278
+#define PRE 279
+#define DCP 280
+#define FOUR_CH 281
+#define SCMS 282
+#define PREGAP 283
+#define INDEX 284
+#define POSTGAP 285
+#define TITLE 286
+#define PERFORMER 287
+#define SONGWRITER 288
+#define COMPOSER 289
+#define ARRANGER 290
+#define MESSAGE 291
+#define DISC_ID 292
+#define GENRE 293
+#define TOC_INFO1 294
+#define TOC_INFO2 295
+#define UPC_EAN 296
+#define ISRC 297
+#define SIZE_INFO 298
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 1 "cue_parse.y"
+
+/*
+ * cue_parse.y -- parser for cue files
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "cd.h"
+#include "time.h"
+#include "cue_parse_prefix.h"
+
+#define YYDEBUG 1
+
+extern int yylex();
+void yyerror (char *s);
+
+static Cd *cd = NULL;
+static Track *track = NULL;
+static Track *prev_track = NULL;
+static Cdtext *cdtext = NULL;
+static char *prev_filename = NULL;	/* last file in or before last track */
+static char *cur_filename = NULL;	/* last file in the last track */
+static char *new_filename = NULL;	/* last file in this track */
+
+
+/* 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 32 "cue_parse.y"
+typedef union YYSTYPE {
+	long ival;
+	char *sval;
+} YYSTYPE;
+/* Line 191 of yacc.c.  */
+#line 195 "cue_parse.c"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 214 of yacc.c.  */
+#line 207 "cue_parse.c"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# if YYSTACK_USE_ALLOCA
+#  define YYSTACK_ALLOC alloca
+# else
+#  ifndef YYSTACK_USE_ALLOCA
+#   if defined (alloca) || defined (_ALLOCA_H)
+#    define YYSTACK_ALLOC alloca
+#   else
+#    ifdef __GNUC__
+#     define YYSTACK_ALLOC __builtin_alloca
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning. */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+#  if defined (__STDC__) || defined (__cplusplus)
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   define YYSIZE_T size_t
+#  endif
+#  define YYSTACK_ALLOC malloc
+#  define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+     && (! defined (__cplusplus) \
+	 || (YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  short yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_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) + sizeof (YYSTYPE))				\
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  register YYSIZE_T yyi;		\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (0)
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+   typedef signed char yysigned_char;
+#else
+   typedef short yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL  3
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   120
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS  46
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS  19
+/* YYNRULES -- Number of rules. */
+#define YYNRULES  61
+/* YYNRULES -- Number of states. */
+#define YYNSTATES  91
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   298
+
+#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,
+      44,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    45,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     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
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const unsigned char yyprhs[] =
+{
+       0,     0,     3,     7,     8,     9,    12,    16,    20,    22,
+      24,    27,    32,    34,    37,    41,    43,    45,    47,    49,
+      51,    52,    57,    59,    61,    63,    65,    67,    69,    71,
+      73,    75,    78,    80,    84,    88,    92,    97,   101,   103,
+     106,   107,   110,   112,   114,   116,   118,   122,   124,   126,
+     128,   130,   132,   134,   136,   138,   140,   142,   144,   146,
+     148,   150
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+      47,     0,    -1,    48,    49,    52,    -1,    -1,    -1,    49,
+      50,    -1,     5,     4,    44,    -1,     6,     4,    44,    -1,
+      62,    -1,    51,    -1,     1,    44,    -1,     7,     4,    54,
+      44,    -1,    53,    -1,    52,    53,    -1,    55,    56,    58,
+      -1,     8,    -1,     9,    -1,    10,    -1,    11,    -1,    12,
+      -1,    -1,    13,     3,    57,    44,    -1,    14,    -1,    15,
+      -1,    16,    -1,    17,    -1,    18,    -1,    19,    -1,    20,
+      -1,    21,    -1,    59,    -1,    58,    59,    -1,    62,    -1,
+      23,    60,    44,    -1,    22,     4,    44,    -1,    28,    64,
+      44,    -1,    29,     3,    64,    44,    -1,    30,    64,    44,
+      -1,    51,    -1,     1,    44,    -1,    -1,    60,    61,    -1,
+      24,    -1,    25,    -1,    26,    -1,    27,    -1,    63,     4,
+      44,    -1,    31,    -1,    32,    -1,    33,    -1,    34,    -1,
+      35,    -1,    36,    -1,    37,    -1,    38,    -1,    39,    -1,
+      40,    -1,    41,    -1,    42,    -1,    43,    -1,     3,    -1,
+       3,    45,     3,    45,     3,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const unsigned short yyrline[] =
+{
+       0,    99,    99,   103,   109,   111,   115,   116,   117,   118,
+     119,   123,   133,   134,   138,   142,   143,   144,   145,   146,
+     150,   171,   177,   178,   179,   180,   181,   182,   183,   184,
+     188,   189,   193,   194,   195,   196,   197,   217,   218,   219,
+     222,   224,   228,   229,   230,   231,   235,   239,   240,   241,
+     242,   243,   244,   245,   246,   247,   248,   249,   250,   251,
+     255,   256
+};
+#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", "NUMBER", "STRING", "CATALOG", 
+  "CDTEXTFILE", "FFILE", "BINARY", "MOTOROLA", "AIFF", "WAVE", "MP3", 
+  "TRACK", "AUDIO", "MODE1_2048", "MODE1_2352", "MODE2_2336", 
+  "MODE2_2048", "MODE2_2342", "MODE2_2332", "MODE2_2352", "TRACK_ISRC", 
+  "FLAGS", "PRE", "DCP", "FOUR_CH", "SCMS", "PREGAP", "INDEX", "POSTGAP", 
+  "TITLE", "PERFORMER", "SONGWRITER", "COMPOSER", "ARRANGER", "MESSAGE", 
+  "DISC_ID", "GENRE", "TOC_INFO1", "TOC_INFO2", "UPC_EAN", "ISRC", 
+  "SIZE_INFO", "'\\n'", "':'", "$accept", "cuefile", "new_cd", 
+  "global_statements", "global_statement", "track_data", "track_list", 
+  "track", "file_format", "new_track", "track_def", "track_mode", 
+  "track_statements", "track_statement", "track_flags", "track_flag", 
+  "cdtext", "cdtext_item", "time", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const unsigned short yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
+     295,   296,   297,   298,    10,    58
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const unsigned char yyr1[] =
+{
+       0,    46,    47,    48,    49,    49,    50,    50,    50,    50,
+      50,    51,    52,    52,    53,    54,    54,    54,    54,    54,
+      55,    56,    57,    57,    57,    57,    57,    57,    57,    57,
+      58,    58,    59,    59,    59,    59,    59,    59,    59,    59,
+      60,    60,    61,    61,    61,    61,    62,    63,    63,    63,
+      63,    63,    63,    63,    63,    63,    63,    63,    63,    63,
+      64,    64
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const unsigned char yyr2[] =
+{
+       0,     2,     3,     0,     0,     2,     3,     3,     1,     1,
+       2,     4,     1,     2,     3,     1,     1,     1,     1,     1,
+       0,     4,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     2,     1,     3,     3,     3,     4,     3,     1,     2,
+       0,     2,     1,     1,     1,     1,     3,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     5
+};
+
+/* 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 char yydefact[] =
+{
+       3,     0,     4,     1,     0,     0,     0,     0,     0,    47,
+      48,    49,    50,    51,    52,    53,    54,    55,    56,    57,
+      58,    59,     5,     9,     2,    12,     0,     8,     0,    10,
+       0,     0,     0,    13,     0,     0,     0,     6,     7,    15,
+      16,    17,    18,    19,     0,     0,     0,     0,    40,     0,
+       0,     0,    38,     0,    30,    32,    46,    11,    22,    23,
+      24,    25,    26,    27,    28,    29,     0,    39,     0,     0,
+      60,     0,     0,     0,    31,    21,    34,    42,    43,    44,
+      45,    33,    41,     0,    35,     0,    37,     0,    36,     0,
+      61
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yysigned_char yydefgoto[] =
+{
+      -1,     1,     2,     4,    22,    52,    24,    25,    44,    26,
+      35,    66,    53,    54,    69,    82,    55,    28,    71
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -49
+static const yysigned_char yypact[] =
+{
+     -49,     2,   -49,   -49,    56,   -40,     1,     4,     5,   -49,
+     -49,   -49,   -49,   -49,   -49,   -49,   -49,   -49,   -49,   -49,
+     -49,   -49,   -49,   -49,    -7,   -49,    -3,   -49,     7,   -49,
+     -32,   -25,     6,   -49,    17,    43,   -23,   -49,   -49,   -49,
+     -49,   -49,   -49,   -49,   -19,    90,   -18,    23,   -49,    42,
+      44,    42,   -49,     0,   -49,   -49,   -49,   -49,   -49,   -49,
+     -49,   -49,   -49,   -49,   -49,   -49,     8,   -49,     9,    76,
+       3,    10,    42,    11,   -49,   -49,   -49,   -49,   -49,   -49,
+     -49,   -49,   -49,    46,   -49,    12,   -49,    13,   -49,    48,
+     -49
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yysigned_char yypgoto[] =
+{
+     -49,   -49,   -49,   -49,   -49,    55,   -49,    22,   -49,   -49,
+     -49,   -49,   -49,    14,   -49,   -49,    60,   -49,   -48
+};
+
+/* 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 -21
+static const yysigned_char yytable[] =
+{
+     -14,    46,     3,    73,    29,    30,   -20,     8,    31,    32,
+      34,    36,    37,   -14,    39,    40,    41,    42,    43,    38,
+      45,    56,    47,    48,    85,    57,    67,    68,    49,    50,
+      51,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+      18,    19,    20,    21,    46,    70,    33,    72,    83,    87,
+       8,    90,    75,    76,    84,    86,    88,     5,    89,    23,
+       0,     6,     7,     8,    27,    47,    48,    74,     0,   -20,
+       0,    49,    50,    51,     9,    10,    11,    12,    13,    14,
+      15,    16,    17,    18,    19,    20,    21,     9,    10,    11,
+      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
+      77,    78,    79,    80,    58,    59,    60,    61,    62,    63,
+      64,    65,     0,     0,     0,     0,     0,     0,     0,     0,
+      81
+};
+
+static const yysigned_char yycheck[] =
+{
+       0,     1,     0,    51,    44,     4,    13,     7,     4,     4,
+      13,     4,    44,    13,     8,     9,    10,    11,    12,    44,
+       3,    44,    22,    23,    72,    44,    44,     4,    28,    29,
+      30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
+      40,    41,    42,    43,     1,     3,    24,     3,    45,     3,
+       7,     3,    44,    44,    44,    44,    44,     1,    45,     4,
+      -1,     5,     6,     7,     4,    22,    23,    53,    -1,    13,
+      -1,    28,    29,    30,    31,    32,    33,    34,    35,    36,
+      37,    38,    39,    40,    41,    42,    43,    31,    32,    33,
+      34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
+      24,    25,    26,    27,    14,    15,    16,    17,    18,    19,
+      20,    21,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      44
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const unsigned char yystos[] =
+{
+       0,    47,    48,     0,    49,     1,     5,     6,     7,    31,
+      32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
+      42,    43,    50,    51,    52,    53,    55,    62,    63,    44,
+       4,     4,     4,    53,    13,    56,     4,    44,    44,     8,
+       9,    10,    11,    12,    54,     3,     1,    22,    23,    28,
+      29,    30,    51,    58,    59,    62,    44,    44,    14,    15,
+      16,    17,    18,    19,    20,    21,    57,    44,     4,    60,
+       3,    64,     3,    64,    59,    44,    44,    24,    25,    26,
+      27,    44,    61,    45,    44,    64,    44,     3,    44,    45,
+       3
+};
+
+#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 yyerrlab1
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK;						\
+      goto yybackup;						\
+    }								\
+  else								\
+    { 								\
+      yyerror ("syntax error: cannot back up");\
+      YYERROR;							\
+    }								\
+while (0)
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+   are run).  */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)         \
+  Current.first_line   = Rhs[1].first_line;      \
+  Current.first_column = Rhs[1].first_column;    \
+  Current.last_line    = Rhs[N].last_line;       \
+  Current.last_column  = Rhs[N].last_column;
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#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 YYDSYMPRINT(Args)			\
+do {						\
+  if (yydebug)					\
+    yysymprint Args;				\
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location)		\
+do {								\
+  if (yydebug)							\
+    {								\
+      YYFPRINTF (stderr, "%s ", Title);				\
+      yysymprint (stderr, 					\
+                  Token, Value);	\
+      YYFPRINTF (stderr, "\n");					\
+    }								\
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (cinluded).                                                   |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short *bottom, short *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    short *bottom;
+    short *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 yylineno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+             yyrule - 1, yylineno);
+  /* 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 YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, 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
+   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined (__GLIBC__) && defined (_STRING_H)
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+static YYSIZE_T
+#   if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+#   else
+yystrlen (yystr)
+     const char *yystr;
+#   endif
+{
+  register const char *yys = yystr;
+
+  while (*yys++ != '\0')
+    continue;
+
+  return yys - yystr - 1;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+#   if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+#   else
+yystpcpy (yydest, yysrc)
+     char *yydest;
+     const char *yysrc;
+#   endif
+{
+  register char *yyd = yydest;
+  register const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+
+
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  if (yytype < YYNTOKENS)
+    {
+      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+    }
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  switch (yytype)
+    {
+      default:
+        break;
+    }
+  YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  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 */
+
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| 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
+{
+  
+  register int yystate;
+  register int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Lookahead token as an internal (translated) token number.  */
+  int 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	yyssa[YYINITDEPTH];
+  short *yyss = yyssa;
+  register short *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK   (yyvsp--, yyssp--)
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* When reducing, the number of symbols on the RHS of the reduced
+     rule.  */
+  int yylen;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed. so pushing a state here evens the stacks.
+     */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (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 *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow ("parser stack overflow",
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyoverflowlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyoverflowlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+      {
+	short *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyoverflowlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (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 lookahead token if we need one and don't already have one.  */
+/* yyresume: */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead 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);
+      YYDSYMPRINTF ("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 lookahead token.  */
+  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+  /* Discard the token being shifted unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  *++yyvsp = yylval;
+
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 3:
+#line 103 "cue_parse.y"
+    {
+		cd = cd_init();
+		cdtext = cd_get_cdtext(cd);
+	}
+    break;
+
+  case 6:
+#line 115 "cue_parse.y"
+    { cd_set_catalog(cd, yyvsp[-1].sval); }
+    break;
+
+  case 7:
+#line 116 "cue_parse.y"
+    { /* ignored */ }
+    break;
+
+  case 11:
+#line 123 "cue_parse.y"
+    {
+		if (NULL != new_filename) {
+			yyerror("too many files specified\n");
+			free(new_filename);
+		}
+		new_filename = strdup(yyvsp[-2].sval);
+	}
+    break;
+
+  case 20:
+#line 150 "cue_parse.y"
+    {
+		/* save previous track, to later set length */
+		prev_track = track;
+
+		track = cd_add_track(cd);
+		cdtext = track_get_cdtext(track);
+
+		cur_filename = new_filename;
+		if (NULL != cur_filename)
+			prev_filename = cur_filename;
+
+		if (NULL == prev_filename)
+			yyerror("no file specified for track");
+		else
+			track_set_filename(track, prev_filename);
+
+		new_filename = NULL;
+	}
+    break;
+
+  case 21:
+#line 171 "cue_parse.y"
+    {
+		track_set_mode(track, yyvsp[-1].ival);
+	}
+    break;
+
+  case 34:
+#line 195 "cue_parse.y"
+    { track_set_isrc(track, yyvsp[-1].sval); }
+    break;
+
+  case 35:
+#line 196 "cue_parse.y"
+    { track_set_zero_pre(track, yyvsp[-1].ival); }
+    break;
+
+  case 36:
+#line 197 "cue_parse.y"
+    {
+		int i = track_get_nindex(track);
+		long prev_length;
+
+		if (0 == i) {
+			/* first index */
+			track_set_start(track, yyvsp[-1].ival);
+
+			if (NULL != prev_track && NULL == cur_filename) {
+				/* track shares file with previous track */
+				prev_length = yyvsp[-1].ival - track_get_start(prev_track);
+				track_set_length(prev_track, prev_length);
+			}
+		}
+
+		for (; i <= yyvsp[-2].ival; i++)
+			track_add_index(track, \
+			track_get_zero_pre(track) + yyvsp[-1].ival \
+			- track_get_start(track));
+	}
+    break;
+
+  case 37:
+#line 217 "cue_parse.y"
+    { track_set_zero_post(track, yyvsp[-1].ival); }
+    break;
+
+  case 41:
+#line 224 "cue_parse.y"
+    { track_set_flag(track, yyvsp[0].ival); }
+    break;
+
+  case 46:
+#line 235 "cue_parse.y"
+    { cdtext_set (yyvsp[-2].ival, yyvsp[-1].sval, cdtext); }
+    break;
+
+  case 61:
+#line 256 "cue_parse.y"
+    { yyval.ival = time_msf_to_frame(yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival); }
+    break;
+
+
+    }
+
+/* Line 991 of yacc.c.  */
+#line 1289 "cue_parse.c"
+
+
+  yyvsp -= yylen;
+  yyssp -= yylen;
+
+
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if YYERROR_VERBOSE
+      yyn = yypact[yystate];
+
+      if (YYPACT_NINF < yyn && yyn < YYLAST)
+	{
+	  YYSIZE_T yysize = 0;
+	  int yytype = YYTRANSLATE (yychar);
+	  char *yymsg;
+	  int yyx, yycount;
+
+	  yycount = 0;
+	  /* Start YYX at -YYN if negative to avoid negative indexes in
+	     YYCHECK.  */
+	  for (yyx = yyn < 0 ? -yyn : 0;
+	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+	  yysize += yystrlen ("syntax error, unexpected ") + 1;
+	  yysize += yystrlen (yytname[yytype]);
+	  yymsg = (char *) YYSTACK_ALLOC (yysize);
+	  if (yymsg != 0)
+	    {
+	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+	      yyp = yystpcpy (yyp, yytname[yytype]);
+
+	      if (yycount < 5)
+		{
+		  yycount = 0;
+		  for (yyx = yyn < 0 ? -yyn : 0;
+		       yyx < (int) (sizeof (yytname) / sizeof (char *));
+		       yyx++)
+		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+		      {
+			const char *yyq = ! yycount ? ", expecting " : " or ";
+			yyp = yystpcpy (yyp, yyq);
+			yyp = yystpcpy (yyp, yytname[yyx]);
+			yycount++;
+		      }
+		}
+	      yyerror (yymsg);
+	      YYSTACK_FREE (yymsg);
+	    }
+	  else
+	    yyerror ("syntax error; also virtual memory exhausted");
+	}
+      else
+#endif /* YYERROR_VERBOSE */
+	yyerror ("syntax error");
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+	 error, discard it.  */
+
+      /* Return failure if at end of input.  */
+      if (yychar == YYEOF)
+        {
+	  /* Pop the error token.  */
+          YYPOPSTACK;
+	  /* Pop the rest of the stack.  */
+	  while (yyss < yyssp)
+	    {
+	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+	      yydestruct (yystos[*yyssp], yyvsp);
+	      YYPOPSTACK;
+	    }
+	  YYABORT;
+        }
+
+      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+      yydestruct (yytoken, &yylval);
+      yychar = YYEMPTY;
+
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab2;
+
+
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action.  |
+`----------------------------------------------------*/
+yyerrlab1:
+
+  /* Suppress GCC warning that yyerrlab1 is unused when no action
+     invokes YYERROR.  MacOS 10.2.3's buggy "smart preprocessor"
+     insists on the trailing semicolon.  */
+#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
+  __attribute__ ((__unused__));
+#endif
+
+
+  goto yyerrlab2;
+
+
+/*---------------------------------------------------------------.
+| yyerrlab2 -- pop states until the error token can be shifted.  |
+`---------------------------------------------------------------*/
+yyerrlab2:
+  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;
+
+      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+      yydestruct (yystos[yystate], yyvsp);
+      yyvsp--;
+      yystate = *--yyssp;
+
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  YYDPRINTF ((stderr, "Shifting error token, "));
+
+  *++yyvsp = yylval;
+
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here.  |
+`----------------------------------------------*/
+yyoverflowlab:
+  yyerror ("parser stack overflow");
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+  return yyresult;
+}
+
+
+#line 98 "cue_parse.y"
+
+
+/* lexer interface */
+extern int cue_lineno;
+extern int yydebug;
+extern FILE *cue_yyin;
+
+void yyerror (char *s)
+{
+	fprintf(stderr, "%d: %s\n", cue_lineno, s);
+}
+
+Cd *cue_parse (FILE *fp)
+{
+	cue_yyin = fp;
+	yydebug = 0;
+
+	if (0 == yyparse())
+		return cd;
+
+	return NULL;
+}
+
Index: /libcuefile/trunk/cue_parse.h
===================================================================
--- /libcuefile/trunk/cue_parse.h	(revision 415)
+++ /libcuefile/trunk/cue_parse.h	(revision 415)
@@ -0,0 +1,136 @@
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     NUMBER = 258,
+     STRING = 259,
+     CATALOG = 260,
+     CDTEXTFILE = 261,
+     FFILE = 262,
+     BINARY = 263,
+     MOTOROLA = 264,
+     AIFF = 265,
+     WAVE = 266,
+     MP3 = 267,
+     TRACK = 268,
+     AUDIO = 269,
+     MODE1_2048 = 270,
+     MODE1_2352 = 271,
+     MODE2_2336 = 272,
+     MODE2_2048 = 273,
+     MODE2_2342 = 274,
+     MODE2_2332 = 275,
+     MODE2_2352 = 276,
+     TRACK_ISRC = 277,
+     FLAGS = 278,
+     PRE = 279,
+     DCP = 280,
+     FOUR_CH = 281,
+     SCMS = 282,
+     PREGAP = 283,
+     INDEX = 284,
+     POSTGAP = 285,
+     TITLE = 286,
+     PERFORMER = 287,
+     SONGWRITER = 288,
+     COMPOSER = 289,
+     ARRANGER = 290,
+     MESSAGE = 291,
+     DISC_ID = 292,
+     GENRE = 293,
+     TOC_INFO1 = 294,
+     TOC_INFO2 = 295,
+     UPC_EAN = 296,
+     ISRC = 297,
+     SIZE_INFO = 298
+   };
+#endif
+#define NUMBER 258
+#define STRING 259
+#define CATALOG 260
+#define CDTEXTFILE 261
+#define FFILE 262
+#define BINARY 263
+#define MOTOROLA 264
+#define AIFF 265
+#define WAVE 266
+#define MP3 267
+#define TRACK 268
+#define AUDIO 269
+#define MODE1_2048 270
+#define MODE1_2352 271
+#define MODE2_2336 272
+#define MODE2_2048 273
+#define MODE2_2342 274
+#define MODE2_2332 275
+#define MODE2_2352 276
+#define TRACK_ISRC 277
+#define FLAGS 278
+#define PRE 279
+#define DCP 280
+#define FOUR_CH 281
+#define SCMS 282
+#define PREGAP 283
+#define INDEX 284
+#define POSTGAP 285
+#define TITLE 286
+#define PERFORMER 287
+#define SONGWRITER 288
+#define COMPOSER 289
+#define ARRANGER 290
+#define MESSAGE 291
+#define DISC_ID 292
+#define GENRE 293
+#define TOC_INFO1 294
+#define TOC_INFO2 295
+#define UPC_EAN 296
+#define ISRC 297
+#define SIZE_INFO 298
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 32 "cue_parse.y"
+typedef union YYSTYPE {
+	long ival;
+	char *sval;
+} YYSTYPE;
+/* Line 1249 of yacc.c.  */
+#line 127 "cue_parse.h"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE yylval;
+
+
+
Index: /libcuefile/trunk/cue_parse_prefix.h
===================================================================
--- /libcuefile/trunk/cue_parse_prefix.h	(revision 415)
+++ /libcuefile/trunk/cue_parse_prefix.h	(revision 415)
@@ -0,0 +1,44 @@
+/* Remap normal yacc names so we can have multiple parsers
+ * see http://www.gnu.org/software/automake/manual/html_node/Yacc-and-Lex.html
+ */
+
+#define yymaxdepth	cue_yymaxdepth
+#define yyparse		cue_yyparse
+#define yylex		cue_yylex
+#define yyerror		cue_yyerror
+#define yylval		cue_yylval
+#define yychar		cue_yychar
+#define yydebug		cue_yydebug
+#define yypact		cue_yypact
+#define yyr1		cue_yyr1
+#define yyr2		cue_yyr2
+#define yydef		cue_yydef
+#define yychk		cue_yychk
+#define yypgo		cue_yypgo
+#define yyact		cue_yyact
+#define yyexca		cue_yyexca
+#define yyerrflag	cue_yyerrflag
+#define yynerrs		cue_yynerrs
+#define yyps		cue_yyps
+#define yypv		cue_yypv
+#define yys		cue_yys
+#define yy_yys		cue_yy_yys
+#define yystate		cue_yystate
+#define yytmp		cue_yytmp
+#define yyv		cue_yyv
+#define yy_yyv		cue_yy_yyv
+#define yyval		cue_yyval
+#define yylloc		cue_yylloc
+#define yyreds		cue_yyreds
+#define yytoks		cue_yytoks
+#define yylhs		cue_yylhs
+#define yylen		cue_yylen
+#define yydefred	cue_yydefred
+#define yydgoto		cue_yydgoto
+#define yysinde		cue_yysindex
+#define yyrindex	cue_yyrindex
+#define yygindex	cue_yygindex
+#define yytable		cue_yytable
+#define yycheck		cue_yycheck
+#define yyname		cue_yyname
+#define yyrule		cue_yyrule
Index: /libcuefile/trunk/cue_print.c
===================================================================
--- /libcuefile/trunk/cue_print.c	(revision 415)
+++ /libcuefile/trunk/cue_print.c	(revision 415)
@@ -0,0 +1,147 @@
+/*
+ * cue_print.y -- print cue file
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "cd.h"
+#include "time.h"
+
+void cue_print_track (FILE *fp, Track *track, int trackno);
+void cue_print_cdtext (Cdtext *cdtext, FILE *fp, int istrack);
+void cue_print_index (long i, FILE *fp);
+char *filename = "";	/* last track datafile */
+long prev_length = 0;	/* last track length */
+
+/* prints cd in cue format */
+void cue_print (FILE *fp, Cd *cd)
+{
+	Cdtext *cdtext = cd_get_cdtext(cd);
+	int i; 	/* track */
+	Track *track = NULL;
+
+	/* print global information */
+	if (NULL != cd_get_catalog(cd))
+		fprintf(fp, "CATALOG %s\n", cd_get_catalog(cd));
+
+	cue_print_cdtext(cdtext, fp, 0);
+
+	/* print track information */
+	for (i = 1; i <= cd_get_ntrack(cd); i++) {
+		track = cd_get_track(cd, i);
+		fprintf(fp, "\n");
+		cue_print_track(fp, track, i);
+	}
+}
+
+void cue_print_track (FILE *fp, Track *track, int trackno)
+{
+	Cdtext *cdtext = track_get_cdtext(track);
+	int i; 	/* index */
+
+	if (NULL != track_get_filename(track)) {
+		/*
+		 * always print filename for track 1, afterwards only
+		 * print filename if it differs from the previous track
+		 */
+		if (0 != strcmp(track_get_filename(track), filename)) {
+			filename = track_get_filename(track);
+			fprintf(fp, "FILE \"%s\" ", filename);
+
+			/* NOTE: what to do with other formats (MP3, etc)? */
+			if (MODE_AUDIO == track_get_mode(track))
+				fprintf(fp, "WAVE\n");
+			else
+				fprintf(fp, "BINARY\n");
+		}
+	}
+
+	fprintf(fp, "TRACK %02d ", trackno);
+	switch (track_get_mode(track)) {
+	case MODE_AUDIO:
+		fprintf(fp, "AUDIO\n");
+		break;
+	case MODE_MODE1:
+		fprintf(fp, "MODE1/2048\n");
+		break;
+	case MODE_MODE1_RAW:
+		fprintf(fp, "MODE1/2352\n");
+		break;
+	case MODE_MODE2:
+		fprintf(fp, "MODE2/2048\n");
+		break;
+	case MODE_MODE2_FORM1:
+		fprintf(fp, "MODE2/2336\n");
+		break;
+	case MODE_MODE2_FORM2:
+		fprintf(fp, "MODE2/2324\n");
+		break;
+	case MODE_MODE2_FORM_MIX:
+		fprintf(fp, "MODE2/2336\n");
+		break;
+	case MODE_MODE2_RAW:
+		fprintf(fp, "MODE2/2352\n");
+		break;
+	}
+
+	cue_print_cdtext(cdtext, fp, 1);
+
+	if (0 != track_is_set_flag(track, FLAG_ANY)) {
+		fprintf(fp, "FLAGS");
+		if (0 != track_is_set_flag(track, FLAG_PRE_EMPHASIS))
+			fprintf(fp, " PRE");
+		if (0 != track_is_set_flag(track, FLAG_COPY_PERMITTED))
+			fprintf(fp, " DCP");
+		if (0 != track_is_set_flag(track, FLAG_FOUR_CHANNEL))
+			fprintf(fp, " 4CH");
+		if (0 != track_is_set_flag(track, FLAG_SCMS))
+			fprintf(fp, " SCMS");
+		fprintf(fp, "\n");
+	}
+
+	if (NULL != track_get_isrc(track))
+		fprintf(fp, "ISRC %s\n", track_get_isrc(track));
+
+	if (0 != track_get_zero_pre(track))
+		fprintf (fp, "PREGAP %s\n", time_frame_to_mmssff(track_get_zero_pre(track)));
+
+	/* don't print index 0 if index 1 = 0 */
+	if (track_get_index(track, 1) == 0)
+		i = 1;
+	else
+		i = 0;
+
+	for (; i < track_get_nindex(track); i++) {
+		fprintf(fp, "INDEX %02d ", i);
+		cue_print_index( \
+		track_get_index(track, i) \
+		+ track_get_start(track) \
+		- track_get_zero_pre(track) , fp);
+	}
+
+	if (0 != track_get_zero_post(track))
+		fprintf (fp, "POSTGAP %s\n", time_frame_to_mmssff(track_get_zero_post(track)));
+
+	prev_length = track_get_length(track);
+}
+
+void cue_print_cdtext (Cdtext *cdtext, FILE *fp, int istrack)
+{
+	int pti;
+	char *value = NULL;
+
+	for (pti = 0; PTI_END != pti; pti++) {
+		if (NULL != (value = cdtext_get(pti, cdtext))) {
+			fprintf(fp, "%s", cdtext_get_key(pti, istrack));
+			fprintf(fp, " \"%s\"\n", value);
+		}
+	}
+}
+
+void cue_print_index (long i, FILE *fp)
+{
+	fprintf (fp, "%s\n", time_frame_to_mmssff(i));
+}
Index: /libcuefile/trunk/cue_scan.c
===================================================================
--- /libcuefile/trunk/cue_scan.c	(revision 415)
+++ /libcuefile/trunk/cue_scan.c	(revision 415)
@@ -0,0 +1,2072 @@
+#define yy_create_buffer cue_yy_create_buffer
+#define yy_delete_buffer cue_yy_delete_buffer
+#define yy_scan_buffer cue_yy_scan_buffer
+#define yy_scan_string cue_yy_scan_string
+#define yy_scan_bytes cue_yy_scan_bytes
+#define yy_flex_debug cue_yy_flex_debug
+#define yy_init_buffer cue_yy_init_buffer
+#define yy_flush_buffer cue_yy_flush_buffer
+#define yy_load_buffer_state cue_yy_load_buffer_state
+#define yy_switch_to_buffer cue_yy_switch_to_buffer
+#define yyin cue_yyin
+#define yyleng cue_yyleng
+#define yylex cue_yylex
+#define yyout cue_yyout
+#define yyrestart cue_yyrestart
+#define yytext cue_yytext
+
+#line 19 "cue_scan.c"
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $NetBSD: flex.skl,v 1.20 2004/02/01 21:24:02 christos Exp $
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+#include <unistd.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif	/* __STDC__ */
+#endif	/* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator).  This
+ * avoids problems with code like:
+ *
+ * 	if ( condition_holds )
+ *		yyless( 5 );
+ *	else
+ *		do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		*yy_cp = yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+	};
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;		/* whether we need to initialize */
+static int yy_start = 0;	/* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, yy_size_t len ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+#define yywrap() 1
+#define YY_SKIP_YYWRAP
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ))
+#ifdef __GNUC__
+    __attribute__((__unused__))
+#endif
+;
+static void yy_flex_free YY_PROTO(( void * ));
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yytext_ptr = yy_bp; \
+	yyleng = (int) (yy_cp - yy_bp); \
+	yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 50
+#define YY_END_OF_BUFFER 51
+static yyconst short int yy_accept[431] =
+    {   0,
+        0,    0,    0,    0,   51,   49,   44,   48,   49,   49,
+       45,   45,   46,   49,   49,   49,   49,   49,   49,   49,
+       49,   49,   49,   49,   49,   49,   44,   47,   49,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,   44,
+        0,    2,    0,    0,    1,    0,   45,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,   44,   47,    0,    0,
+        3,    3,    2,    3,    3,    1,    3,    3,    3,    3,
+
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    2,    1,
+       24,    0,    0,    0,    0,    0,    0,    0,   23,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   11,    0,
+        0,   22,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    2,    1,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    9,    0,    0,    0,    0,    0,
+
+        0,    0,    6,    0,    0,    0,   42,    0,    0,    0,
+        0,    0,    0,   25,    0,    0,    0,    0,    0,    0,
+       10,    0,   43,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    0,   13,    0,    0,    0,    0,    0,   21,   36,
+       27,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,   29,    0,   12,    0,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    0,    7,
+
+        0,    0,    0,    0,   40,    0,    0,    0,    0,    0,
+        0,   26,    0,    0,    0,    0,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    0,    4,    0,    0,   35,   34,    0,
+        0,    0,    0,   28,    0,    0,    0,   39,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,   33,    0,   32,    0,    0,    0,    0,
+        8,    0,    0,    0,    0,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    0,    0,    0,
+        0,    0,    0,    0,   30,   41,    0,   37,   38,    3,
+
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    5,   14,   15,   17,   19,   16,   18,   20,   31,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    0
+    } ;
+
+static yyconst int yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    4,    1,    1,    1,    1,    5,    1,
+        1,    1,    1,    1,    1,    1,    6,    7,    8,    9,
+       10,   11,   12,   13,   14,   15,   14,   16,    1,    1,
+        1,    1,    1,    1,   17,   18,   19,   20,   21,   22,
+       23,   24,   25,    1,   26,   27,   28,   29,   30,   31,
+        1,   32,   33,   34,   35,   36,   37,   38,   39,   40,
+        1,   41,    1,    1,   42,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst int yy_meta[43] =
+    {   0,
+        1,    2,    2,    1,    1,    1,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1
+    } ;
+
+static yyconst short int yy_base[439] =
+    {   0,
+        0,   41,   73,  114,  540,  541,  537,  541,  114,  115,
+        0,  519,  541,   20,  512,   29,   28,   23,  515,   25,
+       30,   35,   38,   39,  504,  517,  119,  541,  512,    0,
+      121,  124,  159,  513,    0,  103,  506,  113,   47,  107,
+      509,  107,  118,  120,  112,  128,  498,  511,  506,  524,
+      140,  541,  141,  142,  541,  149,    0,  501,  502,  491,
+      502,  492,  486,  485,  490,  486,  483,  488,  497,  484,
+      492,  479,  477,  141,  499,  476,  474,  485,  477,  464,
+      474,  468,  482,  483,  480,  462,  161,  541,  476,  468,
+        0,  174,    0,  182,  186,    0,  192,    0,  471,  472,
+
+      461,  472,  462,  456,  455,  460,  456,  453,  458,  467,
+      454,  462,  449,  447,  167,  469,  446,  444,  455,  447,
+      434,  444,  438,  452,  453,  450,  432,  439,  155,  175,
+      541,  444,  448,  439,  446,  445,  440,  429,  541,  440,
+      437,  434,  424,  434,  435,  420,  431,  421,  541,  428,
+      415,  425,  414,  425,  422,  417,  401,  423,  399,  419,
+      436,  196,  200,    0,  416,  420,  411,  418,  417,  412,
+      401,    0,  412,  409,  406,  396,  406,  407,  392,  403,
+      393,    0,  400,  387,  397,  386,  397,  394,  389,  373,
+      395,  371,  391,  204,  541,  382,  380,  377,  381,  369,
+
+      376,  363,  541,  371,  382,  364,  399,  383,  200,  367,
+      368,  374,  379,  541,  353,  357,  372,  367,  365,  369,
+      541,  386,  541,    0,  359,  357,  354,  358,  346,  353,
+      340,    0,  348,  359,  341,  376,  360,  202,  344,  345,
+      351,  356,    0,  330,  334,  349,  344,  342,  346,    0,
+      210,  343,  541,  326,  334,  329,  329,  336,  541,  541,
+      541,  215,  337,  353,  352,  327,  324,  338,  323,  328,
+      320,  541,  322,  541,  333,  326,    0,  309,  317,  312,
+      312,  319,    0,    0,    0,  320,  336,  335,  310,  307,
+      321,  306,  311,  303,    0,  305,    0,  316,  311,  541,
+
+      308,  308,  308,  308,  541,  306,  317,  316,  297,  295,
+      291,  541,  292,  295,  297,  289,  296,    0,  293,  293,
+      293,  293,  291,  302,  301,  282,  280,  276,    0,  277,
+      280,  282,  274,  270,  541,  276,  268,  541,  541,  211,
+      215,  282,  277,  541,  275,  262,  265,  541,  262,    0,
+      268,  260,    0,    0,  219,  221,  274,  269,    0,  267,
+      254,  257,    0,  541,  259,  541,  274,  272,  272,  224,
+      541,  250,  251,  259,  230,    0,  252,    0,  267,  265,
+      265,  232,    0,  243,  244,  252,  237,  238,  235,  240,
+      233,  211,  231,  223,  541,  541,  198,  541,  541,  193,
+
+      189,  183,  164,  238,  148,  110,    0,    0,   38,    0,
+        0,  541,  541,  541,  541,  541,  541,  541,  541,  541,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  541,
+      251,  254,   59,  257,  260,  263,  266,  269
+    } ;
+
+static yyconst short int yy_def[439] =
+    {   0,
+      430,    1,  430,    3,  430,  430,  430,  430,  431,  432,
+      433,  433,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  434,
+      435,  436,  434,   33,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  430,
+      431,  430,  431,  432,  430,  432,  433,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      434,  435,  434,  435,  436,  434,  436,   33,  434,  434,
+
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  431,  432,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      437,  435,  436,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  438,  430,  430,  430,  430,  430,  430,
+
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  437,  430,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      438,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  430,  430,
+
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  434,  434,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  434,  434,  434,  434,  434,
+      434,  434,  434,  434,  434,  434,  434,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  434,
+
+      434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
+      434,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      434,  434,  434,  434,  434,  434,  434,  434,  434,    0,
+      430,  430,  430,  430,  430,  430,  430,  430
+    } ;
+
+static yyconst short int yy_nxt[584] =
+    {   0,
+        6,    7,    8,    9,   10,    6,   11,   11,   11,   11,
+       12,   11,   11,   11,   11,   13,   14,   15,   16,   17,
+        6,   18,   19,    6,   20,    6,    6,   21,    6,    6,
+       22,    6,   23,   24,   25,    6,   26,    6,    6,    6,
+        6,    6,   27,   28,   59,   63,   66,   68,   64,   69,
+       73,   60,   67,   71,   61,   76,   79,   72,   65,   74,
+       75,   57,   80,   82,   77,  107,   78,   81,   83,  429,
+       84,  108,   29,   30,    7,    8,   31,   32,   30,   33,
+       33,   33,   33,   34,   33,   33,   33,   33,   35,   36,
+       37,   38,   39,   30,   40,   41,   30,   42,   30,   30,
+
+       43,   30,   30,   44,   30,   45,   46,   47,   30,   48,
+       30,   30,   30,   30,   30,   27,   28,   52,  428,   55,
+       87,   88,   51,   51,   93,   54,   54,  100,   96,  104,
+      120,  109,  105,  110,  101,  112,  121,  102,  114,  113,
+      117,  122,  106,   52,  129,   49,   55,  115,  116,  118,
+       89,  119,  123,  130,   53,   56,  427,  124,   52,  125,
+      147,   94,   87,   88,   97,   98,   98,   98,   98,   98,
+       98,   98,   98,   98,  148,   51,   51,   93,  424,   55,
+       53,   53,   56,   51,   51,  162,  180,   54,   54,   56,
+       96,  423,   89,   54,   54,   53,  163,   51,   51,   93,
+
+      181,   54,   54,  422,   96,  222,  223,  264,  265,  287,
+      288,  222,  223,  421,   94,   56,  262,  367,  305,  416,
+      368,  369,   94,  417,  370,  379,   97,  381,  380,  420,
+      382,  419,   97,  392,  393,  394,   94,  398,  399,  418,
+       97,  404,  405,  406,  410,  411,  425,  415,  414,  413,
+      426,   51,   51,   51,   54,   54,   54,   91,  412,   91,
+       92,   92,   92,   95,   95,   95,  222,  222,  222,  251,
+      251,  251,  409,  408,  407,  403,  402,  401,  400,  397,
+      396,  395,  391,  390,  389,  388,  387,  386,  385,  384,
+      383,  378,  377,  376,  375,  374,  373,  372,  371,  366,
+
+      365,  364,  363,  362,  361,  360,  359,  358,  357,  356,
+      355,  354,  353,  352,  351,  350,  349,  348,  347,  346,
+      345,  344,  343,  342,  341,  340,  339,  338,  337,  336,
+      335,  334,  333,  332,  331,  330,  329,  328,  327,  326,
+      325,  324,  323,  322,  321,  320,  319,  318,  317,  316,
+      315,  314,  313,  312,  311,  310,  309,  308,  307,  306,
+      304,  303,  302,  301,  300,  299,  298,  297,  296,  295,
+      294,  293,  292,  291,  290,  289,  286,  262,  285,  284,
+      283,  282,  281,  280,  279,  278,  277,  276,  223,  275,
+      274,  273,  272,  271,  270,  269,  268,  267,  266,  263,
+
+      262,  261,  260,  259,  258,  257,  256,  255,  254,  253,
+      252,  250,  249,  248,  247,  246,  245,  244,  243,  242,
+      241,  240,  239,  238,  237,  236,  235,  234,  233,  232,
+      231,  230,  229,  228,  227,  226,  225,  224,  223,  221,
+      220,  219,  218,  217,  216,  215,  214,  213,  212,  211,
+      210,  209,  208,  207,  206,  205,  204,  203,  202,  201,
+      200,  199,  198,  197,  196,  195,  194,  193,  192,  191,
+      190,  189,  188,  187,  186,  185,  184,  183,  182,  179,
+      178,  177,  176,  175,  174,  173,  172,  171,  170,  169,
+      168,  167,  166,  165,  164,  161,   90,  160,  159,  158,
+
+      157,  156,  155,  154,  153,  152,  151,  150,  149,  146,
+      145,  144,  143,  142,  141,  140,  139,  138,  137,  136,
+      135,  134,  133,  132,  131,   50,  128,  127,  126,  111,
+      103,   99,   90,   86,   85,   70,   62,   58,   50,  430,
+        5,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430
+    } ;
+
+static yyconst short int yy_chk[584] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    2,    2,   14,   16,   17,   18,   16,   18,
+       21,   14,   17,   20,   14,   22,   23,   20,   16,   21,
+       21,  433,   23,   24,   22,   39,   22,   23,   24,  409,
+       24,   39,    2,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    4,    4,    9,  406,   10,
+       27,   27,   31,   31,   31,   32,   32,   36,   32,   38,
+       45,   40,   38,   40,   36,   42,   45,   36,   43,   42,
+       44,   45,   38,   51,   53,    4,   54,   43,   43,   44,
+       27,   44,   46,   56,    9,   10,  405,   46,  129,   46,
+       74,   31,   87,   87,   32,   33,   33,   33,   33,   33,
+       33,   33,   33,   33,   74,   92,   92,   92,  403,  130,
+       51,   53,   54,   94,   94,   94,  115,   95,   95,   56,
+       95,  402,   87,   97,   97,  129,   97,  162,  162,  162,
+
+      115,  163,  163,  401,  163,  194,  194,  209,  209,  238,
+      238,  251,  251,  400,   92,  130,  262,  340,  262,  392,
+      340,  341,   94,  392,  341,  355,   95,  356,  355,  397,
+      356,  394,   97,  370,  370,  370,  162,  375,  375,  393,
+      163,  382,  382,  382,  387,  387,  404,  391,  390,  389,
+      404,  431,  431,  431,  432,  432,  432,  434,  388,  434,
+      435,  435,  435,  436,  436,  436,  437,  437,  437,  438,
+      438,  438,  386,  385,  384,  381,  380,  379,  377,  374,
+      373,  372,  369,  368,  367,  365,  362,  361,  360,  358,
+      357,  352,  351,  349,  347,  346,  345,  343,  342,  337,
+
+      336,  334,  333,  332,  331,  330,  328,  327,  326,  325,
+      324,  323,  322,  321,  320,  319,  317,  316,  315,  314,
+      313,  311,  310,  309,  308,  307,  306,  304,  303,  302,
+      301,  299,  298,  296,  294,  293,  292,  291,  290,  289,
+      288,  287,  286,  282,  281,  280,  279,  278,  276,  275,
+      273,  271,  270,  269,  268,  267,  266,  265,  264,  263,
+      258,  257,  256,  255,  254,  252,  249,  248,  247,  246,
+      245,  244,  242,  241,  240,  239,  237,  236,  235,  234,
+      233,  231,  230,  229,  228,  227,  226,  225,  222,  220,
+      219,  218,  217,  216,  215,  213,  212,  211,  210,  208,
+
+      207,  206,  205,  204,  202,  201,  200,  199,  198,  197,
+      196,  193,  192,  191,  190,  189,  188,  187,  186,  185,
+      184,  183,  181,  180,  179,  178,  177,  176,  175,  174,
+      173,  171,  170,  169,  168,  167,  166,  165,  161,  160,
+      159,  158,  157,  156,  155,  154,  153,  152,  151,  150,
+      148,  147,  146,  145,  144,  143,  142,  141,  140,  138,
+      137,  136,  135,  134,  133,  132,  128,  127,  126,  125,
+      124,  123,  122,  121,  120,  119,  118,  117,  116,  114,
+      113,  112,  111,  110,  109,  108,  107,  106,  105,  104,
+      103,  102,  101,  100,   99,   90,   89,   86,   85,   84,
+
+       83,   82,   81,   80,   79,   78,   77,   76,   75,   73,
+       72,   71,   70,   69,   68,   67,   66,   65,   64,   63,
+       62,   61,   60,   59,   58,   50,   49,   48,   47,   41,
+       37,   34,   29,   26,   25,   19,   15,   12,    7,    5,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430
+    } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "cue_scan.l"
+#define INITIAL 0
+#line 2 "cue_scan.l"
+/*
+ * cue_scan.l -- lexer for cue files
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "cd.h"
+#include "cue_parse_prefix.h"
+#include "cue_parse.h"
+
+int cue_lineno = 1;
+#define NAME 1
+
+#line 675 "cue_scan.c"
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ))
+#ifdef __GNUC__
+    __attribute__((__unused__))
+#endif
+;
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, yy_size_t ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static yy_size_t yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines.  This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, (size_t)yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( yy_current_buffer->yy_is_interactive ) \
+		{ \
+		int c = '*', n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else if ( ((result = fread( buf, 1, (size_t)max_size, yyin )) == 0) \
+		  && ferror( yyin ) ) \
+		YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK /*LINTED*/break;
+#endif
+
+#define YY_RULE_SETUP \
+	if ( yyleng > 0 ) \
+		yy_current_buffer->yy_at_bol = \
+				(yytext[yyleng - 1] == '\n'); \
+	YY_USER_ACTION
+
+YY_DECL
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp, *yy_bp;
+	register int yy_act;
+
+#line 26 "cue_scan.l"
+
+
+#line 836 "cue_scan.c"
+
+#if defined(YY_USES_REJECT) && (defined(__GNUC__) || defined(lint))
+	/* XXX: shut up `unused label' warning with %options yylineno */
+	if (/*CONSTCOND*/0 && yy_full_match)
+		goto find_rule;
+#endif
+	if ( yy_init )
+		{
+		yy_init = 0;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yy_start )
+			yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! yy_current_buffer )
+			yy_current_buffer =
+				yy_create_buffer( yyin, YY_BUF_SIZE );
+
+		yy_load_buffer_state();
+		}
+
+	while (/*CONSTCOND*/ 1 )	/* loops until end-of-file is reached */
+		{
+		yy_cp = yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yy_start;
+		yy_current_state += YY_AT_BOL();
+yy_match:
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			if ( yy_accept[yy_current_state] )
+				{
+				yy_last_accepting_state = yy_current_state;
+				yy_last_accepting_cpos = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 431 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			++yy_cp;
+			}
+		while ( yy_base[yy_current_state] != 541 );
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+		if ( yy_act == 0 )
+			{ /* have to back up */
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			yy_act = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+
+do_action:	/* This label is used only to access EOF actions. */
+
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yy_hold_char;
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			goto yy_find_action;
+
+case 1:
+#line 29 "cue_scan.l"
+case 2:
+YY_RULE_SETUP
+#line 29 "cue_scan.l"
+{
+		yylval.sval = strdup(yytext + 1);
+		yylval.sval[strlen(yylval.sval) - 1] = '\0';
+		BEGIN(INITIAL);
+		return STRING;
+		}
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 36 "cue_scan.l"
+{
+		yylval.sval = strdup(yytext);
+		BEGIN(INITIAL);
+		return STRING;
+		}
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 42 "cue_scan.l"
+{ BEGIN(NAME); return CATALOG; }
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 43 "cue_scan.l"
+{ BEGIN(NAME); return CDTEXTFILE; }
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 45 "cue_scan.l"
+{ BEGIN(NAME); return FFILE; }
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 46 "cue_scan.l"
+{ return BINARY; }
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 47 "cue_scan.l"
+{ return MOTOROLA; }
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 48 "cue_scan.l"
+{ return AIFF; }
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 49 "cue_scan.l"
+{ return WAVE; }
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 50 "cue_scan.l"
+{ return MP3; }
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 52 "cue_scan.l"
+{ return TRACK; }
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 53 "cue_scan.l"
+{ yylval.ival = MODE_AUDIO; return AUDIO; }
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 54 "cue_scan.l"
+{ yylval.ival = MODE_MODE1; return MODE1_2048; }
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 55 "cue_scan.l"
+{ yylval.ival = MODE_MODE1_RAW; return MODE1_2352; }
+	YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 56 "cue_scan.l"
+{ yylval.ival = MODE_MODE2; return MODE2_2336; }
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 57 "cue_scan.l"
+{ yylval.ival = MODE_MODE2_FORM1; return MODE2_2048; }
+	YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 58 "cue_scan.l"
+{ yylval.ival = MODE_MODE2_FORM2; return MODE2_2342; }
+	YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 59 "cue_scan.l"
+{ yylval.ival = MODE_MODE2_FORM_MIX; return MODE2_2332; }
+	YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 60 "cue_scan.l"
+{ yylval.ival = MODE_MODE2_RAW; return MODE2_2352; }
+	YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 62 "cue_scan.l"
+{ return FLAGS; }
+	YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 63 "cue_scan.l"
+{ yylval.ival = FLAG_PRE_EMPHASIS; return PRE; }
+	YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 64 "cue_scan.l"
+{ yylval.ival = FLAG_COPY_PERMITTED; return DCP; }
+	YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 65 "cue_scan.l"
+{ yylval.ival = FLAG_FOUR_CHANNEL; return FOUR_CH; }
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 66 "cue_scan.l"
+{ yylval.ival = FLAG_SCMS; return SCMS; }
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 68 "cue_scan.l"
+{ return PREGAP; }
+	YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 69 "cue_scan.l"
+{ return INDEX; }
+	YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 70 "cue_scan.l"
+{ return POSTGAP; }
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 72 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_TITLE;  return TITLE; }
+	YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 73 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_PERFORMER;  return PERFORMER; }
+	YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 74 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_SONGWRITER;  return SONGWRITER; }
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 75 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_COMPOSER;  return COMPOSER; }
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 76 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_ARRANGER;  return ARRANGER; }
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 77 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_MESSAGE;  return MESSAGE; }
+	YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 78 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_DISC_ID;  return DISC_ID; }
+	YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 79 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_GENRE;  return GENRE; }
+	YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 80 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_TOC_INFO1;  return TOC_INFO1; }
+	YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 81 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_TOC_INFO2;  return TOC_INFO2; }
+	YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 82 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_UPC_ISRC;  return UPC_EAN; }
+	YY_BREAK
+case 40:
+*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
+yy_c_buf_p = yy_cp = yy_bp + 4;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
+YY_RULE_SETUP
+#line 83 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_UPC_ISRC;  return ISRC; }
+	YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 84 "cue_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_SIZE_INFO;  return SIZE_INFO; }
+	YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 86 "cue_scan.l"
+{ BEGIN(NAME); return TRACK_ISRC; }
+	YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 88 "cue_scan.l"
+{ cue_lineno++; /* ignore comments */ }
+	YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 89 "cue_scan.l"
+{ /* ignore whitespace */ }
+	YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 91 "cue_scan.l"
+{ yylval.ival = atoi(yytext); return NUMBER; }
+	YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 92 "cue_scan.l"
+{ return yytext[0]; }
+	YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 94 "cue_scan.l"
+{ cue_lineno++; /* blank line */ }
+	YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 95 "cue_scan.l"
+{ cue_lineno++; return '\n'; }
+	YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 96 "cue_scan.l"
+{ fprintf(stderr, "bad character '%c'\n", yytext[0]); }
+	YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 98 "cue_scan.l"
+ECHO;
+	YY_BREAK
+#line 1184 "cue_scan.c"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(NAME):
+	yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between yy_current_buffer and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yy_n_chars = yy_current_buffer->yy_n_chars;
+			yy_current_buffer->yy_input_file = yyin;
+			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state();
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+			yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yy_c_buf_p;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer() )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap() )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yy_c_buf_p =
+					yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yy_c_buf_p =
+				&yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+	{
+	register char *dest = yy_current_buffer->yy_ch_buf;
+	register char *source = yytext_ptr;
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( yy_current_buffer->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+	else
+		{
+		int num_to_read =
+			yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+			YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = yy_current_buffer;
+
+			int yy_c_buf_p_offset =
+				(int) (yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yy_flex_realloc( (void *) b->yy_ch_buf,
+							 b->yy_buf_size + 2 );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = yy_current_buffer->yy_buf_size -
+						number_to_move - 1;
+#endif
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+			yy_n_chars, num_to_read );
+
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	if ( yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin );
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			yy_current_buffer->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	yy_n_chars += number_to_move;
+	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+	return ret_val;
+	}
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
+
+	yy_current_state = yy_start;
+	yy_current_state += YY_AT_BOL();
+
+	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+		{
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yy_last_accepting_state = yy_current_state;
+			yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 431 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		}
+
+	return yy_current_state;
+	}
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+	{
+	register int yy_is_jam;
+	register char *yy_cp = yy_c_buf_p;
+
+	register YY_CHAR yy_c = 1;
+	if ( yy_accept[yy_current_state] )
+		{
+		yy_last_accepting_state = yy_current_state;
+		yy_last_accepting_cpos = yy_cp;
+		}
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 431 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 430);
+
+	return yy_is_jam ? 0 : yy_current_state;
+	}
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+	{
+	register char *yy_cp = yy_c_buf_p;
+
+	/* undo effects of setting up yytext */
+	*yy_cp = yy_hold_char;
+
+	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		{ /* need to shift things up to make room */
+		/* +2 for EOB chars. */
+		register int number_to_move = yy_n_chars + 2;
+		register char *dest = &yy_current_buffer->yy_ch_buf[
+					yy_current_buffer->yy_buf_size + 2];
+		register char *source =
+				&yy_current_buffer->yy_ch_buf[number_to_move];
+
+		while ( source > yy_current_buffer->yy_ch_buf )
+			*--dest = *--source;
+
+		yy_cp += (int) (dest - source);
+		yy_bp += (int) (dest - source);
+		yy_current_buffer->yy_n_chars =
+			yy_n_chars = yy_current_buffer->yy_buf_size;
+
+		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+		}
+
+	*--yy_cp = (char) c;
+
+
+	yytext_ptr = yy_bp;
+	yy_hold_char = *yy_cp;
+	yy_c_buf_p = yy_cp;
+	}
+#endif	/* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+	{
+	int c;
+
+	*yy_c_buf_p = yy_hold_char;
+
+	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			/* This was really a NUL. */
+			*yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = yy_c_buf_p - yytext_ptr;
+			++yy_c_buf_p;
+
+			switch ( yy_get_next_buffer() )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart( yyin );
+
+					/*FALLTHROUGH*/
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap() )
+						return EOF;
+
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput();
+#else
+					return input();
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yy_c_buf_p = yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
+	*yy_c_buf_p = '\0';	/* preserve yytext */
+	yy_hold_char = *++yy_c_buf_p;
+
+	yy_current_buffer->yy_at_bol = (c == '\n');
+
+	return c;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+	{
+	if ( ! yy_current_buffer )
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+	yy_init_buffer( yy_current_buffer, input_file );
+	yy_load_buffer_state();
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+	{
+	if ( yy_current_buffer == new_buffer )
+		return;
+
+	if ( yy_current_buffer )
+		{
+		/* Flush out information for old buffer. */
+		*yy_c_buf_p = yy_hold_char;
+		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	yy_current_buffer = new_buffer;
+	yy_load_buffer_state();
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yy_did_buffer_switch_on_eof = 1;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+	{
+	yy_n_chars = yy_current_buffer->yy_n_chars;
+	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+	yyin = yy_current_buffer->yy_input_file;
+	yy_hold_char = *yy_c_buf_p;
+	}
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer( b, file );
+
+	return b;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+	{
+	if ( ! b )
+		return;
+
+	if ( b == yy_current_buffer )
+		yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yy_flex_free( (void *) b->yy_ch_buf );
+
+	yy_flex_free( (void *) b );
+	}
+
+
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+#include <unistd.h>
+#endif
+#endif
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+	{
+	yy_flush_buffer( b );
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+	b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+	b->yy_is_interactive = 0;
+#else
+	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+	{
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == yy_current_buffer )
+		yy_load_buffer_state();
+	}
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	yy_switch_to_buffer( b );
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+	{
+	yy_size_t len;
+	for ( len = 0; yy_str[len]; ++len )
+		;
+
+	return yy_scan_bytes( yy_str, len );
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, yy_size_t len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+yy_size_t len;
+#endif
+	{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n, i;
+
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = len + 2;
+	buf = (char *) yy_flex_alloc( n );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+	for ( i = 0; i < len; ++i )
+		buf[i] = bytes[i];
+
+	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer( buf, n );
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+	{
+	if ( yy_start_stack_ptr >= yy_start_stack_depth )
+		{
+		yy_size_t new_size;
+
+		yy_start_stack_depth += YY_START_STACK_INCR;
+		new_size = yy_start_stack_depth * sizeof( int );
+
+		if ( ! yy_start_stack )
+			yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+		else
+			yy_start_stack = (int *) yy_flex_realloc(
+					(void *) yy_start_stack, new_size );
+
+		if ( ! yy_start_stack )
+			YY_FATAL_ERROR(
+			"out of memory expanding start-condition stack" );
+		}
+
+	yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+	BEGIN(new_state);
+	}
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+	{
+	if ( --yy_start_stack_ptr < 0 )
+		YY_FATAL_ERROR( "start-condition stack underflow" );
+
+	BEGIN(yy_start_stack[yy_start_stack_ptr]);
+	}
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+	{
+	return yy_start_stack[yy_start_stack_ptr - 1];
+	}
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+	{
+	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+	}
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		yytext[yyleng] = yy_hold_char; \
+		yy_c_buf_p = yytext + n; \
+		yy_hold_char = *yy_c_buf_p; \
+		*yy_c_buf_p = '\0'; \
+		yyleng = n; \
+		} \
+	while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, yy_size_t n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+yy_size_t n;
+#endif
+	{
+	register yy_size_t i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+	}
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static yy_size_t yy_flex_strlen( yyconst char *s )
+#else
+static yy_size_t yy_flex_strlen( s )
+yyconst char *s;
+#endif
+	{
+	register yy_size_t n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+	}
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+	{
+	return (void *) malloc( size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+	{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+	{
+	free( ptr );
+	}
+
+#if YY_MAIN
+int main()
+	{
+	yylex();
+	return 0;
+	}
+#endif
+#line 98 "cue_scan.l"
+
Index: /libcuefile/trunk/cuefile.c
===================================================================
--- /libcuefile/trunk/cuefile.c	(revision 415)
+++ /libcuefile/trunk/cuefile.c	(revision 415)
@@ -0,0 +1,90 @@
+/*
+ * cuefile.c -- cue/toc functions
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "cuefile.h"
+#include "cue.h"
+#include "toc.h"
+
+Cd *cf_parse (char *name, int *format)
+{
+	FILE *fp = NULL;
+	Cd *cd = NULL;
+
+	if (UNKNOWN == *format)
+		if (UNKNOWN == (*format = cf_format_from_suffix(name))) {
+			fprintf(stderr, "%s: unknown format\n", name);
+			return NULL;
+		}
+
+	if (0 == strcmp("-", name)) {
+		fp = stdin;
+	} else if (NULL == (fp = fopen(name, "r"))) {
+		fprintf(stderr, "%s: error opening file\n", name);
+		return NULL;
+	}
+
+	switch (*format) {
+	case CUE:
+		cd = cue_parse(fp);
+		break;
+	case TOC:
+		cd = toc_parse(fp);
+		break;
+	}
+
+	if(stdin != fp)
+		fclose(fp);
+
+	return cd;
+}
+
+int cf_print (char *name, int *format, Cd *cd)
+{
+	FILE *fp = NULL;
+
+	if (UNKNOWN == *format)
+		if (UNKNOWN == (*format = cf_format_from_suffix(name))) {
+			fprintf(stderr, "%s: unknown format\n", name);
+			return -1;
+		}
+
+	if (0 == strcmp("-", name)) {
+		fp = stdout;
+	} else if (NULL == (fp = fopen(name, "w"))) {
+		fprintf(stderr, "%s: error opening file\n", name);
+		return -1;
+	}
+	
+	switch (*format) {
+	case CUE:
+		cue_print(fp, cd);
+		break;
+	case TOC:
+		toc_print(fp, cd);
+		break;
+	}
+
+	if(stdout != fp)
+		fclose(fp);
+
+	return 0;
+}
+
+int cf_format_from_suffix (char *name)
+{
+	char *suffix;
+	if (0 != (suffix = strrchr(name, '.'))) {
+		if (0 == strcasecmp(".cue", suffix))
+			return CUE;
+		else if (0 == strcasecmp(".toc", suffix))
+			return TOC;
+	}
+
+	return UNKNOWN;
+}
Index: /libcuefile/trunk/cuefile.h
===================================================================
--- /libcuefile/trunk/cuefile.h	(revision 415)
+++ /libcuefile/trunk/cuefile.h	(revision 415)
@@ -0,0 +1,16 @@
+/*
+ * cuefile.h -- cue/toc public declarations
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include "cd.h"
+
+enum {CUE, TOC, UNKNOWN};
+
+typedef struct Cue Cue;
+
+Cd *cf_parse (char *fname, int *format);
+int cf_print (char *fname, int *format, Cd *cue);
+int cf_format_from_suffix (char *fname);
Index: /libcuefile/trunk/time.c
===================================================================
--- /libcuefile/trunk/time.c	(revision 415)
+++ /libcuefile/trunk/time.c	(revision 415)
@@ -0,0 +1,44 @@
+/*
+ * time.c -- time functions
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+long time_msf_to_frame (int m, int s, int f)
+{
+	return (m * 60 + s) * 75 + f;
+}
+
+void msf_frame_to_msf (long frame, int *m, int *s, int *f)
+{
+        *f = frame % 75;	/* 0 <= frames <= 74 */
+        frame /= 75;
+        *s = frame % 60;	/* 0 <= seconds <= 59 */
+        frame /= 60;
+        *m = frame;		/* 0 <= minutes */
+}
+
+void time_frame_to_msf (long frame, int *m, int *s, int *f)
+{
+	*f = frame % 75;           /* 0 <= frames <= 74 */
+	frame /= 75;
+	*s = frame % 60;          /* 0 <= seconds <= 59 */
+	frame /= 60;
+	*m = frame;               /* 0 <= minutes */
+}
+
+/* print frame in mm:ss:ff format */
+char *time_frame_to_mmssff (long f)
+{
+	static char msf[9];
+	int minutes, seconds, frames;
+
+	msf_frame_to_msf(f, &minutes, &seconds, &frames);
+	sprintf(msf, "%02d:%02d:%02d", minutes, seconds, frames);
+
+	return msf;
+}
Index: /libcuefile/trunk/time.h
===================================================================
--- /libcuefile/trunk/time.h	(revision 415)
+++ /libcuefile/trunk/time.h	(revision 415)
@@ -0,0 +1,15 @@
+/* time.h -- time declarations
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#ifndef TIME_H
+#define TIME_H
+
+long time_msf_to_frame (int m, int s, int f);
+long time_mmssff_to_frame (char *mmssff);
+void time_frame_to_msf (long frame, int *m, int *s, int *f);
+char *time_frame_to_mmssff (long f);
+
+#endif
Index: /libcuefile/trunk/toc.h
===================================================================
--- /libcuefile/trunk/toc.h	(revision 415)
+++ /libcuefile/trunk/toc.h	(revision 415)
@@ -0,0 +1,9 @@
+/*
+ * toc.h -- toc function declarations
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+Cd *toc_parse (FILE *fp);
+void toc_print (FILE *fp, Cd *cd);
Index: /libcuefile/trunk/toc_parse.c
===================================================================
--- /libcuefile/trunk/toc_parse.c	(revision 415)
+++ /libcuefile/trunk/toc_parse.c	(revision 415)
@@ -0,0 +1,1636 @@
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Written by Richard Stallman by simplifying the original so called
+   ``semantic'' parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     NUMBER = 258,
+     STRING = 259,
+     CATALOG = 260,
+     CD_DA = 261,
+     CD_ROM = 262,
+     CD_ROM_XA = 263,
+     TRACK = 264,
+     AUDIO = 265,
+     MODE1 = 266,
+     MODE1_RAW = 267,
+     MODE2 = 268,
+     MODE2_FORM1 = 269,
+     MODE2_FORM2 = 270,
+     MODE2_FORM_MIX = 271,
+     MODE2_RAW = 272,
+     RW = 273,
+     RW_RAW = 274,
+     NO = 275,
+     COPY = 276,
+     PRE_EMPHASIS = 277,
+     TWO_CHANNEL_AUDIO = 278,
+     FOUR_CHANNEL_AUDIO = 279,
+     ISRC = 280,
+     SILENCE = 281,
+     ZERO = 282,
+     AUDIOFILE = 283,
+     DATAFILE = 284,
+     FIFO = 285,
+     START = 286,
+     PREGAP = 287,
+     INDEX = 288,
+     CD_TEXT = 289,
+     LANGUAGE_MAP = 290,
+     LANGUAGE = 291,
+     TITLE = 292,
+     PERFORMER = 293,
+     SONGWRITER = 294,
+     COMPOSER = 295,
+     ARRANGER = 296,
+     MESSAGE = 297,
+     DISC_ID = 298,
+     GENRE = 299,
+     TOC_INFO1 = 300,
+     TOC_INFO2 = 301,
+     UPC_EAN = 302,
+     SIZE_INFO = 303
+   };
+#endif
+#define NUMBER 258
+#define STRING 259
+#define CATALOG 260
+#define CD_DA 261
+#define CD_ROM 262
+#define CD_ROM_XA 263
+#define TRACK 264
+#define AUDIO 265
+#define MODE1 266
+#define MODE1_RAW 267
+#define MODE2 268
+#define MODE2_FORM1 269
+#define MODE2_FORM2 270
+#define MODE2_FORM_MIX 271
+#define MODE2_RAW 272
+#define RW 273
+#define RW_RAW 274
+#define NO 275
+#define COPY 276
+#define PRE_EMPHASIS 277
+#define TWO_CHANNEL_AUDIO 278
+#define FOUR_CHANNEL_AUDIO 279
+#define ISRC 280
+#define SILENCE 281
+#define ZERO 282
+#define AUDIOFILE 283
+#define DATAFILE 284
+#define FIFO 285
+#define START 286
+#define PREGAP 287
+#define INDEX 288
+#define CD_TEXT 289
+#define LANGUAGE_MAP 290
+#define LANGUAGE 291
+#define TITLE 292
+#define PERFORMER 293
+#define SONGWRITER 294
+#define COMPOSER 295
+#define ARRANGER 296
+#define MESSAGE 297
+#define DISC_ID 298
+#define GENRE 299
+#define TOC_INFO1 300
+#define TOC_INFO2 301
+#define UPC_EAN 302
+#define SIZE_INFO 303
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 1 "toc_parse.y"
+
+/*
+ * toc_parse.y -- parser for toc files
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "cd.h"
+#include "time.h"
+#include "toc_parse_prefix.h"
+
+#define YYDEBUG 1
+
+extern int yylex();
+void yyerror (char *s);
+
+static Cd *cd = NULL;
+static Track *track = NULL;
+static Cdtext *cdtext = NULL;
+
+
+/* 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 28 "toc_parse.y"
+typedef union YYSTYPE {
+	long ival;
+	char *sval;
+} YYSTYPE;
+/* Line 191 of yacc.c.  */
+#line 201 "toc_parse.c"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 214 of yacc.c.  */
+#line 213 "toc_parse.c"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# if YYSTACK_USE_ALLOCA
+#  define YYSTACK_ALLOC alloca
+# else
+#  ifndef YYSTACK_USE_ALLOCA
+#   if defined (alloca) || defined (_ALLOCA_H)
+#    define YYSTACK_ALLOC alloca
+#   else
+#    ifdef __GNUC__
+#     define YYSTACK_ALLOC __builtin_alloca
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning. */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+#  if defined (__STDC__) || defined (__cplusplus)
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   define YYSIZE_T size_t
+#  endif
+#  define YYSTACK_ALLOC malloc
+#  define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+     && (! defined (__cplusplus) \
+	 || (YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  short yyss;
+  YYSTYPE yyvs;
+  };
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_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) + sizeof (YYSTYPE))				\
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  register YYSIZE_T yyi;		\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (0)
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+   typedef signed char yysigned_char;
+#else
+   typedef short yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL  3
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   149
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS  54
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS  33
+/* YYNRULES -- Number of rules. */
+#define YYNRULES  88
+/* YYNRULES -- Number of states. */
+#define YYNSTATES  156
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   303
+
+#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,
+      49,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,    53,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    52,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    50,     2,    51,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     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
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const unsigned short yyprhs[] =
+{
+       0,     0,     3,     7,     8,     9,    12,    16,    19,    27,
+      30,    32,    34,    36,    38,    41,    45,    46,    50,    52,
+      55,    57,    59,    61,    63,    65,    67,    69,    71,    73,
+      75,    77,    80,    82,    86,    93,    95,    97,    99,   102,
+     104,   106,   109,   112,   115,   119,   123,   126,   130,   135,
+     141,   145,   150,   155,   157,   159,   162,   166,   170,   174,
+     181,   183,   186,   191,   193,   196,   204,   205,   208,   212,
+     218,   220,   222,   224,   226,   228,   230,   232,   234,   236,
+     238,   240,   242,   244,   245,   249,   251,   257,   258
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+      55,     0,    -1,    56,    57,    60,    -1,    -1,    -1,    57,
+      58,    -1,     5,     4,    49,    -1,    59,    49,    -1,    34,
+      50,    86,    76,    79,    51,    49,    -1,     1,    49,    -1,
+       6,    -1,     7,    -1,     8,    -1,    61,    -1,    60,    61,
+      -1,    62,    63,    67,    -1,    -1,     9,    64,    49,    -1,
+      65,    -1,    65,    66,    -1,    10,    -1,    11,    -1,    12,
+      -1,    13,    -1,    14,    -1,    15,    -1,    16,    -1,    17,
+      -1,    18,    -1,    19,    -1,    68,    -1,    67,    68,    -1,
+      69,    -1,    25,     4,    49,    -1,    34,    50,    86,    79,
+      51,    49,    -1,    72,    -1,    74,    -1,    75,    -1,     1,
+      49,    -1,    70,    -1,    71,    -1,    21,    49,    -1,    22,
+      49,    -1,    24,    49,    -1,    20,    22,    49,    -1,    20,
+      21,    49,    -1,    23,    49,    -1,    73,    85,    49,    -1,
+      28,     4,    85,    49,    -1,    28,     4,    85,    85,    49,
+      -1,    29,     4,    49,    -1,    29,     4,    85,    49,    -1,
+      30,     4,    85,    49,    -1,    26,    -1,    27,    -1,    31,
+      49,    -1,    31,    85,    49,    -1,    32,    85,    49,    -1,
+      33,    85,    49,    -1,    35,    50,    86,    77,    51,    49,
+      -1,    78,    -1,    77,    78,    -1,     3,    52,     3,    86,
+      -1,    80,    -1,    79,    80,    -1,    36,     3,    50,    86,
+      81,    51,    49,    -1,    -1,    81,    82,    -1,    83,     4,
+      49,    -1,    83,    50,    84,    51,    49,    -1,    37,    -1,
+      38,    -1,    39,    -1,    40,    -1,    41,    -1,    42,    -1,
+      43,    -1,    44,    -1,    45,    -1,    46,    -1,    47,    -1,
+      25,    -1,    48,    -1,    -1,    84,    53,     3,    -1,     3,
+      -1,     3,    52,     3,    52,     3,    -1,    -1,    49,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const unsigned short yyrline[] =
+{
+       0,   103,   103,   107,   113,   115,   119,   120,   121,   122,
+     126,   127,   128,   132,   133,   137,   144,   153,   157,   158,
+     162,   163,   164,   165,   166,   167,   168,   169,   173,   174,
+     178,   179,   183,   184,   185,   186,   187,   188,   189,   193,
+     194,   198,   199,   200,   204,   205,   206,   210,   216,   220,
+     225,   228,   232,   239,   240,   244,   245,   248,   255,   259,
+     263,   264,   268,   272,   273,   277,   280,   282,   286,   289,
+     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
+     305,   306,   307,   310,   312,   316,   317,   320,   322
+};
+#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", "NUMBER", "STRING", "CATALOG", "CD_DA", 
+  "CD_ROM", "CD_ROM_XA", "TRACK", "AUDIO", "MODE1", "MODE1_RAW", "MODE2", 
+  "MODE2_FORM1", "MODE2_FORM2", "MODE2_FORM_MIX", "MODE2_RAW", "RW", 
+  "RW_RAW", "NO", "COPY", "PRE_EMPHASIS", "TWO_CHANNEL_AUDIO", 
+  "FOUR_CHANNEL_AUDIO", "ISRC", "SILENCE", "ZERO", "AUDIOFILE", 
+  "DATAFILE", "FIFO", "START", "PREGAP", "INDEX", "CD_TEXT", 
+  "LANGUAGE_MAP", "LANGUAGE", "TITLE", "PERFORMER", "SONGWRITER", 
+  "COMPOSER", "ARRANGER", "MESSAGE", "DISC_ID", "GENRE", "TOC_INFO1", 
+  "TOC_INFO2", "UPC_EAN", "SIZE_INFO", "'\\n'", "'{'", "'}'", "':'", 
+  "','", "$accept", "tocfile", "new_cd", "global_statements", 
+  "global_statement", "disc_mode", "track_list", "track", "new_track", 
+  "track_def", "track_modes", "track_mode", "track_sub_mode", 
+  "track_statements", "track_statement", "track_flags", "track_set_flag", 
+  "track_clear_flag", "track_data", "zero_data", "track_pregap", 
+  "track_index", "language_map", "languages", "language", "cdtext_langs", 
+  "cdtext_lang", "cdtext_defs", "cdtext_def", "cdtext_item", "bytes", 
+  "time", "opt_nl", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const unsigned short yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
+     295,   296,   297,   298,   299,   300,   301,   302,   303,    10,
+     123,   125,    58,    44
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const unsigned char yyr1[] =
+{
+       0,    54,    55,    56,    57,    57,    58,    58,    58,    58,
+      59,    59,    59,    60,    60,    61,    62,    63,    64,    64,
+      65,    65,    65,    65,    65,    65,    65,    65,    66,    66,
+      67,    67,    68,    68,    68,    68,    68,    68,    68,    69,
+      69,    70,    70,    70,    71,    71,    71,    72,    72,    72,
+      72,    72,    72,    73,    73,    74,    74,    74,    75,    76,
+      77,    77,    78,    79,    79,    80,    81,    81,    82,    82,
+      83,    83,    83,    83,    83,    83,    83,    83,    83,    83,
+      83,    83,    83,    84,    84,    85,    85,    86,    86
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const unsigned char yyr2[] =
+{
+       0,     2,     3,     0,     0,     2,     3,     2,     7,     2,
+       1,     1,     1,     1,     2,     3,     0,     3,     1,     2,
+       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     2,     1,     3,     6,     1,     1,     1,     2,     1,
+       1,     2,     2,     2,     3,     3,     2,     3,     4,     5,
+       3,     4,     4,     1,     1,     2,     3,     3,     3,     6,
+       1,     2,     4,     1,     2,     7,     0,     2,     3,     5,
+       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     0,     3,     1,     5,     0,     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 char yydefact[] =
+{
+       3,     0,     4,     1,     0,     0,     0,    10,    11,    12,
+       0,     5,     0,     2,    13,     0,     9,     0,    87,     7,
+      14,     0,     0,     6,    88,     0,    20,    21,    22,    23,
+      24,    25,    26,    27,     0,    18,     0,     0,     0,     0,
+       0,     0,     0,    53,    54,     0,     0,     0,     0,     0,
+       0,     0,     0,    30,    32,    39,    40,    35,     0,    36,
+      37,     0,     0,    17,    28,    29,    19,    38,     0,     0,
+      41,    42,    46,    43,     0,     0,     0,     0,    85,    55,
+       0,     0,     0,    87,    31,     0,    87,     0,     0,    63,
+      45,    44,    33,     0,    50,     0,     0,     0,    56,    57,
+      58,     0,    47,     0,     0,     0,    64,    48,     0,    51,
+      52,     0,     0,     0,     0,    60,    87,     8,    49,     0,
+       0,     0,     0,    61,    66,    86,    34,    87,    59,     0,
+      62,    81,    70,    71,    72,    73,    74,    75,    76,    77,
+      78,    79,    80,    82,     0,    67,     0,    65,     0,    83,
+      68,     0,     0,     0,    69,    84
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const short yydefgoto[] =
+{
+      -1,     1,     2,     4,    11,    12,    13,    14,    15,    22,
+      34,    35,    66,    52,    53,    54,    55,    56,    57,    58,
+      59,    60,    62,   114,   115,    88,    89,   129,   145,   146,
+     151,    80,    25
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -87
+static const short yypact[] =
+{
+     -87,     5,   -87,   -87,    12,   -38,    11,   -87,   -87,   -87,
+     -27,   -87,   -19,    29,   -87,    30,   -87,    -9,    -8,   -87,
+     -87,    79,    53,   -87,   -87,     8,   -87,   -87,   -87,   -87,
+     -87,   -87,   -87,   -87,    -5,     9,     6,    10,    22,    23,
+      48,    49,    95,   -87,   -87,   108,   109,   111,    -2,   113,
+     113,    67,    36,   -87,   -87,   -87,   -87,   -87,   113,   -87,
+     -87,    68,    83,   -87,   -87,   -87,   -87,   -87,    71,    72,
+     -87,   -87,   -87,   -87,    73,   113,     0,   113,    74,   -87,
+      75,    76,    78,    -8,   -87,    80,    -8,   120,   -26,   -87,
+     -87,   -87,   -87,     1,   -87,    81,    82,   125,   -87,   -87,
+     -87,    83,   -87,   129,    84,    86,   -87,   -87,    87,   -87,
+     -87,    85,   -22,    88,    -3,   -87,    -8,   -87,   -87,   130,
+      89,   136,    92,   -87,   -87,   -87,   -87,    -8,   -87,    63,
+     -87,   -87,   -87,   -87,   -87,   -87,   -87,   -87,   -87,   -87,
+     -87,   -87,   -87,   -87,    93,   -87,     2,   -87,    94,   -87,
+     -87,   -29,    96,   141,   -87,   -87
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const short yypgoto[] =
+{
+     -87,   -87,   -87,   -87,   -87,   -87,   -87,   133,   -87,   -87,
+     -87,   -87,   -87,   -87,    97,   -87,   -87,   -87,   -87,   -87,
+     -87,   -87,   -87,   -87,    33,    47,   -86,   -87,   -87,   -87,
+     -87,   -42,   -74
+};
+
+/* 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 -17
+static const short yytable[] =
+{
+     113,    78,   106,    78,    78,     3,   148,    81,    82,   101,
+      87,    16,   103,     5,    87,    17,    85,     6,     7,     8,
+       9,   -16,   152,    18,   153,   105,   106,    64,    65,   120,
+      19,    68,    69,    93,    95,    96,   -15,    36,   -16,    21,
+      23,    24,   124,    61,    63,   -15,    10,    79,   122,    94,
+     107,   108,   149,   130,    36,    67,    37,    38,    39,    40,
+      41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
+      51,    70,    71,    37,    38,    39,    40,    41,    42,    43,
+      44,    45,    46,    47,    48,    49,    50,    51,   131,    26,
+      27,    28,    29,    30,    31,    32,    33,    72,    73,    74,
+     132,   133,   134,   135,   136,   137,   138,   139,   140,   141,
+     142,   143,    75,    76,   144,    77,    78,    83,    86,    87,
+      90,    91,    92,   104,    98,    99,    97,   100,   111,   102,
+     109,   110,   113,   125,   116,   117,   118,   119,   126,   127,
+     121,   128,   147,   150,   155,   154,    20,   123,   112,    84
+};
+
+static const unsigned char yycheck[] =
+{
+       3,     3,    88,     3,     3,     0,     4,    49,    50,    83,
+      36,    49,    86,     1,    36,     4,    58,     5,     6,     7,
+       8,     9,    51,    50,    53,    51,   112,    18,    19,    51,
+      49,    21,    22,    75,    76,    77,     0,     1,     9,     9,
+      49,    49,   116,    35,    49,     9,    34,    49,    51,    49,
+      49,    93,    50,   127,     1,    49,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
+      34,    49,    49,    20,    21,    22,    23,    24,    25,    26,
+      27,    28,    29,    30,    31,    32,    33,    34,    25,    10,
+      11,    12,    13,    14,    15,    16,    17,    49,    49,     4,
+      37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
+      47,    48,     4,     4,    51,     4,     3,    50,    50,    36,
+      49,    49,    49,     3,    49,    49,    52,    49,     3,    49,
+      49,    49,     3,     3,    50,    49,    49,    52,    49,     3,
+      52,    49,    49,    49,     3,    49,    13,   114,   101,    52
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const unsigned char yystos[] =
+{
+       0,    55,    56,     0,    57,     1,     5,     6,     7,     8,
+      34,    58,    59,    60,    61,    62,    49,     4,    50,    49,
+      61,     9,    63,    49,    49,    86,    10,    11,    12,    13,
+      14,    15,    16,    17,    64,    65,     1,    20,    21,    22,
+      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
+      33,    34,    67,    68,    69,    70,    71,    72,    73,    74,
+      75,    35,    76,    49,    18,    19,    66,    49,    21,    22,
+      49,    49,    49,    49,     4,     4,     4,     4,     3,    49,
+      85,    85,    85,    50,    68,    85,    50,    36,    79,    80,
+      49,    49,    49,    85,    49,    85,    85,    52,    49,    49,
+      49,    86,    49,    86,     3,    51,    80,    49,    85,    49,
+      49,     3,    79,     3,    77,    78,    50,    49,    49,    52,
+      51,    52,    51,    78,    86,     3,    49,     3,    49,    81,
+      86,    25,    37,    38,    39,    40,    41,    42,    43,    44,
+      45,    46,    47,    48,    51,    82,    83,    49,     4,    50,
+      49,    84,    51,    53,    49,     3
+};
+
+#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 yyerrlab1
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK;						\
+      goto yybackup;						\
+    }								\
+  else								\
+    { 								\
+      yyerror ("syntax error: cannot back up");\
+      YYERROR;							\
+    }								\
+while (0)
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+   are run).  */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)         \
+  Current.first_line   = Rhs[1].first_line;      \
+  Current.first_column = Rhs[1].first_column;    \
+  Current.last_line    = Rhs[N].last_line;       \
+  Current.last_column  = Rhs[N].last_column;
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#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 YYDSYMPRINT(Args)			\
+do {						\
+  if (yydebug)					\
+    yysymprint Args;				\
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location)		\
+do {								\
+  if (yydebug)							\
+    {								\
+      YYFPRINTF (stderr, "%s ", Title);				\
+      yysymprint (stderr, 					\
+                  Token, Value);	\
+      YYFPRINTF (stderr, "\n");					\
+    }								\
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (cinluded).                                                   |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short *bottom, short *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    short *bottom;
+    short *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 yylineno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+             yyrule - 1, yylineno);
+  /* 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 YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, 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
+   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#if YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined (__GLIBC__) && defined (_STRING_H)
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+static YYSIZE_T
+#   if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+#   else
+yystrlen (yystr)
+     const char *yystr;
+#   endif
+{
+  register const char *yys = yystr;
+
+  while (*yys++ != '\0')
+    continue;
+
+  return yys - yystr - 1;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+#   if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+#   else
+yystpcpy (yydest, yysrc)
+     char *yydest;
+     const char *yysrc;
+#   endif
+{
+  register char *yyd = yydest;
+  register const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+
+
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  if (yytype < YYNTOKENS)
+    {
+      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+    }
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  switch (yytype)
+    {
+      default:
+        break;
+    }
+  YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  /* Pacify ``unused variable'' warnings.  */
+  (void) yyvaluep;
+
+  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 */
+
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| 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
+{
+  
+  register int yystate;
+  register int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Lookahead token as an internal (translated) token number.  */
+  int 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	yyssa[YYINITDEPTH];
+  short *yyss = yyssa;
+  register short *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK   (yyvsp--, yyssp--)
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* When reducing, the number of symbols on the RHS of the reduced
+     rule.  */
+  int yylen;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY;		/* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed. so pushing a state here evens the stacks.
+     */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (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 *yyss1 = yyss;
+
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow ("parser stack overflow",
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyoverflowlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyoverflowlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+      {
+	short *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyoverflowlab;
+	YYSTACK_RELOCATE (yyss);
+	YYSTACK_RELOCATE (yyvs);
+
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (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 lookahead token if we need one and don't already have one.  */
+/* yyresume: */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead 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);
+      YYDSYMPRINTF ("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 lookahead token.  */
+  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+  /* Discard the token being shifted unless it is eof.  */
+  if (yychar != YYEOF)
+    yychar = YYEMPTY;
+
+  *++yyvsp = yylval;
+
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 3:
+#line 107 "toc_parse.y"
+    {
+		cd = cd_init();
+		cdtext = cd_get_cdtext(cd);
+	}
+    break;
+
+  case 6:
+#line 119 "toc_parse.y"
+    { cd_set_catalog(cd, yyvsp[-1].sval); }
+    break;
+
+  case 7:
+#line 120 "toc_parse.y"
+    { cd_set_mode(cd, yyvsp[-1].ival); }
+    break;
+
+  case 15:
+#line 137 "toc_parse.y"
+    {
+		while (2 > track_get_nindex(track))
+			track_add_index(track, 0);
+	}
+    break;
+
+  case 16:
+#line 144 "toc_parse.y"
+    {
+		track = cd_add_track(cd);
+		cdtext = track_get_cdtext(track);
+		/* add 0 index */
+		track_add_index(track, 0);
+	}
+    break;
+
+  case 17:
+#line 153 "toc_parse.y"
+    { track_set_mode(track, yyvsp[-1].ival); }
+    break;
+
+  case 19:
+#line 158 "toc_parse.y"
+    { track_set_sub_mode(track, yyvsp[0].ival); }
+    break;
+
+  case 33:
+#line 184 "toc_parse.y"
+    { track_set_isrc(track, yyvsp[-1].sval); }
+    break;
+
+  case 39:
+#line 193 "toc_parse.y"
+    { track_set_flag(track, yyvsp[0].ival); }
+    break;
+
+  case 40:
+#line 194 "toc_parse.y"
+    { track_clear_flag(track, yyvsp[0].ival); }
+    break;
+
+  case 44:
+#line 204 "toc_parse.y"
+    { yyval.ival = yyvsp[-1].ival; }
+    break;
+
+  case 45:
+#line 205 "toc_parse.y"
+    { yyval.ival = yyvsp[-1].ival; }
+    break;
+
+  case 47:
+#line 210 "toc_parse.y"
+    {
+		if (NULL == track_get_filename(track))
+			track_set_zero_pre(track, yyvsp[-1].ival);
+		else
+			track_set_zero_post(track, yyvsp[-1].ival);
+	}
+    break;
+
+  case 48:
+#line 216 "toc_parse.y"
+    {
+		track_set_filename(track, yyvsp[-2].sval);
+		track_set_start(track, yyvsp[-1].ival);
+	}
+    break;
+
+  case 49:
+#line 220 "toc_parse.y"
+    {
+		track_set_filename(track, yyvsp[-3].sval);
+		track_set_start(track, yyvsp[-2].ival);
+		track_set_length(track, yyvsp[-1].ival);
+	}
+    break;
+
+  case 50:
+#line 225 "toc_parse.y"
+    {
+		track_set_filename(track, yyvsp[-1].sval);
+	}
+    break;
+
+  case 51:
+#line 228 "toc_parse.y"
+    {
+		track_set_filename(track, yyvsp[-2].sval);
+		track_set_start(track, yyvsp[-1].ival);
+	}
+    break;
+
+  case 52:
+#line 232 "toc_parse.y"
+    {
+		track_set_filename(track, yyvsp[-2].sval);
+		track_set_start(track, yyvsp[-1].ival);
+	}
+    break;
+
+  case 56:
+#line 245 "toc_parse.y"
+    {
+		track_add_index(track, yyvsp[-1].ival);
+	}
+    break;
+
+  case 57:
+#line 248 "toc_parse.y"
+    {
+		track_set_zero_pre(track, yyvsp[-1].ival);
+		track_add_index(track, yyvsp[-1].ival);
+	}
+    break;
+
+  case 58:
+#line 255 "toc_parse.y"
+    { track_add_index(track, yyvsp[-1].ival); }
+    break;
+
+  case 62:
+#line 268 "toc_parse.y"
+    { /* not implemented */ }
+    break;
+
+  case 68:
+#line 286 "toc_parse.y"
+    {
+		cdtext_set (yyvsp[-2].ival, yyvsp[-1].sval, cdtext);
+	}
+    break;
+
+  case 69:
+#line 289 "toc_parse.y"
+    {
+		yyerror("binary CD-TEXT data not supported\n");
+	}
+    break;
+
+  case 86:
+#line 317 "toc_parse.y"
+    { yyval.ival = time_msf_to_frame(yyvsp[-4].ival, yyvsp[-2].ival, yyvsp[0].ival); }
+    break;
+
+
+    }
+
+/* Line 991 of yacc.c.  */
+#line 1399 "toc_parse.c"
+
+
+  yyvsp -= yylen;
+  yyssp -= yylen;
+
+
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if YYERROR_VERBOSE
+      yyn = yypact[yystate];
+
+      if (YYPACT_NINF < yyn && yyn < YYLAST)
+	{
+	  YYSIZE_T yysize = 0;
+	  int yytype = YYTRANSLATE (yychar);
+	  char *yymsg;
+	  int yyx, yycount;
+
+	  yycount = 0;
+	  /* Start YYX at -YYN if negative to avoid negative indexes in
+	     YYCHECK.  */
+	  for (yyx = yyn < 0 ? -yyn : 0;
+	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+	  yysize += yystrlen ("syntax error, unexpected ") + 1;
+	  yysize += yystrlen (yytname[yytype]);
+	  yymsg = (char *) YYSTACK_ALLOC (yysize);
+	  if (yymsg != 0)
+	    {
+	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+	      yyp = yystpcpy (yyp, yytname[yytype]);
+
+	      if (yycount < 5)
+		{
+		  yycount = 0;
+		  for (yyx = yyn < 0 ? -yyn : 0;
+		       yyx < (int) (sizeof (yytname) / sizeof (char *));
+		       yyx++)
+		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+		      {
+			const char *yyq = ! yycount ? ", expecting " : " or ";
+			yyp = yystpcpy (yyp, yyq);
+			yyp = yystpcpy (yyp, yytname[yyx]);
+			yycount++;
+		      }
+		}
+	      yyerror (yymsg);
+	      YYSTACK_FREE (yymsg);
+	    }
+	  else
+	    yyerror ("syntax error; also virtual memory exhausted");
+	}
+      else
+#endif /* YYERROR_VERBOSE */
+	yyerror ("syntax error");
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+	 error, discard it.  */
+
+      /* Return failure if at end of input.  */
+      if (yychar == YYEOF)
+        {
+	  /* Pop the error token.  */
+          YYPOPSTACK;
+	  /* Pop the rest of the stack.  */
+	  while (yyss < yyssp)
+	    {
+	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+	      yydestruct (yystos[*yyssp], yyvsp);
+	      YYPOPSTACK;
+	    }
+	  YYABORT;
+        }
+
+      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+      yydestruct (yytoken, &yylval);
+      yychar = YYEMPTY;
+
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab2;
+
+
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action.  |
+`----------------------------------------------------*/
+yyerrlab1:
+
+  /* Suppress GCC warning that yyerrlab1 is unused when no action
+     invokes YYERROR.  MacOS 10.2.3's buggy "smart preprocessor"
+     insists on the trailing semicolon.  */
+#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
+  __attribute__ ((__unused__));
+#endif
+
+
+  goto yyerrlab2;
+
+
+/*---------------------------------------------------------------.
+| yyerrlab2 -- pop states until the error token can be shifted.  |
+`---------------------------------------------------------------*/
+yyerrlab2:
+  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;
+
+      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+      yydestruct (yystos[yystate], yyvsp);
+      yyvsp--;
+      yystate = *--yyssp;
+
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  YYDPRINTF ((stderr, "Shifting error token, "));
+
+  *++yyvsp = yylval;
+
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here.  |
+`----------------------------------------------*/
+yyoverflowlab:
+  yyerror ("parser stack overflow");
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+  return yyresult;
+}
+
+
+#line 102 "toc_parse.y"
+
+
+/* lexer interface */
+extern int toc_lineno;
+extern int yydebug;
+extern FILE *toc_yyin;
+
+void yyerror (char *s)
+{
+	fprintf(stderr, "%d: %s\n", toc_lineno, s);
+}
+
+Cd *toc_parse (FILE *fp)
+{
+	toc_yyin = fp;
+	yydebug = 0;
+
+	if (0 == yyparse())
+		return cd;
+
+	return NULL;
+}
+
Index: /libcuefile/trunk/toc_parse.h
===================================================================
--- /libcuefile/trunk/toc_parse.h	(revision 415)
+++ /libcuefile/trunk/toc_parse.h	(revision 415)
@@ -0,0 +1,146 @@
+/* A Bison parser, made by GNU Bison 1.875.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     NUMBER = 258,
+     STRING = 259,
+     CATALOG = 260,
+     CD_DA = 261,
+     CD_ROM = 262,
+     CD_ROM_XA = 263,
+     TRACK = 264,
+     AUDIO = 265,
+     MODE1 = 266,
+     MODE1_RAW = 267,
+     MODE2 = 268,
+     MODE2_FORM1 = 269,
+     MODE2_FORM2 = 270,
+     MODE2_FORM_MIX = 271,
+     MODE2_RAW = 272,
+     RW = 273,
+     RW_RAW = 274,
+     NO = 275,
+     COPY = 276,
+     PRE_EMPHASIS = 277,
+     TWO_CHANNEL_AUDIO = 278,
+     FOUR_CHANNEL_AUDIO = 279,
+     ISRC = 280,
+     SILENCE = 281,
+     ZERO = 282,
+     AUDIOFILE = 283,
+     DATAFILE = 284,
+     FIFO = 285,
+     START = 286,
+     PREGAP = 287,
+     INDEX = 288,
+     CD_TEXT = 289,
+     LANGUAGE_MAP = 290,
+     LANGUAGE = 291,
+     TITLE = 292,
+     PERFORMER = 293,
+     SONGWRITER = 294,
+     COMPOSER = 295,
+     ARRANGER = 296,
+     MESSAGE = 297,
+     DISC_ID = 298,
+     GENRE = 299,
+     TOC_INFO1 = 300,
+     TOC_INFO2 = 301,
+     UPC_EAN = 302,
+     SIZE_INFO = 303
+   };
+#endif
+#define NUMBER 258
+#define STRING 259
+#define CATALOG 260
+#define CD_DA 261
+#define CD_ROM 262
+#define CD_ROM_XA 263
+#define TRACK 264
+#define AUDIO 265
+#define MODE1 266
+#define MODE1_RAW 267
+#define MODE2 268
+#define MODE2_FORM1 269
+#define MODE2_FORM2 270
+#define MODE2_FORM_MIX 271
+#define MODE2_RAW 272
+#define RW 273
+#define RW_RAW 274
+#define NO 275
+#define COPY 276
+#define PRE_EMPHASIS 277
+#define TWO_CHANNEL_AUDIO 278
+#define FOUR_CHANNEL_AUDIO 279
+#define ISRC 280
+#define SILENCE 281
+#define ZERO 282
+#define AUDIOFILE 283
+#define DATAFILE 284
+#define FIFO 285
+#define START 286
+#define PREGAP 287
+#define INDEX 288
+#define CD_TEXT 289
+#define LANGUAGE_MAP 290
+#define LANGUAGE 291
+#define TITLE 292
+#define PERFORMER 293
+#define SONGWRITER 294
+#define COMPOSER 295
+#define ARRANGER 296
+#define MESSAGE 297
+#define DISC_ID 298
+#define GENRE 299
+#define TOC_INFO1 300
+#define TOC_INFO2 301
+#define UPC_EAN 302
+#define SIZE_INFO 303
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 28 "toc_parse.y"
+typedef union YYSTYPE {
+	long ival;
+	char *sval;
+} YYSTYPE;
+/* Line 1249 of yacc.c.  */
+#line 137 "toc_parse.h"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE yylval;
+
+
+
Index: /libcuefile/trunk/toc_parse_prefix.h
===================================================================
--- /libcuefile/trunk/toc_parse_prefix.h	(revision 415)
+++ /libcuefile/trunk/toc_parse_prefix.h	(revision 415)
@@ -0,0 +1,44 @@
+/* Remap normal yacc names so we can have multiple parsers
+ * see http://www.gnu.org/software/automake/manual/html_node/Yacc-and-Lex.html
+ */
+
+#define yymaxdepth	toc_yymaxdepth
+#define yyparse		toc_yyparse
+#define yylex		toc_yylex
+#define yyerror		toc_yyerror
+#define yylval		toc_yylval
+#define yychar		toc_ychar
+#define yydebug		toc_yydebug
+#define yypact		toc_yypact
+#define yyr1		toc_yyr1
+#define yyr2		toc_yyr2
+#define yydef		toc_yydef
+#define yychk		toc_yychk
+#define yypgo		toc_yypgo
+#define yyact		toc_yyact
+#define yyexca		toc_yyexca
+#define yyerrflag	toc_yyerrflag
+#define yynerrs		toc_yynerrs
+#define yyps		toc_yyps
+#define yypv		toc_yypv
+#define yys		toc_yys
+#define yy_yys		toc_yy_yys
+#define yystate		toc_yystate
+#define yytmp		toc_yytmp
+#define yyv		toc_yyv
+#define yy_yyv		toc_yy_yyv
+#define yyval		toc_yyval
+#define yylloc		toc_yylloc
+#define yyreds		toc_yyreds
+#define yytoks		toc_yytoks
+#define yylhs		toc_yylhs
+#define yylen		toc_yylen
+#define yydefred	toc_yydefred
+#define yydgoto		toc_yydgoto
+#define yysinde		toc_yysindex
+#define yyrindex	toc_yyrindex
+#define yygindex	toc_yygindex
+#define yytable		toc_yytable
+#define yycheck		toc_yycheck
+#define yyname		toc_yyname
+#define yyrule		toc_yyrule
Index: /libcuefile/trunk/toc_print.c
===================================================================
--- /libcuefile/trunk/toc_print.c	(revision 415)
+++ /libcuefile/trunk/toc_print.c	(revision 415)
@@ -0,0 +1,149 @@
+/*
+ * toc_print.c -- print toc file
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "cd.h"
+#include "time.h"
+
+void toc_print_track (FILE *fp, Track *track);
+void toc_print_cdtext (Cdtext *cdtext, FILE *fp, int istrack);
+
+void toc_print (FILE *fp, Cd *cd)
+{
+	Cdtext *cdtext = cd_get_cdtext(cd);
+	int i; 	/* track */
+	Track *track;
+
+	switch(cd_get_mode(cd)) {
+	case MODE_CD_DA:
+		fprintf(fp, "CD_DA\n");
+	       	break;
+	case MODE_CD_ROM:
+		fprintf(fp, "CD_ROM\n");
+	       	break;
+	case MODE_CD_ROM_XA:
+		fprintf(fp, "CD_ROM_XA\n");
+	       	break;
+	}
+
+	if (NULL != cd_get_catalog(cd))
+		fprintf(fp, "CATALOG \"%s\"\n", cd_get_catalog(cd));
+
+	if(0 != cdtext_is_empty(cdtext)) {
+		fprintf(fp, "CD_TEXT {\n");
+		fprintf(fp, "\tLANGUAGE_MAP { 0:9 }\n");
+		fprintf(fp, "\tLANGUAGE 0 {\n");
+		toc_print_cdtext(cdtext, fp, 0);
+		fprintf(fp, "\t}\n");
+		fprintf(fp, "}\n");
+	}
+
+	for (i = 1; i <= cd_get_ntrack(cd); i++) {
+		track = cd_get_track(cd, i);
+		fprintf(fp, "\n");
+		toc_print_track(fp, track);
+	}
+}
+
+void toc_print_track (FILE *fp, Track *track)
+{
+	Cdtext *cdtext = track_get_cdtext(track);
+	int i;	/* index */
+
+	fprintf(fp, "TRACK ");
+	switch (track_get_mode(track)) {
+	case MODE_AUDIO:
+		fprintf(fp, "AUDIO");
+	       	break;
+	case MODE_MODE1:
+		fprintf(fp, "MODE1");
+	       	break;
+	case MODE_MODE1_RAW:
+		fprintf(fp, "MODE1_RAW");
+	       	break;
+	case MODE_MODE2:
+		fprintf(fp, "MODE2");
+	       	break;
+	case MODE_MODE2_FORM1:
+		fprintf(fp, "MODE2_FORM1");
+	       	break;
+	case MODE_MODE2_FORM2:
+		fprintf(fp, "MODE2_FORM2");
+	       	break;
+	case MODE_MODE2_FORM_MIX:
+		fprintf(fp, "MODE2_FORM_MIX");
+	       	break;
+	}
+	fprintf(fp, "\n");
+
+	if (0 != track_is_set_flag(track, FLAG_PRE_EMPHASIS))
+		fprintf(fp, "PRE_EMPHASIS\n");
+	if (0 != track_is_set_flag(track, FLAG_COPY_PERMITTED))
+		fprintf(fp, "COPY\n");
+	if (0 != track_is_set_flag(track, FLAG_FOUR_CHANNEL))
+		fprintf(fp, "FOUR_CHANNEL_AUDIO\n");
+
+	if (NULL != track_get_isrc(track))
+		fprintf(fp, "ISRC \"%s\"\n", track_get_isrc(track));
+
+	if (0 != cdtext_is_empty(cdtext)) {
+		fprintf(fp, "CD_TEXT {\n");
+		fprintf(fp, "\tLANGUAGE 0 {\n");
+		toc_print_cdtext(cdtext, fp, 1);
+		fprintf(fp, "\t}\n");
+		fprintf(fp, "}\n");
+	}
+
+	if (0 != track_get_zero_pre(track)) {
+		fprintf(fp, "ZERO ");
+		fprintf(fp, "%s", time_frame_to_mmssff(track_get_zero_pre(track)));
+		fprintf(fp, "\n");
+	}
+		
+	fprintf(fp, "FILE ");
+	fprintf(fp, "\"%s\" ", track_get_filename(track));
+	if (0 == track_get_start(track))
+		fprintf(fp, "0");
+	else
+		fprintf(fp, "%s", time_frame_to_mmssff(track_get_start(track)));
+	if (0 != track_get_length(track))
+		fprintf(fp, " %s", time_frame_to_mmssff(track_get_length(track)));
+	fprintf(fp, "\n");
+
+	if (0 != track_get_zero_post(track)) {
+		fprintf(fp, "ZERO ");
+		fprintf(fp, "%s", time_frame_to_mmssff(track_get_zero_post(track)));
+		fprintf(fp, "\n");
+	}
+		
+	if (track_get_index(track, 1) != 0) {
+		fprintf(fp, "START ");
+		fprintf(fp, "%s\n", time_frame_to_mmssff(track_get_index(track, 1)));
+	}
+
+	for (i = 2; i < track_get_nindex(track); i++) {
+		fprintf(fp, "INDEX ");
+		fprintf(fp, "%s\n", time_frame_to_mmssff( \
+		track_get_index(track, i) - track_get_index(track, 0) \
+		));
+	}
+}
+
+void toc_print_cdtext (Cdtext *cdtext, FILE *fp, int istrack)
+{
+	int pti;
+	char *value = NULL;
+
+	for (pti = 0; PTI_END != pti; pti++) {
+		if (NULL != (value = cdtext_get(pti, cdtext))) {
+			fprintf(fp, "\t\t");
+			fprintf(fp, "%s", cdtext_get_key(pti, istrack));
+			fprintf(fp, " \"%s\"\n", value);
+		}
+	}
+}
Index: /libcuefile/trunk/toc_scan.c
===================================================================
--- /libcuefile/trunk/toc_scan.c	(revision 415)
+++ /libcuefile/trunk/toc_scan.c	(revision 415)
@@ -0,0 +1,2143 @@
+#define yy_create_buffer toc_yy_create_buffer
+#define yy_delete_buffer toc_yy_delete_buffer
+#define yy_scan_buffer toc_yy_scan_buffer
+#define yy_scan_string toc_yy_scan_string
+#define yy_scan_bytes toc_yy_scan_bytes
+#define yy_flex_debug toc_yy_flex_debug
+#define yy_init_buffer toc_yy_init_buffer
+#define yy_flush_buffer toc_yy_flush_buffer
+#define yy_load_buffer_state toc_yy_load_buffer_state
+#define yy_switch_to_buffer toc_yy_switch_to_buffer
+#define yyin toc_yyin
+#define yyleng toc_yyleng
+#define yylex toc_yylex
+#define yyout toc_yyout
+#define yyrestart toc_yyrestart
+#define yytext toc_yytext
+
+#line 19 "toc_scan.c"
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $NetBSD: flex.skl,v 1.20 2004/02/01 21:24:02 christos Exp $
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+#include <unistd.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif	/* __STDC__ */
+#endif	/* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator).  This
+ * avoids problems with code like:
+ *
+ * 	if ( condition_holds )
+ *		yyless( 5 );
+ *	else
+ *		do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		*yy_cp = yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+	};
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;		/* whether we need to initialize */
+static int yy_start = 0;	/* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, yy_size_t len ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+#define yywrap() 1
+#define YY_SKIP_YYWRAP
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ))
+#ifdef __GNUC__
+    __attribute__((__unused__))
+#endif
+;
+static void yy_flex_free YY_PROTO(( void * ));
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yytext_ptr = yy_bp; \
+	yyleng = (int) (yy_cp - yy_bp); \
+	yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 55
+#define YY_END_OF_BUFFER 56
+static yyconst short int yy_accept[528] =
+    {   0,
+        0,    0,    0,    0,   56,   54,   49,   53,   54,   54,
+       51,   54,   50,   54,   54,   54,   54,   54,   54,   54,
+       54,   54,   54,   54,   54,   54,   54,   54,   49,   52,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,   49,    0,    2,    0,    0,    1,    0,    0,   50,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,   19,    0,    0,   17,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   49,   52,
+        3,    3,    2,    3,    3,    1,    3,    3,    3,    3,
+
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    2,    1,    0,
+       48,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    2,    1,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    0,    0,    0,    0,    0,    0,
+
+        0,   20,    0,    0,   28,   26,    0,    0,    0,   46,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,   25,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        0,    9,    0,    5,    0,    0,    0,    0,    0,    0,
+       42,   31,    0,    0,   10,   12,    0,    0,    0,    0,
+        0,    0,    0,   29,   35,    0,    8,    0,    0,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    0,    0,
+        0,    6,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,   30,    0,   18,    0,    0,    0,    0,    0,
+        0,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    0,    0,    4,    0,   32,    0,
+        0,   41,    0,    0,   40,    0,    0,    0,    0,    0,
+       24,    0,    0,    0,    0,   45,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+
+        3,    3,    3,    3,    3,    3,    3,    3,   39,    0,
+       38,   27,    0,   34,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    7,    0,
+        0,   11,    0,   16,   36,    0,   47,    0,   43,   44,
+        0,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    0,    0,    0,    0,   37,    0,
+        3,    3,    3,    3,    3,    3,    0,    0,   13,   14,
+        0,    0,    0,    3,    3,    3,    3,    3,    3,    3,
+        0,   33,    0,   21,    0,    3,    3,    3,    3,    3,
+
+        0,    0,    0,    3,    3,    3,    0,   15,    0,    3,
+        3,    3,    0,    0,    3,    3,    0,    0,    3,    3,
+        0,   23,    3,    3,   22,    3,    0
+    } ;
+
+static yyconst int yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    4,    1,    1,    1,    1,    5,    1,
+        1,    1,    1,    6,    1,    1,    7,    8,    9,   10,
+        8,    8,    8,    8,    8,    8,    8,   11,    1,    1,
+        1,    1,    1,    1,   12,    1,   13,   14,   15,   16,
+       17,   18,   19,    1,   20,   21,   22,   23,   24,   25,
+        1,   26,   27,   28,   29,    1,   30,   31,   32,   33,
+        1,   34,    1,    1,   35,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,   36,    1,   37,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst int yy_meta[38] =
+    {   0,
+        1,    2,    2,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1
+    } ;
+
+static yyconst short int yy_base[535] =
+    {   0,
+        0,   36,   39,   75,  616,  617,  613,  617,   75,   76,
+      617,  607,   74,   59,   75,   74,   71,  598,   69,  600,
+       76,  587,   79,  580,   78,   88,  584,  593,  101,  617,
+        0,  113,  117,    0,  600,  115,   72,  114,  115,   89,
+      591,  106,  593,  106,  580,  116,  573,  113,  120,  577,
+      586,  598,  131,  617,  132,  106,  617,  138,  596,  144,
+      572,  583,  568,  560,  123,  566,  566,  139,  563,  568,
+      576,  563,  565,  560,  572,  617,  559,  569,  548,  128,
+      559,  569,  552,  566,  566,  553,  563,  549,  154,  617,
+        0,  160,    0,  165,  168,    0,  172,  156,  170,  548,
+
+      559,  544,  536,  159,  542,  542,  166,  539,  544,  552,
+      539,  541,  536,  548,    0,  535,  545,  524,  155,  535,
+      545,  528,  542,  542,  529,  539,  525,  179,  180,  547,
+      617,  537,  529,  535,  172,  521,  513,  532,  530,  518,
+      526,  514,  513,  523,  524,  519,  508,  519,  517,  172,
+      506,  516,  515,  512,  502,  506,  491,  512,  489,  488,
+      498,  188,  206,  193,  509,  501,  507,  189,  493,  485,
+      504,  502,  490,  498,  486,  485,  495,  496,  491,  480,
+      491,  489,  184,  478,  488,  487,  484,  474,  478,  463,
+      484,  461,  460,  470,  470,  468,  470,  478,  465,  473,
+
+      463,  617,  470,  450,  617,  617,  449,  468,  451,  617,
+      452,  468,  195,  455,  466,  462,  464,  452,  439,  443,
+      444,  456,  451,  449,  455,  452,  617,  443,  441,  443,
+      451,  438,  446,  436,    0,  443,  423,    0,    0,  422,
+      441,  424,    0,  425,  441,  211,  428,  439,  435,  437,
+      425,  412,  416,  417,  429,  424,  422,  428,  425,    0,
+      422,  422,  413,  617,  414,  404,  407,  414,  413,  418,
+      617,  617,  418,  412,  393,  392,  400,  400,  402,  393,
+      409,  402,  394,  617,  617,  396,  617,  400,  405,  399,
+      399,  390,    0,  391,  381,  384,  391,  390,  395,    0,
+
+        0,  395,  389,  370,  369,  377,  377,  379,  370,  386,
+      379,  371,    0,    0,  373,    0,  377,  382,  378,  373,
+      374,  355,  361,  373,  366,  372,  367,  367,  368,  356,
+      200,  359,  617,  355,  617,  364,  355,  358,  360,  363,
+      351,  358,  353,  354,  335,  341,  353,  346,  352,  347,
+      347,  348,  336,  202,  339,    0,  335,    0,  344,  335,
+      338,  340,  343,  331,  327,  331,  617,  320,  617,  324,
+      334,  617,  336,  332,  617,  334,  321,  332,  328,  324,
+      617,  325,  312,  315,  315,  617,  311,  315,    0,  304,
+        0,  308,  318,    0,  320,  316,    0,  318,  305,  316,
+
+      312,  308,    0,  309,  296,  299,  299,    0,  617,  309,
+      617,  617,  297,  284,  288,  291,  286,  289,  302,  289,
+      297,  214,  288,    0,  298,    0,    0,  286,  273,  277,
+      280,  275,  278,  291,  278,  286,  220,  277,  617,  276,
+      276,  617,  275,  617,  617,  269,  617,  269,  617,  617,
+      279,    0,  270,  270,    0,  269,    0,    0,  263,    0,
+      263,    0,    0,  273,  272,  274,  222,  266,  617,  263,
+      268,  270,  224,  262,    0,  259,  258,  253,  617,  617,
+      255,  249,  240,  253,  248,    0,    0,  250,  231,  221,
+      220,  617,  235,  617,  241,  217,    0,  232,    0,  238,
+
+      237,  217,  218,  234,  214,  215,  214,  617,  228,  212,
+        0,  225,  224,  218,  222,  216,  208,  201,  193,  186,
+      173,  617,  169,    0,  617,    0,  617,  259,  261,   79,
+      263,  265,  267,  269
+    } ;
+
+static yyconst short int yy_def[535] =
+    {   0,
+      527,    1,  527,    3,  527,  527,  527,  527,  528,  529,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      530,  531,  532,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  527,  528,  527,  528,  529,  527,  529,  533,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      530,  531,  530,  531,  532,  530,  532,  534,  530,  530,
+
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  528,  529,  533,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  531,  532,  534,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  527,  527,  527,  527,  527,  527,
+
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+
+      530,  530,  530,  530,  530,  530,  530,  530,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  530,  530,  530,  530,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  530,  530,  530,  530,  530,  530,  530,  530,  530,
+      530,  530,  530,  530,  527,  527,  527,  527,  527,  527,
+      530,  530,  530,  530,  530,  530,  527,  527,  527,  527,
+      527,  527,  527,  530,  530,  530,  530,  530,  530,  530,
+      527,  527,  527,  527,  527,  530,  530,  530,  530,  530,
+
+      527,  527,  527,  530,  530,  530,  527,  527,  527,  530,
+      530,  530,  527,  527,  530,  530,  527,  527,  530,  530,
+      527,  527,  530,  530,  527,  530,    0,  527,  527,  527,
+      527,  527,  527,  527
+    } ;
+
+static yyconst short int yy_nxt[655] =
+    {   0,
+        6,    7,    8,    9,   10,   11,   12,   13,   13,   13,
+       11,   14,   15,   16,    6,   17,   18,    6,   19,    6,
+       20,   21,   22,    6,   23,   24,   25,   26,   27,    6,
+        6,    6,   28,    6,    6,   11,   11,   29,   30,   31,
+        7,    8,   32,   33,   34,   35,   36,   36,   36,   34,
+       37,   38,   39,   31,   40,   41,   31,   42,   31,   43,
+       44,   45,   31,   46,   47,   48,   49,   50,   31,   31,
+       31,   51,   31,   31,   34,   34,   29,   30,   54,   91,
+       57,   60,   60,   60,   61,   66,   63,   62,   64,   68,
+       74,   71,   67,   77,   69,   72,   80,  100,   65,   75,
+
+      101,   81,   89,   90,   78,   82,   83,  107,   55,   58,
+       57,   84,  108,   85,   53,   53,   93,   86,   56,   56,
+      113,   96,   99,   99,   99,  102,  105,  103,  110,  114,
+      116,  119,  111,  106,   54,  128,  120,  104,  122,   58,
+      121,  117,  129,  123,  136,  124,   94,  137,  152,  125,
+       97,   60,   60,   60,  140,   89,   90,  130,  131,  141,
+      153,   53,   53,   93,   55,   55,   53,   53,  162,   56,
+       56,   58,   96,   56,   56,  185,  163,   99,   99,   99,
+      169,  173,   54,  170,   57,  198,  174,  186,  215,   53,
+       53,   93,  526,   94,  130,  131,  525,  199,   94,  200,
+
+      248,   97,  231,  275,  276,   97,  216,   56,   56,  524,
+       96,  523,   55,   58,  232,  377,  233,  399,  249,  304,
+      305,   94,  449,  450,  522,  378,  521,  400,  462,  463,
+      479,  480,  486,  487,  520,  519,  518,  517,  516,   97,
+      515,  514,  513,  512,  511,  510,  509,  508,  507,  506,
+      505,  504,  503,  502,  501,  500,  481,  499,  488,   53,
+       53,   56,   56,   92,   92,   95,   95,  130,  130,  164,
+      164,  498,  497,  496,  495,  494,  493,  492,  491,  490,
+      489,  485,  484,  483,  482,  478,  477,  476,  475,  474,
+      473,  472,  471,  470,  469,  468,  467,  466,  465,  464,
+
+      461,  460,  459,  458,  457,  456,  455,  454,  453,  452,
+      451,  448,  447,  446,  445,  444,  443,  442,  441,  440,
+      439,  438,  437,  436,  435,  434,  433,  432,  431,  430,
+      429,  428,  427,  426,  425,  174,  424,  423,  422,  421,
+      420,  419,  418,  417,  416,  415,  414,  413,  412,  411,
+      410,  141,  409,  408,  407,  406,  405,  404,  403,  402,
+      401,  398,  397,  396,  395,  394,  393,  392,  391,  390,
+      389,  388,  387,  386,  385,  384,  383,  382,  381,  380,
+      379,  376,  375,  374,  373,  372,  371,  370,  369,  368,
+      367,  366,  365,  364,  363,  362,  361,  360,  359,  358,
+
+      357,  356,  355,  354,  353,  352,  351,  350,  349,  348,
+      347,  346,  345,  344,  343,  342,  341,  340,  339,  338,
+      337,  336,  335,  334,  333,  332,  331,  330,  329,  328,
+      327,  326,  325,  324,  323,  322,  321,  320,  319,  318,
+      317,  316,  315,  314,  313,  312,  311,  310,  309,  308,
+      307,  306,  303,  302,  301,  300,  299,  298,  297,  296,
+      295,  294,  293,  292,  291,  290,  289,  288,  287,  286,
+      285,  284,  283,  282,  281,  280,  279,  278,  277,  274,
+      273,  272,  271,  270,  269,  268,  267,  266,  265,  264,
+      263,  262,  261,  260,  259,  258,  257,  256,  255,  254,
+
+      253,  252,  251,  250,  247,  246,  245,  244,  243,  242,
+      241,  240,  239,  238,  237,  236,  235,  234,  230,  229,
+      228,  227,  226,  225,  224,  223,  222,  221,  220,  219,
+      218,  217,  214,  213,  212,  211,  210,  209,  208,  207,
+      206,  205,  204,  203,  202,  201,  197,  196,  195,  131,
+      194,  193,  192,  191,  190,  189,  188,  187,  184,  183,
+      182,  181,  180,  179,  178,  177,  176,  175,  172,  171,
+      168,  167,  166,  165,  161,  160,  159,  158,  157,  156,
+      155,  154,  151,  150,  149,  148,  147,  146,  145,  144,
+      143,  142,  139,  138,  135,  134,  133,  132,  131,   52,
+
+      127,  126,  118,  115,  112,  109,   98,   88,   87,   79,
+       76,   73,   70,   59,   52,  527,    5,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527
+    } ;
+
+static yyconst short int yy_chk[655] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    2,    2,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
+        3,    3,    3,    3,    3,    3,    4,    4,    9,  530,
+       10,   13,   13,   13,   14,   16,   15,   14,   15,   17,
+       21,   19,   16,   23,   17,   19,   25,   37,   15,   21,
+
+       37,   25,   29,   29,   23,   25,   26,   40,    9,   10,
+       56,   26,   40,   26,   32,   32,   32,   26,   33,   33,
+       44,   33,   36,   36,   36,   38,   39,   38,   42,   44,
+       46,   48,   42,   39,   53,   55,   48,   38,   49,   56,
+       48,   46,   58,   49,   65,   49,   32,   65,   80,   49,
+       33,   60,   60,   60,   68,   89,   89,   98,   98,   68,
+       80,   92,   92,   92,   53,   55,   94,   94,   94,   95,
+       95,   58,   95,   97,   97,  119,   97,   99,   99,   99,
+      104,  107,  128,  104,  129,  135,  107,  119,  150,  162,
+      162,  162,  523,   92,  164,  164,  521,  135,   94,  135,
+
+      183,   95,  168,  213,  213,   97,  150,  163,  163,  520,
+      163,  519,  128,  129,  168,  331,  168,  354,  183,  246,
+      246,  162,  422,  422,  518,  331,  517,  354,  437,  437,
+      467,  467,  473,  473,  516,  515,  514,  513,  512,  163,
+      510,  509,  507,  506,  505,  504,  503,  502,  501,  500,
+      498,  496,  495,  493,  491,  490,  467,  489,  473,  528,
+      528,  529,  529,  531,  531,  532,  532,  533,  533,  534,
+      534,  488,  485,  484,  483,  482,  481,  478,  477,  476,
+      474,  472,  471,  470,  468,  466,  465,  464,  461,  459,
+      456,  454,  453,  451,  448,  446,  443,  441,  440,  438,
+
+      436,  435,  434,  433,  432,  431,  430,  429,  428,  425,
+      423,  421,  420,  419,  418,  417,  416,  415,  414,  413,
+      410,  407,  406,  405,  404,  402,  401,  400,  399,  398,
+      396,  395,  393,  392,  390,  388,  387,  385,  384,  383,
+      382,  380,  379,  378,  377,  376,  374,  373,  371,  370,
+      368,  366,  365,  364,  363,  362,  361,  360,  359,  357,
+      355,  353,  352,  351,  350,  349,  348,  347,  346,  345,
+      344,  343,  342,  341,  340,  339,  338,  337,  336,  334,
+      332,  330,  329,  328,  327,  326,  325,  324,  323,  322,
+      321,  320,  319,  318,  317,  315,  312,  311,  310,  309,
+
+      308,  307,  306,  305,  304,  303,  302,  299,  298,  297,
+      296,  295,  294,  292,  291,  290,  289,  288,  286,  283,
+      282,  281,  280,  279,  278,  277,  276,  275,  274,  273,
+      270,  269,  268,  267,  266,  265,  263,  262,  261,  259,
+      258,  257,  256,  255,  254,  253,  252,  251,  250,  249,
+      248,  247,  245,  244,  242,  241,  240,  237,  236,  234,
+      233,  232,  231,  230,  229,  228,  226,  225,  224,  223,
+      222,  221,  220,  219,  218,  217,  216,  215,  214,  212,
+      211,  209,  208,  207,  204,  203,  201,  200,  199,  198,
+      197,  196,  195,  194,  193,  192,  191,  190,  189,  188,
+
+      187,  186,  185,  184,  182,  181,  180,  179,  178,  177,
+      176,  175,  174,  173,  172,  171,  170,  169,  167,  166,
+      165,  161,  160,  159,  158,  157,  156,  155,  154,  153,
+      152,  151,  149,  148,  147,  146,  145,  144,  143,  142,
+      141,  140,  139,  138,  137,  136,  134,  133,  132,  130,
+      127,  126,  125,  124,  123,  122,  121,  120,  118,  117,
+      116,  114,  113,  112,  111,  110,  109,  108,  106,  105,
+      103,  102,  101,  100,   88,   87,   86,   85,   84,   83,
+       82,   81,   79,   78,   77,   75,   74,   73,   72,   71,
+       70,   69,   67,   66,   64,   63,   62,   61,   59,   52,
+
+       51,   50,   47,   45,   43,   41,   35,   28,   27,   24,
+       22,   20,   18,   12,    7,    5,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  527
+    } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "toc_scan.l"
+#define INITIAL 0
+#line 2 "toc_scan.l"
+/*
+ * toc_scan.l -- lexer for toc files
+ *
+ * Copyright (C) 2004, 2005, 2006 Svend Sorensen
+ * For license terms, see the file COPYING in this distribution.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "cd.h"
+#include "toc_parse_prefix.h"
+#include "toc_parse.h"
+
+int toc_lineno = 1;
+#define NAME 1
+
+#line 723 "toc_scan.c"
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ))
+#ifdef __GNUC__
+    __attribute__((__unused__))
+#endif
+;
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, yy_size_t ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static yy_size_t yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines.  This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, (size_t)yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( yy_current_buffer->yy_is_interactive ) \
+		{ \
+		int c = '*', n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else if ( ((result = fread( buf, 1, (size_t)max_size, yyin )) == 0) \
+		  && ferror( yyin ) ) \
+		YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK /*LINTED*/break;
+#endif
+
+#define YY_RULE_SETUP \
+	if ( yyleng > 0 ) \
+		yy_current_buffer->yy_at_bol = \
+				(yytext[yyleng - 1] == '\n'); \
+	YY_USER_ACTION
+
+YY_DECL
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp, *yy_bp;
+	register int yy_act;
+
+#line 26 "toc_scan.l"
+
+
+#line 884 "toc_scan.c"
+
+#if defined(YY_USES_REJECT) && (defined(__GNUC__) || defined(lint))
+	/* XXX: shut up `unused label' warning with %options yylineno */
+	if (/*CONSTCOND*/0 && yy_full_match)
+		goto find_rule;
+#endif
+	if ( yy_init )
+		{
+		yy_init = 0;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yy_start )
+			yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! yy_current_buffer )
+			yy_current_buffer =
+				yy_create_buffer( yyin, YY_BUF_SIZE );
+
+		yy_load_buffer_state();
+		}
+
+	while (/*CONSTCOND*/ 1 )	/* loops until end-of-file is reached */
+		{
+		yy_cp = yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yy_start;
+		yy_current_state += YY_AT_BOL();
+yy_match:
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			if ( yy_accept[yy_current_state] )
+				{
+				yy_last_accepting_state = yy_current_state;
+				yy_last_accepting_cpos = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 528 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			++yy_cp;
+			}
+		while ( yy_base[yy_current_state] != 617 );
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+		if ( yy_act == 0 )
+			{ /* have to back up */
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			yy_act = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+
+do_action:	/* This label is used only to access EOF actions. */
+
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yy_hold_char;
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			goto yy_find_action;
+
+case 1:
+#line 29 "toc_scan.l"
+case 2:
+YY_RULE_SETUP
+#line 29 "toc_scan.l"
+{
+		yylval.sval = strdup(yytext + 1);
+		yylval.sval[strlen(yylval.sval) - 1] = '\0';
+		BEGIN(INITIAL);
+		return STRING;
+		}
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 36 "toc_scan.l"
+{
+		yylval.sval = strdup(yytext);
+		BEGIN(INITIAL);
+		return STRING;
+		}
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 42 "toc_scan.l"
+{ BEGIN(NAME); return CATALOG; }
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 44 "toc_scan.l"
+{ yylval.ival = MODE_CD_DA; return CD_DA; }
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 45 "toc_scan.l"
+{ yylval.ival = MODE_CD_ROM; return CD_ROM; }
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 46 "toc_scan.l"
+{ yylval.ival = MODE_CD_ROM_XA; return CD_ROM_XA; }
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 48 "toc_scan.l"
+{ return TRACK; }
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 49 "toc_scan.l"
+{ yylval.ival = MODE_AUDIO; return AUDIO; }
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 50 "toc_scan.l"
+{ yylval.ival = MODE_MODE1; return MODE1; }
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 51 "toc_scan.l"
+{ yylval.ival = MODE_MODE1_RAW; return MODE1_RAW; }
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 52 "toc_scan.l"
+{ yylval.ival = MODE_MODE2; return MODE2; }
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 53 "toc_scan.l"
+{ yylval.ival = MODE_MODE2_FORM1; return MODE2_FORM1; }
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 54 "toc_scan.l"
+{ yylval.ival = MODE_MODE2_FORM2; return MODE2_FORM2; }
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 55 "toc_scan.l"
+{ yylval.ival = MODE_MODE2_FORM_MIX; return MODE2_FORM_MIX; }
+	YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 56 "toc_scan.l"
+{ yylval.ival = MODE_MODE2_RAW; return MODE2_RAW; }
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 57 "toc_scan.l"
+{ yylval.ival = SUB_MODE_RW; return RW; }
+	YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 58 "toc_scan.l"
+{ yylval.ival = SUB_MODE_RW_RAW; return RW_RAW; }
+	YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 60 "toc_scan.l"
+{ return NO; }
+	YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 61 "toc_scan.l"
+{ yylval.ival = FLAG_COPY_PERMITTED; return COPY; }
+	YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 62 "toc_scan.l"
+{ yylval.ival = FLAG_PRE_EMPHASIS; return PRE_EMPHASIS; }
+	YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 63 "toc_scan.l"
+{ yylval.ival = FLAG_FOUR_CHANNEL; return FOUR_CHANNEL_AUDIO; }
+	YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 64 "toc_scan.l"
+{ yylval.ival = FLAG_FOUR_CHANNEL; return TWO_CHANNEL_AUDIO; }
+	YY_BREAK
+/* ISRC is with CD-TEXT items */
+case 24:
+YY_RULE_SETUP
+#line 68 "toc_scan.l"
+{ return SILENCE; }
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 69 "toc_scan.l"
+{ return ZERO; }
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 70 "toc_scan.l"
+{ BEGIN(NAME); return AUDIOFILE; }
+	YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 71 "toc_scan.l"
+{ BEGIN(NAME); return DATAFILE; }
+	YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 72 "toc_scan.l"
+{ BEGIN(NAME); return FIFO; }
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 73 "toc_scan.l"
+{ return START; }
+	YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 74 "toc_scan.l"
+{ return PREGAP; }
+	YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 75 "toc_scan.l"
+{ return INDEX; }
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 77 "toc_scan.l"
+{ return CD_TEXT; }
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 78 "toc_scan.l"
+{ return LANGUAGE_MAP; }
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 79 "toc_scan.l"
+{ return LANGUAGE; }
+	YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 81 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_TITLE;  return TITLE; }
+	YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 82 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_PERFORMER;  return PERFORMER; }
+	YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 83 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_SONGWRITER;  return SONGWRITER; }
+	YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 84 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_COMPOSER;  return COMPOSER; }
+	YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 85 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_ARRANGER;  return ARRANGER; }
+	YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 86 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_MESSAGE;  return MESSAGE; }
+	YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 87 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_DISC_ID;  return DISC_ID; }
+	YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 88 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_GENRE;  return GENRE; }
+	YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 89 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_TOC_INFO1;  return TOC_INFO1; }
+	YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 90 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_TOC_INFO2;  return TOC_INFO2; }
+	YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 91 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_UPC_ISRC;  return UPC_EAN; }
+	YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 92 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_UPC_ISRC;  return ISRC; }
+	YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 93 "toc_scan.l"
+{ BEGIN(NAME); yylval.ival = PTI_SIZE_INFO;  return SIZE_INFO; }
+	YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 95 "toc_scan.l"
+{ toc_lineno++; /* ignore comments */ }
+	YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 96 "toc_scan.l"
+{ /* ignore whitespace */ }
+	YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 98 "toc_scan.l"
+{ yylval.ival = atoi(yytext); return NUMBER; }
+	YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 99 "toc_scan.l"
+{ return yytext[0]; }
+	YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 101 "toc_scan.l"
+{ toc_lineno++; /* blank line */ }
+	YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 102 "toc_scan.l"
+{ toc_lineno++; return '\n'; }
+	YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 103 "toc_scan.l"
+{ fprintf(stderr, "bad character '%c'\n", yytext[0]); }
+	YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 105 "toc_scan.l"
+ECHO;
+	YY_BREAK
+#line 1255 "toc_scan.c"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(NAME):
+	yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between yy_current_buffer and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yy_n_chars = yy_current_buffer->yy_n_chars;
+			yy_current_buffer->yy_input_file = yyin;
+			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state();
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+			yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yy_c_buf_p;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer() )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap() )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yy_c_buf_p =
+					yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yy_c_buf_p =
+				&yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+	{
+	register char *dest = yy_current_buffer->yy_ch_buf;
+	register char *source = yytext_ptr;
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( yy_current_buffer->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+	else
+		{
+		int num_to_read =
+			yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+			YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = yy_current_buffer;
+
+			int yy_c_buf_p_offset =
+				(int) (yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yy_flex_realloc( (void *) b->yy_ch_buf,
+							 b->yy_buf_size + 2 );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = yy_current_buffer->yy_buf_size -
+						number_to_move - 1;
+#endif
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+			yy_n_chars, num_to_read );
+
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	if ( yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin );
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			yy_current_buffer->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	yy_n_chars += number_to_move;
+	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+	return ret_val;
+	}
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+	{
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
+
+	yy_current_state = yy_start;
+	yy_current_state += YY_AT_BOL();
+
+	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+		{
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yy_last_accepting_state = yy_current_state;
+			yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 528 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		}
+
+	return yy_current_state;
+	}
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+	{
+	register int yy_is_jam;
+	register char *yy_cp = yy_c_buf_p;
+
+	register YY_CHAR yy_c = 1;
+	if ( yy_accept[yy_current_state] )
+		{
+		yy_last_accepting_state = yy_current_state;
+		yy_last_accepting_cpos = yy_cp;
+		}
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 528 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 527);
+
+	return yy_is_jam ? 0 : yy_current_state;
+	}
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+	{
+	register char *yy_cp = yy_c_buf_p;
+
+	/* undo effects of setting up yytext */
+	*yy_cp = yy_hold_char;
+
+	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		{ /* need to shift things up to make room */
+		/* +2 for EOB chars. */
+		register int number_to_move = yy_n_chars + 2;
+		register char *dest = &yy_current_buffer->yy_ch_buf[
+					yy_current_buffer->yy_buf_size + 2];
+		register char *source =
+				&yy_current_buffer->yy_ch_buf[number_to_move];
+
+		while ( source > yy_current_buffer->yy_ch_buf )
+			*--dest = *--source;
+
+		yy_cp += (int) (dest - source);
+		yy_bp += (int) (dest - source);
+		yy_current_buffer->yy_n_chars =
+			yy_n_chars = yy_current_buffer->yy_buf_size;
+
+		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+		}
+
+	*--yy_cp = (char) c;
+
+
+	yytext_ptr = yy_bp;
+	yy_hold_char = *yy_cp;
+	yy_c_buf_p = yy_cp;
+	}
+#endif	/* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+	{
+	int c;
+
+	*yy_c_buf_p = yy_hold_char;
+
+	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			/* This was really a NUL. */
+			*yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = yy_c_buf_p - yytext_ptr;
+			++yy_c_buf_p;
+
+			switch ( yy_get_next_buffer() )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart( yyin );
+
+					/*FALLTHROUGH*/
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap() )
+						return EOF;
+
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput();
+#else
+					return input();
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yy_c_buf_p = yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
+	*yy_c_buf_p = '\0';	/* preserve yytext */
+	yy_hold_char = *++yy_c_buf_p;
+
+	yy_current_buffer->yy_at_bol = (c == '\n');
+
+	return c;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+	{
+	if ( ! yy_current_buffer )
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+	yy_init_buffer( yy_current_buffer, input_file );
+	yy_load_buffer_state();
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+	{
+	if ( yy_current_buffer == new_buffer )
+		return;
+
+	if ( yy_current_buffer )
+		{
+		/* Flush out information for old buffer. */
+		*yy_c_buf_p = yy_hold_char;
+		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	yy_current_buffer = new_buffer;
+	yy_load_buffer_state();
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yy_did_buffer_switch_on_eof = 1;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+	{
+	yy_n_chars = yy_current_buffer->yy_n_chars;
+	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+	yyin = yy_current_buffer->yy_input_file;
+	yy_hold_char = *yy_c_buf_p;
+	}
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer( b, file );
+
+	return b;
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+	{
+	if ( ! b )
+		return;
+
+	if ( b == yy_current_buffer )
+		yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yy_flex_free( (void *) b->yy_ch_buf );
+
+	yy_flex_free( (void *) b );
+	}
+
+
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+#include <unistd.h>
+#endif
+#endif
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+	{
+	yy_flush_buffer( b );
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+	b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+	b->yy_is_interactive = 0;
+#else
+	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+	}
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+	{
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == yy_current_buffer )
+		yy_load_buffer_state();
+	}
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+	{
+	YY_BUFFER_STATE b;
+
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	yy_switch_to_buffer( b );
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+	{
+	yy_size_t len;
+	for ( len = 0; yy_str[len]; ++len )
+		;
+
+	return yy_scan_bytes( yy_str, len );
+	}
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, yy_size_t len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+yy_size_t len;
+#endif
+	{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n, i;
+
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = len + 2;
+	buf = (char *) yy_flex_alloc( n );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+	for ( i = 0; i < len; ++i )
+		buf[i] = bytes[i];
+
+	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer( buf, n );
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+	}
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+	{
+	if ( yy_start_stack_ptr >= yy_start_stack_depth )
+		{
+		yy_size_t new_size;
+
+		yy_start_stack_depth += YY_START_STACK_INCR;
+		new_size = yy_start_stack_depth * sizeof( int );
+
+		if ( ! yy_start_stack )
+			yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+		else
+			yy_start_stack = (int *) yy_flex_realloc(
+					(void *) yy_start_stack, new_size );
+
+		if ( ! yy_start_stack )
+			YY_FATAL_ERROR(
+			"out of memory expanding start-condition stack" );
+		}
+
+	yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+	BEGIN(new_state);
+	}
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+	{
+	if ( --yy_start_stack_ptr < 0 )
+		YY_FATAL_ERROR( "start-condition stack underflow" );
+
+	BEGIN(yy_start_stack[yy_start_stack_ptr]);
+	}
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+	{
+	return yy_start_stack[yy_start_stack_ptr - 1];
+	}
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+	{
+	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+	}
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		yytext[yyleng] = yy_hold_char; \
+		yy_c_buf_p = yytext + n; \
+		yy_hold_char = *yy_c_buf_p; \
+		*yy_c_buf_p = '\0'; \
+		yyleng = n; \
+		} \
+	while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, yy_size_t n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+yy_size_t n;
+#endif
+	{
+	register yy_size_t i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+	}
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static yy_size_t yy_flex_strlen( yyconst char *s )
+#else
+static yy_size_t yy_flex_strlen( s )
+yyconst char *s;
+#endif
+	{
+	register yy_size_t n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+	}
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+	{
+	return (void *) malloc( size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+	{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+	{
+	free( ptr );
+	}
+
+#if YY_MAIN
+int main()
+	{
+	yylex();
+	return 0;
+	}
+#endif
+#line 105 "toc_scan.l"
+
