dep/libcue: Prefix functions to avoid name clash with glslang

This commit is contained in:
Connor McLaughlin 2020-07-04 13:47:51 +10:00
parent 1231f6dafe
commit 16411d7669
6 changed files with 606 additions and 314 deletions

View File

@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.3.2. */ /* A Bison parser, made by GNU Bison 3.4.1. */
/* Bison implementation for Yacc-like parsers in C /* Bison implementation for Yacc-like parsers in C
@ -48,7 +48,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "3.3.2" #define YYBISON_VERSION "3.4.1"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@ -62,11 +62,20 @@
/* Pull parsers. */ /* Pull parsers. */
#define YYPULL 1 #define YYPULL 1
/* Substitute the type names. */
#define YYSTYPE CUEPARSERSTYPE
/* Substitute the variable and function names. */
#define yyparse cueparserparse
#define yylex cueparserlex
#define yyerror cueparsererror
#define yydebug cueparserdebug
#define yynerrs cueparsernerrs
#define yylval cueparserlval
#define yychar cueparserchar
/* First part of user prologue. */ /* First part of user prologue. */
#line 1 "cue_parser.y" /* yacc.c:337 */ #line 1 "cue_parser.y"
/* /*
* Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen * Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen
@ -81,20 +90,20 @@
#include "cd.h" #include "cd.h"
#include "time.h" #include "time.h"
#ifdef YY_BUF_SIZE #ifdef CUEPARSER_BUF_SIZE
#undef YY_BUF_SIZE #undef CUEPARSER_BUF_SIZE
#endif #endif
#define YY_BUF_SIZE 16384 #define CUEPARSER_BUF_SIZE 16384
#define YYDEBUG 1 #define CUEPARSERDEBUG 1
char fnamebuf[PARSER_BUFFER]; char fnamebuf[PARSER_BUFFER];
/* debugging */ /* debugging */
//int yydebug = 1; //int cueparserdebug = 1;
extern int yylineno; extern int cueparserlineno;
extern FILE* yyin; extern FILE* cueparserin;
static Cd *cd = NULL; static Cd *cd = NULL;
static Track *track = NULL; static Track *track = NULL;
@ -106,21 +115,22 @@ static char *cur_filename = NULL; /* last file in the last track */
static char *new_filename = NULL; /* last file in this track */ static char *new_filename = NULL; /* last file in this track */
/* lexer interface */ /* lexer interface */
typedef struct yy_buffer_state* YY_BUFFER_STATE; typedef struct cueparser_buffer_state* CUEPARSER_BUFFER_STATE;
int yylex(void); int cueparserlex(void);
void yyerror(const char*); void cueparsererror(const char*);
YY_BUFFER_STATE yy_scan_string(const char*); CUEPARSER_BUFFER_STATE cueparser_scan_string(const char*);
YY_BUFFER_STATE yy_create_buffer(FILE*, int); CUEPARSER_BUFFER_STATE cueparser_create_buffer(FILE*, int);
void yy_switch_to_buffer(YY_BUFFER_STATE); void cueparser_switch_to_buffer(CUEPARSER_BUFFER_STATE);
void yy_delete_buffer(YY_BUFFER_STATE); void cueparser_delete_buffer(CUEPARSER_BUFFER_STATE);
/* parser interface */ /* parser interface */
int yyparse(void); int cueparserparse(void);
Cd *cue_parse_file(FILE *fp); Cd *cue_parse_file(FILE *fp);
Cd *cue_parse_string(const char*); Cd *cue_parse_string(const char*);
#line 124 "cue_parser.c" /* yacc.c:337 */ #line 133 "cue_parser.c"
# ifndef YY_NULLPTR # ifndef YY_NULLPTR
# if defined __cplusplus # if defined __cplusplus
# if 201103L <= __cplusplus # if 201103L <= __cplusplus
@ -141,22 +151,30 @@ Cd *cue_parse_string(const char*);
# define YYERROR_VERBOSE 0 # define YYERROR_VERBOSE 0
#endif #endif
/* In a future release of Bison, this section will be replaced /* Use api.header.include to #include this header
by #include "cue_parser.h". */ instead of duplicating it here. */
#ifndef YY_YY_CUE_PARSER_H_INCLUDED #ifndef YY_CUEPARSER_CUE_PARSER_H_INCLUDED
# define YY_YY_CUE_PARSER_H_INCLUDED # define YY_CUEPARSER_CUE_PARSER_H_INCLUDED
/* Debug traces. */ /* Debug traces. */
#ifndef YYDEBUG #ifndef CUEPARSERDEBUG
# define YYDEBUG 0 # if defined YYDEBUG
#endif
#if YYDEBUG #if YYDEBUG
extern int yydebug; # define CUEPARSERDEBUG 1
# else
# define CUEPARSERDEBUG 0
# endif
# else /* ! defined YYDEBUG */
# define CUEPARSERDEBUG 0
# endif /* ! defined YYDEBUG */
#endif /* ! defined CUEPARSERDEBUG */
#if CUEPARSERDEBUG
extern int cueparserdebug;
#endif #endif
/* Token type. */ /* Token type. */
#ifndef YYTOKENTYPE #ifndef CUEPARSERTOKENTYPE
# define YYTOKENTYPE # define CUEPARSERTOKENTYPE
enum yytokentype enum cueparsertokentype
{ {
NUMBER = 258, NUMBER = 258,
STRING = 259, STRING = 259,
@ -210,29 +228,28 @@ extern int yydebug;
#endif #endif
/* Value type. */ /* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined CUEPARSERSTYPE && ! defined CUEPARSERSTYPE_IS_DECLARED
union CUEPARSERSTYPE
union YYSTYPE
{ {
#line 57 "cue_parser.y" /* yacc.c:352 */ #line 58 "cue_parser.y"
long ival; long ival;
char *sval; char *sval;
#line 223 "cue_parser.c" /* yacc.c:352 */ #line 240 "cue_parser.c"
};
typedef union YYSTYPE YYSTYPE; };
# define YYSTYPE_IS_TRIVIAL 1 typedef union CUEPARSERSTYPE CUEPARSERSTYPE;
# define YYSTYPE_IS_DECLARED 1 # define CUEPARSERSTYPE_IS_TRIVIAL 1
# define CUEPARSERSTYPE_IS_DECLARED 1
#endif #endif
extern YYSTYPE yylval; extern CUEPARSERSTYPE cueparserlval;
int yyparse (void); int cueparserparse (void);
#endif /* !YY_YY_CUE_PARSER_H_INCLUDED */ #endif /* !YY_CUEPARSER_CUE_PARSER_H_INCLUDED */
@ -336,6 +353,8 @@ typedef short yytype_int16;
#endif #endif
#define YY_ASSERT(E) ((void) (0 && (E)))
#if ! defined yyoverflow || YYERROR_VERBOSE #if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */ /* The parser invokes alloca or malloc; define the necessary symbols. */
@ -406,7 +425,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
#if (! defined yyoverflow \ #if (! defined yyoverflow \
&& (! defined __cplusplus \ && (! defined __cplusplus \
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) || (defined CUEPARSERSTYPE_IS_TRIVIAL && CUEPARSERSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
@ -523,22 +542,22 @@ static const yytype_uint8 yytranslate[] =
45, 46, 47, 48, 49, 50 45, 46, 47, 48, 49, 50
}; };
#if YYDEBUG #if CUEPARSERDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 133, 133, 137, 144, 146, 150, 151, 152, 153, 0, 134, 134, 138, 146, 147, 151, 152, 153, 154,
154, 155, 159, 173, 174, 178, 182, 183, 184, 185, 155, 156, 160, 174, 175, 179, 183, 184, 185, 186,
186, 187, 191, 213, 219, 220, 221, 222, 223, 224, 187, 188, 192, 214, 220, 221, 222, 223, 224, 225,
225, 226, 230, 231, 235, 236, 237, 238, 239, 240, 226, 227, 231, 232, 236, 237, 238, 239, 240, 241,
263, 264, 265, 268, 270, 274, 275, 276, 277, 281, 264, 265, 266, 270, 271, 275, 276, 277, 278, 282,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
295, 296, 297, 301, 302, 306, 307, 311, 312, 313, 296, 297, 298, 302, 303, 307, 308, 312, 313, 314,
314, 315 315, 316
}; };
#endif #endif
#if YYDEBUG || YYERROR_VERBOSE || 0 #if CUEPARSERDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] = static const char *const yytname[] =
@ -758,7 +777,7 @@ static const yytype_uint8 yyr2[] =
/* Enable debugging if requested. */ /* Enable debugging if requested. */
#if YYDEBUG #if CUEPARSERDEBUG
# ifndef YYFPRINTF # ifndef YYFPRINTF
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
@ -879,12 +898,12 @@ do { \
/* Nonzero means print parse trace. It is left uninitialized so that /* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */ multiple parsers can coexist. */
int yydebug; int yydebug;
#else /* !YYDEBUG */ #else /* !CUEPARSERDEBUG */
# define YYDPRINTF(Args) # define YYDPRINTF(Args)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top) # define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule) # define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */ #endif /* !CUEPARSERDEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */ /* YYINITDEPTH -- initial size of the parser's stacks. */
@ -1237,6 +1256,8 @@ yynewstate:
| yynewstate -- set current state (the top of the stack) to yystate. | | yynewstate -- set current state (the top of the stack) to yystate. |
`--------------------------------------------------------------------*/ `--------------------------------------------------------------------*/
yysetstate: yysetstate:
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
*yyssp = (yytype_int16) yystate; *yyssp = (yytype_int16) yystate;
if (yyss + yystacksize - 1 <= yyssp) if (yyss + yystacksize - 1 <= yyssp)
@ -1299,8 +1320,6 @@ yysetstate:
} }
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL) if (yystate == YYFINAL)
YYACCEPT; YYACCEPT;
@ -1368,7 +1387,6 @@ yybackup:
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval; *++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END YY_IGNORE_MAYBE_UNINITIALIZED_END
goto yynewstate; goto yynewstate;
@ -1403,33 +1421,33 @@ yyreduce:
YY_REDUCE_PRINT (yyn); YY_REDUCE_PRINT (yyn);
switch (yyn) switch (yyn)
{ {
case 3: case 3:
#line 137 "cue_parser.y" /* yacc.c:1652 */ #line 138 "cue_parser.y"
{ {
cd = cd_init(); cd = cd_init();
cdtext = cd_get_cdtext(cd); cdtext = cd_get_cdtext(cd);
rem = cd_get_rem(cd); rem = cd_get_rem(cd);
} }
#line 1414 "cue_parser.c" /* yacc.c:1652 */ #line 1432 "cue_parser.c"
break; break;
case 6: case 6:
#line 150 "cue_parser.y" /* yacc.c:1652 */ #line 151 "cue_parser.y"
{ cd_set_catalog(cd, (yyvsp[-1].sval)); } { cd_set_catalog(cd, (yyvsp[-1].sval)); }
#line 1420 "cue_parser.c" /* yacc.c:1652 */ #line 1438 "cue_parser.c"
break; break;
case 7: case 7:
#line 151 "cue_parser.y" /* yacc.c:1652 */ #line 152 "cue_parser.y"
{ cd_set_cdtextfile(cd, (yyvsp[-1].sval)); } { cd_set_cdtextfile(cd, (yyvsp[-1].sval)); }
#line 1426 "cue_parser.c" /* yacc.c:1652 */ #line 1444 "cue_parser.c"
break; break;
case 12: case 12:
#line 159 "cue_parser.y" /* yacc.c:1652 */ #line 160 "cue_parser.y"
{ {
if (NULL != new_filename) { if (NULL != new_filename) {
yyerror("too many files specified\n"); cueparsererror("too many files specified\n");
} }
if (track && track_get_index(track, 1) == -1) { if (track && track_get_index(track, 1) == -1) {
track_set_filename (track, (yyvsp[-2].sval)); track_set_filename (track, (yyvsp[-2].sval));
@ -1438,11 +1456,11 @@ yyreduce:
new_filename[sizeof(fnamebuf) - 1] = '\0'; new_filename[sizeof(fnamebuf) - 1] = '\0';
} }
} }
#line 1442 "cue_parser.c" /* yacc.c:1652 */ #line 1460 "cue_parser.c"
break; break;
case 22: case 22:
#line 191 "cue_parser.y" /* yacc.c:1652 */ #line 192 "cue_parser.y"
{ {
/* save previous track, to later set length */ /* save previous track, to later set length */
prev_track = track; prev_track = track;
@ -1456,37 +1474,37 @@ yyreduce:
prev_filename = cur_filename; prev_filename = cur_filename;
if (NULL == prev_filename) if (NULL == prev_filename)
yyerror("no file specified for track"); cueparsererror("no file specified for track");
else else
track_set_filename(track, prev_filename); track_set_filename(track, prev_filename);
new_filename = NULL; new_filename = NULL;
} }
#line 1466 "cue_parser.c" /* yacc.c:1652 */ #line 1484 "cue_parser.c"
break; break;
case 23: case 23:
#line 213 "cue_parser.y" /* yacc.c:1652 */ #line 214 "cue_parser.y"
{ {
track_set_mode(track, (yyvsp[-1].ival)); track_set_mode(track, (yyvsp[-1].ival));
} }
#line 1474 "cue_parser.c" /* yacc.c:1652 */ #line 1492 "cue_parser.c"
break; break;
case 37: case 37:
#line 238 "cue_parser.y" /* yacc.c:1652 */ #line 239 "cue_parser.y"
{ track_set_isrc(track, (yyvsp[-1].sval)); } { track_set_isrc(track, (yyvsp[-1].sval)); }
#line 1480 "cue_parser.c" /* yacc.c:1652 */ #line 1498 "cue_parser.c"
break; break;
case 38: case 38:
#line 239 "cue_parser.y" /* yacc.c:1652 */ #line 240 "cue_parser.y"
{ track_set_zero_pre(track, (yyvsp[-1].ival)); } { track_set_zero_pre(track, (yyvsp[-1].ival)); }
#line 1486 "cue_parser.c" /* yacc.c:1652 */ #line 1504 "cue_parser.c"
break; break;
case 39: case 39:
#line 240 "cue_parser.y" /* yacc.c:1652 */ #line 241 "cue_parser.y"
{ {
long prev_length; long prev_length;
@ -1510,47 +1528,48 @@ yyreduce:
track_set_index (track, (yyvsp[-2].ival), (yyvsp[-1].ival)); track_set_index (track, (yyvsp[-2].ival), (yyvsp[-1].ival));
} }
#line 1514 "cue_parser.c" /* yacc.c:1652 */ #line 1532 "cue_parser.c"
break; break;
case 40: case 40:
#line 263 "cue_parser.y" /* yacc.c:1652 */ #line 264 "cue_parser.y"
{ track_set_zero_post(track, (yyvsp[-1].ival)); } { track_set_zero_post(track, (yyvsp[-1].ival)); }
#line 1520 "cue_parser.c" /* yacc.c:1652 */ #line 1538 "cue_parser.c"
break; break;
case 44: case 44:
#line 270 "cue_parser.y" /* yacc.c:1652 */ #line 271 "cue_parser.y"
{ track_set_flag(track, (yyvsp[0].ival)); } { track_set_flag(track, (yyvsp[0].ival)); }
#line 1526 "cue_parser.c" /* yacc.c:1652 */ #line 1544 "cue_parser.c"
break; break;
case 49: case 49:
#line 281 "cue_parser.y" /* yacc.c:1652 */ #line 282 "cue_parser.y"
{ cdtext_set ((yyvsp[-2].ival), (yyvsp[-1].sval), cdtext); } { cdtext_set ((yyvsp[-2].ival), (yyvsp[-1].sval), cdtext); }
#line 1532 "cue_parser.c" /* yacc.c:1652 */ #line 1550 "cue_parser.c"
break; break;
case 64: case 64:
#line 302 "cue_parser.y" /* yacc.c:1652 */ #line 303 "cue_parser.y"
{ (yyval.ival) = time_msf_to_frame((yyvsp[-4].ival), (yyvsp[-2].ival), (yyvsp[0].ival)); } { (yyval.ival) = time_msf_to_frame((yyvsp[-4].ival), (yyvsp[-2].ival), (yyvsp[0].ival)); }
#line 1538 "cue_parser.c" /* yacc.c:1652 */ #line 1556 "cue_parser.c"
break; break;
case 65: case 65:
#line 306 "cue_parser.y" /* yacc.c:1652 */ #line 307 "cue_parser.y"
{ rem_set((yyvsp[-2].ival), (yyvsp[-1].sval), rem); } { rem_set((yyvsp[-2].ival), (yyvsp[-1].sval), rem); }
#line 1544 "cue_parser.c" /* yacc.c:1652 */ #line 1562 "cue_parser.c"
break; break;
case 66: case 66:
#line 307 "cue_parser.y" /* yacc.c:1652 */ #line 308 "cue_parser.y"
{ cdtext_set((yyvsp[-2].ival), (yyvsp[-1].sval), cdtext); } { cdtext_set((yyvsp[-2].ival), (yyvsp[-1].sval), cdtext); }
#line 1550 "cue_parser.c" /* yacc.c:1652 */ #line 1568 "cue_parser.c"
break; break;
#line 1554 "cue_parser.c" /* yacc.c:1652 */ #line 1572 "cue_parser.c"
default: break; default: break;
} }
/* User semantic actions sometimes alter yychar, and that requires /* User semantic actions sometimes alter yychar, and that requires
@ -1781,14 +1800,14 @@ yyreturn:
#endif #endif
return yyresult; return yyresult;
} }
#line 317 "cue_parser.y" /* yacc.c:1918 */ #line 318 "cue_parser.y"
/* lexer interface */ /* lexer interface */
void yyerror (const char *s) void cueparsererror (const char *s)
{ {
fprintf(stderr, "%d: %s\n", yylineno, s); fprintf(stderr, "%d: %s\n", cueparserlineno, s);
} }
static void reset_static_vars() static void reset_static_vars()
@ -1805,20 +1824,20 @@ static void reset_static_vars()
Cd *cue_parse_file(FILE *fp) Cd *cue_parse_file(FILE *fp)
{ {
YY_BUFFER_STATE buffer = NULL; CUEPARSER_BUFFER_STATE buffer = NULL;
yyin = fp; cueparserin = fp;
buffer = yy_create_buffer(yyin, YY_BUF_SIZE); buffer = cueparser_create_buffer(cueparserin, CUEPARSER_BUF_SIZE);
yy_switch_to_buffer(buffer); cueparser_switch_to_buffer(buffer);
Cd *ret_cd = NULL; Cd *ret_cd = NULL;
if (0 == yyparse()) ret_cd = cd; if (0 == cueparserparse()) ret_cd = cd;
else ret_cd = NULL; else ret_cd = NULL;
yy_delete_buffer(buffer); cueparser_delete_buffer(buffer);
reset_static_vars(); reset_static_vars();
return ret_cd; return ret_cd;
@ -1826,16 +1845,16 @@ Cd *cue_parse_file(FILE *fp)
Cd *cue_parse_string(const char* string) Cd *cue_parse_string(const char* string)
{ {
YY_BUFFER_STATE buffer = NULL; CUEPARSER_BUFFER_STATE buffer = NULL;
buffer = yy_scan_string(string); buffer = cueparser_scan_string(string);
Cd *ret_cd = NULL; Cd *ret_cd = NULL;
if (0 == yyparse()) ret_cd = cd; if (0 == cueparserparse()) ret_cd = cd;
else ret_cd = NULL; else ret_cd = NULL;
yy_delete_buffer(buffer); cueparser_delete_buffer(buffer);
reset_static_vars(); reset_static_vars();
return ret_cd; return ret_cd;

View File

@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.3.2. */ /* A Bison parser, made by GNU Bison 3.4.1. */
/* Bison interface for Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C
@ -34,20 +34,28 @@
/* Undocumented macros, especially those whose name start with YY_, /* Undocumented macros, especially those whose name start with YY_,
are private implementation details. Do not rely on them. */ are private implementation details. Do not rely on them. */
#ifndef YY_YY_CUE_PARSER_H_INCLUDED #ifndef YY_CUEPARSER_CUE_PARSER_H_INCLUDED
# define YY_YY_CUE_PARSER_H_INCLUDED # define YY_CUEPARSER_CUE_PARSER_H_INCLUDED
/* Debug traces. */ /* Debug traces. */
#ifndef YYDEBUG #ifndef CUEPARSERDEBUG
# define YYDEBUG 0 # if defined YYDEBUG
#endif
#if YYDEBUG #if YYDEBUG
extern int yydebug; # define CUEPARSERDEBUG 1
# else
# define CUEPARSERDEBUG 0
# endif
# else /* ! defined YYDEBUG */
# define CUEPARSERDEBUG 0
# endif /* ! defined YYDEBUG */
#endif /* ! defined CUEPARSERDEBUG */
#if CUEPARSERDEBUG
extern int cueparserdebug;
#endif #endif
/* Token type. */ /* Token type. */
#ifndef YYTOKENTYPE #ifndef CUEPARSERTOKENTYPE
# define YYTOKENTYPE # define CUEPARSERTOKENTYPE
enum yytokentype enum cueparsertokentype
{ {
NUMBER = 258, NUMBER = 258,
STRING = 259, STRING = 259,
@ -101,26 +109,25 @@ extern int yydebug;
#endif #endif
/* Value type. */ /* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined CUEPARSERSTYPE && ! defined CUEPARSERSTYPE_IS_DECLARED
union CUEPARSERSTYPE
union YYSTYPE
{ {
#line 57 "cue_parser.y" /* yacc.c:1921 */ #line 58 "cue_parser.y"
long ival; long ival;
char *sval; char *sval;
#line 114 "cue_parser.h" /* yacc.c:1921 */ #line 121 "cue_parser.h"
};
typedef union YYSTYPE YYSTYPE; };
# define YYSTYPE_IS_TRIVIAL 1 typedef union CUEPARSERSTYPE CUEPARSERSTYPE;
# define YYSTYPE_IS_DECLARED 1 # define CUEPARSERSTYPE_IS_TRIVIAL 1
# define CUEPARSERSTYPE_IS_DECLARED 1
#endif #endif
extern YYSTYPE yylval; extern CUEPARSERSTYPE cueparserlval;
int yyparse (void); int cueparserparse (void);
#endif /* !YY_YY_CUE_PARSER_H_INCLUDED */ #endif /* !YY_CUEPARSER_CUE_PARSER_H_INCLUDED */

View File

@ -12,20 +12,20 @@
#include "cd.h" #include "cd.h"
#include "time.h" #include "time.h"
#ifdef YY_BUF_SIZE #ifdef CUEPARSER_BUF_SIZE
#undef YY_BUF_SIZE #undef CUEPARSER_BUF_SIZE
#endif #endif
#define YY_BUF_SIZE 16384 #define CUEPARSER_BUF_SIZE 16384
#define YYDEBUG 1 #define CUEPARSERDEBUG 1
char fnamebuf[PARSER_BUFFER]; char fnamebuf[PARSER_BUFFER];
/* debugging */ /* debugging */
//int yydebug = 1; //int cueparserdebug = 1;
extern int yylineno; extern int cueparserlineno;
extern FILE* yyin; extern FILE* cueparserin;
static Cd *cd = NULL; static Cd *cd = NULL;
static Track *track = NULL; static Track *track = NULL;
@ -37,22 +37,23 @@ static char *cur_filename = NULL; /* last file in the last track */
static char *new_filename = NULL; /* last file in this track */ static char *new_filename = NULL; /* last file in this track */
/* lexer interface */ /* lexer interface */
typedef struct yy_buffer_state* YY_BUFFER_STATE; typedef struct cueparser_buffer_state* CUEPARSER_BUFFER_STATE;
int yylex(void); int cueparserlex(void);
void yyerror(const char*); void cueparsererror(const char*);
YY_BUFFER_STATE yy_scan_string(const char*); CUEPARSER_BUFFER_STATE cueparser_scan_string(const char*);
YY_BUFFER_STATE yy_create_buffer(FILE*, int); CUEPARSER_BUFFER_STATE cueparser_create_buffer(FILE*, int);
void yy_switch_to_buffer(YY_BUFFER_STATE); void cueparser_switch_to_buffer(CUEPARSER_BUFFER_STATE);
void yy_delete_buffer(YY_BUFFER_STATE); void cueparser_delete_buffer(CUEPARSER_BUFFER_STATE);
/* parser interface */ /* parser interface */
int yyparse(void); int cueparserparse(void);
Cd *cue_parse_file(FILE *fp); Cd *cue_parse_file(FILE *fp);
Cd *cue_parse_string(const char*); Cd *cue_parse_string(const char*);
%} %}
%start cuefile %start cuefile
%define api.prefix {cueparser}
%union { %union {
long ival; long ival;
@ -158,7 +159,7 @@ global_statement
track_data track_data
: FFILE STRING file_format '\n' { : FFILE STRING file_format '\n' {
if (NULL != new_filename) { if (NULL != new_filename) {
yyerror("too many files specified\n"); cueparsererror("too many files specified\n");
} }
if (track && track_get_index(track, 1) == -1) { if (track && track_get_index(track, 1) == -1) {
track_set_filename (track, $2); track_set_filename (track, $2);
@ -201,7 +202,7 @@ new_track
prev_filename = cur_filename; prev_filename = cur_filename;
if (NULL == prev_filename) if (NULL == prev_filename)
yyerror("no file specified for track"); cueparsererror("no file specified for track");
else else
track_set_filename(track, prev_filename); track_set_filename(track, prev_filename);
@ -318,9 +319,9 @@ rem_item
/* lexer interface */ /* lexer interface */
void yyerror (const char *s) void cueparsererror (const char *s)
{ {
fprintf(stderr, "%d: %s\n", yylineno, s); fprintf(stderr, "%d: %s\n", cueparserlineno, s);
} }
static void reset_static_vars() static void reset_static_vars()
@ -337,20 +338,20 @@ static void reset_static_vars()
Cd *cue_parse_file(FILE *fp) Cd *cue_parse_file(FILE *fp)
{ {
YY_BUFFER_STATE buffer = NULL; CUEPARSER_BUFFER_STATE buffer = NULL;
yyin = fp; cueparserin = fp;
buffer = yy_create_buffer(yyin, YY_BUF_SIZE); buffer = cueparser_create_buffer(cueparserin, CUEPARSER_BUF_SIZE);
yy_switch_to_buffer(buffer); cueparser_switch_to_buffer(buffer);
Cd *ret_cd = NULL; Cd *ret_cd = NULL;
if (0 == yyparse()) ret_cd = cd; if (0 == cueparserparse()) ret_cd = cd;
else ret_cd = NULL; else ret_cd = NULL;
yy_delete_buffer(buffer); cueparser_delete_buffer(buffer);
reset_static_vars(); reset_static_vars();
return ret_cd; return ret_cd;
@ -358,16 +359,16 @@ Cd *cue_parse_file(FILE *fp)
Cd *cue_parse_string(const char* string) Cd *cue_parse_string(const char* string)
{ {
YY_BUFFER_STATE buffer = NULL; CUEPARSER_BUFFER_STATE buffer = NULL;
buffer = yy_scan_string(string); buffer = cueparser_scan_string(string);
Cd *ret_cd = NULL; Cd *ret_cd = NULL;
if (0 == yyparse()) ret_cd = cd; if (0 == cueparserparse()) ret_cd = cd;
else ret_cd = NULL; else ret_cd = NULL;
yy_delete_buffer(buffer); cueparser_delete_buffer(buffer);
reset_static_vars(); reset_static_vars();
return ret_cd; return ret_cd;

View File

@ -6,6 +6,31 @@
/* A lexical scanner generated by flex */ /* A lexical scanner generated by flex */
#define yy_create_buffer cueparser_create_buffer
#define yy_delete_buffer cueparser_delete_buffer
#define yy_scan_buffer cueparser_scan_buffer
#define yy_scan_string cueparser_scan_string
#define yy_scan_bytes cueparser_scan_bytes
#define yy_init_buffer cueparser_init_buffer
#define yy_flush_buffer cueparser_flush_buffer
#define yy_load_buffer_state cueparser_load_buffer_state
#define yy_switch_to_buffer cueparser_switch_to_buffer
#define yypush_buffer_state cueparserpush_buffer_state
#define yypop_buffer_state cueparserpop_buffer_state
#define yyensure_buffer_stack cueparserensure_buffer_stack
#define yy_flex_debug cueparser_flex_debug
#define yyin cueparserin
#define yyleng cueparserleng
#define yylex cueparserlex
#define yylineno cueparserlineno
#define yyout cueparserout
#define yyrestart cueparserrestart
#define yytext cueparsertext
#define yywrap cueparserwrap
#define yyalloc cueparseralloc
#define yyrealloc cueparserrealloc
#define yyfree cueparserfree
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_MINOR_VERSION 6
@ -14,6 +39,240 @@
#define FLEX_BETA #define FLEX_BETA
#endif #endif
#ifdef yy_create_buffer
#define cueparser_create_buffer_ALREADY_DEFINED
#else
#define yy_create_buffer cueparser_create_buffer
#endif
#ifdef yy_delete_buffer
#define cueparser_delete_buffer_ALREADY_DEFINED
#else
#define yy_delete_buffer cueparser_delete_buffer
#endif
#ifdef yy_scan_buffer
#define cueparser_scan_buffer_ALREADY_DEFINED
#else
#define yy_scan_buffer cueparser_scan_buffer
#endif
#ifdef yy_scan_string
#define cueparser_scan_string_ALREADY_DEFINED
#else
#define yy_scan_string cueparser_scan_string
#endif
#ifdef yy_scan_bytes
#define cueparser_scan_bytes_ALREADY_DEFINED
#else
#define yy_scan_bytes cueparser_scan_bytes
#endif
#ifdef yy_init_buffer
#define cueparser_init_buffer_ALREADY_DEFINED
#else
#define yy_init_buffer cueparser_init_buffer
#endif
#ifdef yy_flush_buffer
#define cueparser_flush_buffer_ALREADY_DEFINED
#else
#define yy_flush_buffer cueparser_flush_buffer
#endif
#ifdef yy_load_buffer_state
#define cueparser_load_buffer_state_ALREADY_DEFINED
#else
#define yy_load_buffer_state cueparser_load_buffer_state
#endif
#ifdef yy_switch_to_buffer
#define cueparser_switch_to_buffer_ALREADY_DEFINED
#else
#define yy_switch_to_buffer cueparser_switch_to_buffer
#endif
#ifdef yypush_buffer_state
#define cueparserpush_buffer_state_ALREADY_DEFINED
#else
#define yypush_buffer_state cueparserpush_buffer_state
#endif
#ifdef yypop_buffer_state
#define cueparserpop_buffer_state_ALREADY_DEFINED
#else
#define yypop_buffer_state cueparserpop_buffer_state
#endif
#ifdef yyensure_buffer_stack
#define cueparserensure_buffer_stack_ALREADY_DEFINED
#else
#define yyensure_buffer_stack cueparserensure_buffer_stack
#endif
#ifdef yylex
#define cueparserlex_ALREADY_DEFINED
#else
#define yylex cueparserlex
#endif
#ifdef yyrestart
#define cueparserrestart_ALREADY_DEFINED
#else
#define yyrestart cueparserrestart
#endif
#ifdef yylex_init
#define cueparserlex_init_ALREADY_DEFINED
#else
#define yylex_init cueparserlex_init
#endif
#ifdef yylex_init_extra
#define cueparserlex_init_extra_ALREADY_DEFINED
#else
#define yylex_init_extra cueparserlex_init_extra
#endif
#ifdef yylex_destroy
#define cueparserlex_destroy_ALREADY_DEFINED
#else
#define yylex_destroy cueparserlex_destroy
#endif
#ifdef yyget_debug
#define cueparserget_debug_ALREADY_DEFINED
#else
#define yyget_debug cueparserget_debug
#endif
#ifdef yyset_debug
#define cueparserset_debug_ALREADY_DEFINED
#else
#define yyset_debug cueparserset_debug
#endif
#ifdef yyget_extra
#define cueparserget_extra_ALREADY_DEFINED
#else
#define yyget_extra cueparserget_extra
#endif
#ifdef yyset_extra
#define cueparserset_extra_ALREADY_DEFINED
#else
#define yyset_extra cueparserset_extra
#endif
#ifdef yyget_in
#define cueparserget_in_ALREADY_DEFINED
#else
#define yyget_in cueparserget_in
#endif
#ifdef yyset_in
#define cueparserset_in_ALREADY_DEFINED
#else
#define yyset_in cueparserset_in
#endif
#ifdef yyget_out
#define cueparserget_out_ALREADY_DEFINED
#else
#define yyget_out cueparserget_out
#endif
#ifdef yyset_out
#define cueparserset_out_ALREADY_DEFINED
#else
#define yyset_out cueparserset_out
#endif
#ifdef yyget_leng
#define cueparserget_leng_ALREADY_DEFINED
#else
#define yyget_leng cueparserget_leng
#endif
#ifdef yyget_text
#define cueparserget_text_ALREADY_DEFINED
#else
#define yyget_text cueparserget_text
#endif
#ifdef yyget_lineno
#define cueparserget_lineno_ALREADY_DEFINED
#else
#define yyget_lineno cueparserget_lineno
#endif
#ifdef yyset_lineno
#define cueparserset_lineno_ALREADY_DEFINED
#else
#define yyset_lineno cueparserset_lineno
#endif
#ifdef yywrap
#define cueparserwrap_ALREADY_DEFINED
#else
#define yywrap cueparserwrap
#endif
#ifdef yyalloc
#define cueparseralloc_ALREADY_DEFINED
#else
#define yyalloc cueparseralloc
#endif
#ifdef yyrealloc
#define cueparserrealloc_ALREADY_DEFINED
#else
#define yyrealloc cueparserrealloc
#endif
#ifdef yyfree
#define cueparserfree_ALREADY_DEFINED
#else
#define yyfree cueparserfree
#endif
#ifdef yytext
#define cueparsertext_ALREADY_DEFINED
#else
#define yytext cueparsertext
#endif
#ifdef yyleng
#define cueparserleng_ALREADY_DEFINED
#else
#define yyleng cueparserleng
#endif
#ifdef yyin
#define cueparserin_ALREADY_DEFINED
#else
#define yyin cueparserin
#endif
#ifdef yyout
#define cueparserout_ALREADY_DEFINED
#else
#define yyout cueparserout
#endif
#ifdef yy_flex_debug
#define cueparser_flex_debug_ALREADY_DEFINED
#else
#define yy_flex_debug cueparser_flex_debug
#endif
#ifdef yylineno
#define cueparserlineno_ALREADY_DEFINED
#else
#define yylineno cueparserlineno
#endif
/* First, we deal with platform-specific or compiler-specific issues. */ /* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */ /* begin standard C headers. */
@ -343,7 +602,7 @@ void yyfree ( void * );
/* Begin user sect3 */ /* Begin user sect3 */
#define yywrap() (/*CONSTCOND*/1) #define cueparserwrap() (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP #define YY_SKIP_YYWRAP
typedef flex_uint8_t YY_CHAR; typedef flex_uint8_t YY_CHAR;
@ -789,13 +1048,13 @@ char *yytext;
#include "cd.h" #include "cd.h"
#include "cue_parser.h" #include "cue_parser.h"
char yy_buffer[PARSER_BUFFER]; char cueparser_buffer[PARSER_BUFFER];
int yylex(void); int cueparserlex(void);
#line 796 "cue_scanner.c" #line 1055 "cue_scanner.c"
#define YY_NO_INPUT 1 #define YY_NO_INPUT 1
#line 799 "cue_scanner.c" #line 1058 "cue_scanner.c"
#define INITIAL 0 #define INITIAL 0
#define NAME 1 #define NAME 1
@ -1009,10 +1268,10 @@ YY_DECL
} }
{ {
#line 32 "cue_scanner.l" #line 33 "cue_scanner.l"
#line 1016 "cue_scanner.c" #line 1275 "cue_scanner.c"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{ {
@ -1082,351 +1341,351 @@ do_action: /* This label is used only to access EOF actions. */
case 1: case 1:
/* rule 1 can match eol */ /* rule 1 can match eol */
#line 35 "cue_scanner.l" #line 36 "cue_scanner.l"
case 2: case 2:
/* rule 2 can match eol */ /* rule 2 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 35 "cue_scanner.l" #line 36 "cue_scanner.l"
{ {
yylval.sval = strncpy( yy_buffer, cueparserlval.sval = strncpy( cueparser_buffer,
++yytext, ++yytext,
(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)); (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng));
yylval.sval[(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng) - 2] = '\0'; cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng) - 2] = '\0';
BEGIN(INITIAL); BEGIN(INITIAL);
return STRING; return STRING;
} }
YY_BREAK YY_BREAK
case 3: case 3:
YY_RULE_SETUP YY_RULE_SETUP
#line 44 "cue_scanner.l" #line 45 "cue_scanner.l"
{ {
yylval.sval = strncpy( yy_buffer, cueparserlval.sval = strncpy( cueparser_buffer,
yytext, yytext,
(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)); (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng));
yylval.sval[(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)] = '\0'; cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)] = '\0';
BEGIN(INITIAL); BEGIN(INITIAL);
return STRING; return STRING;
} }
YY_BREAK YY_BREAK
case 4: case 4:
YY_RULE_SETUP YY_RULE_SETUP
#line 53 "cue_scanner.l" #line 54 "cue_scanner.l"
{ BEGIN(NAME); return CATALOG; } { BEGIN(NAME); return CATALOG; }
YY_BREAK YY_BREAK
case 5: case 5:
YY_RULE_SETUP YY_RULE_SETUP
#line 54 "cue_scanner.l" #line 55 "cue_scanner.l"
{ BEGIN(NAME); return CDTEXTFILE; } { BEGIN(NAME); return CDTEXTFILE; }
YY_BREAK YY_BREAK
case 6: case 6:
YY_RULE_SETUP YY_RULE_SETUP
#line 56 "cue_scanner.l" #line 57 "cue_scanner.l"
{ BEGIN(NAME); return FFILE; } { BEGIN(NAME); return FFILE; }
YY_BREAK YY_BREAK
case 7: case 7:
YY_RULE_SETUP YY_RULE_SETUP
#line 57 "cue_scanner.l" #line 58 "cue_scanner.l"
{ return BINARY; } { return BINARY; }
YY_BREAK YY_BREAK
case 8: case 8:
YY_RULE_SETUP YY_RULE_SETUP
#line 58 "cue_scanner.l" #line 59 "cue_scanner.l"
{ return MOTOROLA; } { return MOTOROLA; }
YY_BREAK YY_BREAK
case 9: case 9:
YY_RULE_SETUP YY_RULE_SETUP
#line 59 "cue_scanner.l" #line 60 "cue_scanner.l"
{ return AIFF; } { return AIFF; }
YY_BREAK YY_BREAK
case 10: case 10:
YY_RULE_SETUP YY_RULE_SETUP
#line 60 "cue_scanner.l" #line 61 "cue_scanner.l"
{ return WAVE; } { return WAVE; }
YY_BREAK YY_BREAK
case 11: case 11:
YY_RULE_SETUP YY_RULE_SETUP
#line 61 "cue_scanner.l" #line 62 "cue_scanner.l"
{ return MP3; } { return MP3; }
YY_BREAK YY_BREAK
case 12: case 12:
YY_RULE_SETUP YY_RULE_SETUP
#line 62 "cue_scanner.l" #line 63 "cue_scanner.l"
{ return FLAC; } { return FLAC; }
YY_BREAK YY_BREAK
case 13: case 13:
YY_RULE_SETUP YY_RULE_SETUP
#line 64 "cue_scanner.l" #line 65 "cue_scanner.l"
{ return TRACK; } { return TRACK; }
YY_BREAK YY_BREAK
case 14: case 14:
YY_RULE_SETUP YY_RULE_SETUP
#line 65 "cue_scanner.l" #line 66 "cue_scanner.l"
{ yylval.ival = MODE_AUDIO; return AUDIO; } { cueparserlval.ival = MODE_AUDIO; return AUDIO; }
YY_BREAK YY_BREAK
case 15: case 15:
YY_RULE_SETUP YY_RULE_SETUP
#line 66 "cue_scanner.l" #line 67 "cue_scanner.l"
{ yylval.ival = MODE_MODE1; return MODE1_2048; } { cueparserlval.ival = MODE_MODE1; return MODE1_2048; }
YY_BREAK YY_BREAK
case 16: case 16:
YY_RULE_SETUP YY_RULE_SETUP
#line 67 "cue_scanner.l" #line 68 "cue_scanner.l"
{ yylval.ival = MODE_MODE1_RAW; return MODE1_2352; } { cueparserlval.ival = MODE_MODE1_RAW; return MODE1_2352; }
YY_BREAK YY_BREAK
case 17: case 17:
YY_RULE_SETUP YY_RULE_SETUP
#line 68 "cue_scanner.l" #line 69 "cue_scanner.l"
{ yylval.ival = MODE_MODE2; return MODE2_2336; } { cueparserlval.ival = MODE_MODE2; return MODE2_2336; }
YY_BREAK YY_BREAK
case 18: case 18:
YY_RULE_SETUP YY_RULE_SETUP
#line 69 "cue_scanner.l" #line 70 "cue_scanner.l"
{ yylval.ival = MODE_MODE2_FORM1; return MODE2_2048; } { cueparserlval.ival = MODE_MODE2_FORM1; return MODE2_2048; }
YY_BREAK YY_BREAK
case 19: case 19:
YY_RULE_SETUP YY_RULE_SETUP
#line 70 "cue_scanner.l" #line 71 "cue_scanner.l"
{ yylval.ival = MODE_MODE2_FORM2; return MODE2_2342; } { cueparserlval.ival = MODE_MODE2_FORM2; return MODE2_2342; }
YY_BREAK YY_BREAK
case 20: case 20:
YY_RULE_SETUP YY_RULE_SETUP
#line 71 "cue_scanner.l" #line 72 "cue_scanner.l"
{ yylval.ival = MODE_MODE2_FORM_MIX; return MODE2_2332; } { cueparserlval.ival = MODE_MODE2_FORM_MIX; return MODE2_2332; }
YY_BREAK YY_BREAK
case 21: case 21:
YY_RULE_SETUP YY_RULE_SETUP
#line 72 "cue_scanner.l" #line 73 "cue_scanner.l"
{ yylval.ival = MODE_MODE2_RAW; return MODE2_2352; } { cueparserlval.ival = MODE_MODE2_RAW; return MODE2_2352; }
YY_BREAK YY_BREAK
case 22: case 22:
YY_RULE_SETUP YY_RULE_SETUP
#line 74 "cue_scanner.l" #line 75 "cue_scanner.l"
{ return FLAGS; } { return FLAGS; }
YY_BREAK YY_BREAK
case 23: case 23:
YY_RULE_SETUP YY_RULE_SETUP
#line 75 "cue_scanner.l" #line 76 "cue_scanner.l"
{ yylval.ival = FLAG_PRE_EMPHASIS; return PRE; } { cueparserlval.ival = FLAG_PRE_EMPHASIS; return PRE; }
YY_BREAK YY_BREAK
case 24: case 24:
YY_RULE_SETUP YY_RULE_SETUP
#line 76 "cue_scanner.l" #line 77 "cue_scanner.l"
{ yylval.ival = FLAG_COPY_PERMITTED; return DCP; } { cueparserlval.ival = FLAG_COPY_PERMITTED; return DCP; }
YY_BREAK YY_BREAK
case 25: case 25:
YY_RULE_SETUP YY_RULE_SETUP
#line 77 "cue_scanner.l" #line 78 "cue_scanner.l"
{ yylval.ival = FLAG_FOUR_CHANNEL; return FOUR_CH; } { cueparserlval.ival = FLAG_FOUR_CHANNEL; return FOUR_CH; }
YY_BREAK YY_BREAK
case 26: case 26:
YY_RULE_SETUP YY_RULE_SETUP
#line 78 "cue_scanner.l" #line 79 "cue_scanner.l"
{ yylval.ival = FLAG_SCMS; return SCMS; } { cueparserlval.ival = FLAG_SCMS; return SCMS; }
YY_BREAK YY_BREAK
case 27: case 27:
YY_RULE_SETUP YY_RULE_SETUP
#line 80 "cue_scanner.l" #line 81 "cue_scanner.l"
{ return PREGAP; } { return PREGAP; }
YY_BREAK YY_BREAK
case 28: case 28:
YY_RULE_SETUP YY_RULE_SETUP
#line 81 "cue_scanner.l" #line 82 "cue_scanner.l"
{ return INDEX; } { return INDEX; }
YY_BREAK YY_BREAK
case 29: case 29:
YY_RULE_SETUP YY_RULE_SETUP
#line 82 "cue_scanner.l" #line 83 "cue_scanner.l"
{ return POSTGAP; } { return POSTGAP; }
YY_BREAK YY_BREAK
case 30: case 30:
YY_RULE_SETUP YY_RULE_SETUP
#line 84 "cue_scanner.l" #line 85 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_TITLE; return TITLE; } { BEGIN(NAME); cueparserlval.ival = PTI_TITLE; return TITLE; }
YY_BREAK YY_BREAK
case 31: case 31:
YY_RULE_SETUP YY_RULE_SETUP
#line 85 "cue_scanner.l" #line 86 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_PERFORMER; return PERFORMER; } { BEGIN(NAME); cueparserlval.ival = PTI_PERFORMER; return PERFORMER; }
YY_BREAK YY_BREAK
case 32: case 32:
YY_RULE_SETUP YY_RULE_SETUP
#line 86 "cue_scanner.l" #line 87 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_SONGWRITER; return SONGWRITER; } { BEGIN(NAME); cueparserlval.ival = PTI_SONGWRITER; return SONGWRITER; }
YY_BREAK YY_BREAK
case 33: case 33:
YY_RULE_SETUP YY_RULE_SETUP
#line 87 "cue_scanner.l" #line 88 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_COMPOSER; return COMPOSER; } { BEGIN(NAME); cueparserlval.ival = PTI_COMPOSER; return COMPOSER; }
YY_BREAK YY_BREAK
case 34: case 34:
YY_RULE_SETUP YY_RULE_SETUP
#line 88 "cue_scanner.l" #line 89 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_ARRANGER; return ARRANGER; } { BEGIN(NAME); cueparserlval.ival = PTI_ARRANGER; return ARRANGER; }
YY_BREAK YY_BREAK
case 35: case 35:
YY_RULE_SETUP YY_RULE_SETUP
#line 89 "cue_scanner.l" #line 90 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_MESSAGE; return MESSAGE; } { BEGIN(NAME); cueparserlval.ival = PTI_MESSAGE; return MESSAGE; }
YY_BREAK YY_BREAK
case 36: case 36:
YY_RULE_SETUP YY_RULE_SETUP
#line 90 "cue_scanner.l" #line 91 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_DISC_ID; return DISC_ID; } { BEGIN(NAME); cueparserlval.ival = PTI_DISC_ID; return DISC_ID; }
YY_BREAK YY_BREAK
case 37: case 37:
YY_RULE_SETUP YY_RULE_SETUP
#line 91 "cue_scanner.l" #line 92 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_GENRE; return GENRE; } { BEGIN(NAME); cueparserlval.ival = PTI_GENRE; return GENRE; }
YY_BREAK YY_BREAK
case 38: case 38:
YY_RULE_SETUP YY_RULE_SETUP
#line 92 "cue_scanner.l" #line 93 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_TOC_INFO1; return TOC_INFO1; } { BEGIN(NAME); cueparserlval.ival = PTI_TOC_INFO1; return TOC_INFO1; }
YY_BREAK YY_BREAK
case 39: case 39:
YY_RULE_SETUP YY_RULE_SETUP
#line 93 "cue_scanner.l" #line 94 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_TOC_INFO2; return TOC_INFO2; } { BEGIN(NAME); cueparserlval.ival = PTI_TOC_INFO2; return TOC_INFO2; }
YY_BREAK YY_BREAK
case 40: case 40:
YY_RULE_SETUP YY_RULE_SETUP
#line 94 "cue_scanner.l" #line 95 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_UPC_ISRC; return UPC_EAN; } { BEGIN(NAME); cueparserlval.ival = PTI_UPC_ISRC; return UPC_EAN; }
YY_BREAK YY_BREAK
case 41: case 41:
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
(yy_c_buf_p) = yy_cp = yy_bp + 4; (yy_c_buf_p) = yy_cp = yy_bp + 4;
YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP YY_RULE_SETUP
#line 95 "cue_scanner.l" #line 96 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_UPC_ISRC; return ISRC; } { BEGIN(NAME); cueparserlval.ival = PTI_UPC_ISRC; return ISRC; }
YY_BREAK YY_BREAK
case 42: case 42:
YY_RULE_SETUP YY_RULE_SETUP
#line 96 "cue_scanner.l" #line 97 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_SIZE_INFO; return SIZE_INFO; } { BEGIN(NAME); cueparserlval.ival = PTI_SIZE_INFO; return SIZE_INFO; }
YY_BREAK YY_BREAK
case 43: case 43:
YY_RULE_SETUP YY_RULE_SETUP
#line 98 "cue_scanner.l" #line 99 "cue_scanner.l"
{ BEGIN(NAME); return TRACK_ISRC; } { BEGIN(NAME); return TRACK_ISRC; }
YY_BREAK YY_BREAK
case 44: case 44:
YY_RULE_SETUP YY_RULE_SETUP
#line 100 "cue_scanner.l" #line 101 "cue_scanner.l"
{ BEGIN(REM); /* exclusive rules for special exceptions */ } { BEGIN(REM); /* exclusive rules for special exceptions */ }
YY_BREAK YY_BREAK
case 45: case 45:
YY_RULE_SETUP YY_RULE_SETUP
#line 102 "cue_scanner.l" #line 103 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = REM_DATE; return DATE; } { BEGIN(NAME); cueparserlval.ival = REM_DATE; return DATE; }
YY_BREAK YY_BREAK
case 46: case 46:
YY_RULE_SETUP YY_RULE_SETUP
#line 103 "cue_scanner.l" #line 104 "cue_scanner.l"
{ BEGIN(NAME); yylval.ival = PTI_GENRE; return XXX_GENRE; } { BEGIN(NAME); cueparserlval.ival = PTI_GENRE; return XXX_GENRE; }
YY_BREAK YY_BREAK
case 47: case 47:
YY_RULE_SETUP YY_RULE_SETUP
#line 104 "cue_scanner.l" #line 105 "cue_scanner.l"
{ BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_ALBUM_GAIN; { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_ALBUM_GAIN;
return REPLAYGAIN_ALBUM_GAIN; } return REPLAYGAIN_ALBUM_GAIN; }
YY_BREAK YY_BREAK
case 48: case 48:
YY_RULE_SETUP YY_RULE_SETUP
#line 106 "cue_scanner.l" #line 107 "cue_scanner.l"
{ BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_ALBUM_PEAK; { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_ALBUM_PEAK;
return REPLAYGAIN_ALBUM_PEAK; } return REPLAYGAIN_ALBUM_PEAK; }
YY_BREAK YY_BREAK
case 49: case 49:
YY_RULE_SETUP YY_RULE_SETUP
#line 108 "cue_scanner.l" #line 109 "cue_scanner.l"
{ BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_TRACK_GAIN; { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_TRACK_GAIN;
return REPLAYGAIN_TRACK_GAIN; } return REPLAYGAIN_TRACK_GAIN; }
YY_BREAK YY_BREAK
case 50: case 50:
YY_RULE_SETUP YY_RULE_SETUP
#line 110 "cue_scanner.l" #line 111 "cue_scanner.l"
{ BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_TRACK_PEAK; { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_TRACK_PEAK;
return REPLAYGAIN_TRACK_PEAK; } return REPLAYGAIN_TRACK_PEAK; }
YY_BREAK YY_BREAK
case 51: case 51:
YY_RULE_SETUP YY_RULE_SETUP
#line 113 "cue_scanner.l" #line 114 "cue_scanner.l"
{ BEGIN(REM); } { BEGIN(REM); }
YY_BREAK YY_BREAK
case 52: case 52:
YY_RULE_SETUP YY_RULE_SETUP
#line 114 "cue_scanner.l" #line 115 "cue_scanner.l"
{ BEGIN(REM); } { BEGIN(REM); }
YY_BREAK YY_BREAK
case 53: case 53:
/* rule 53 can match eol */ /* rule 53 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 115 "cue_scanner.l" #line 116 "cue_scanner.l"
{ BEGIN(INITIAL); } { BEGIN(INITIAL); }
YY_BREAK YY_BREAK
case 54: case 54:
YY_RULE_SETUP YY_RULE_SETUP
#line 117 "cue_scanner.l" #line 118 "cue_scanner.l"
{ {
yylval.sval = strncpy( yy_buffer, cueparserlval.sval = strncpy( cueparser_buffer,
yytext, yytext,
(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)); (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng));
yylval.sval[(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)] = '\0'; cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)] = '\0';
BEGIN(SKIP); BEGIN(SKIP);
return STRING; return STRING;
} }
YY_BREAK YY_BREAK
case 55: case 55:
YY_RULE_SETUP YY_RULE_SETUP
#line 126 "cue_scanner.l" #line 127 "cue_scanner.l"
{ BEGIN(RPG); } { BEGIN(RPG); }
YY_BREAK YY_BREAK
case 56: case 56:
/* rule 56 can match eol */ /* rule 56 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 128 "cue_scanner.l" #line 129 "cue_scanner.l"
{ BEGIN(INITIAL); yylineno++; return '\n'; } { BEGIN(INITIAL); yylineno++; return '\n'; }
YY_BREAK YY_BREAK
case 57: case 57:
YY_RULE_SETUP YY_RULE_SETUP
#line 130 "cue_scanner.l" #line 131 "cue_scanner.l"
{ /* ignore whitespace */ } { /* ignore whitespace */ }
YY_BREAK YY_BREAK
case 58: case 58:
YY_RULE_SETUP YY_RULE_SETUP
#line 132 "cue_scanner.l" #line 133 "cue_scanner.l"
{ yylval.ival = atoi(yytext); return NUMBER; } { cueparserlval.ival = atoi(yytext); return NUMBER; }
YY_BREAK YY_BREAK
case 59: case 59:
YY_RULE_SETUP YY_RULE_SETUP
#line 133 "cue_scanner.l" #line 134 "cue_scanner.l"
{ return yytext[0]; } { return yytext[0]; }
YY_BREAK YY_BREAK
case 60: case 60:
/* rule 60 can match eol */ /* rule 60 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 135 "cue_scanner.l" #line 136 "cue_scanner.l"
{ yylineno++; /* blank line */ } { yylineno++; /* blank line */ }
YY_BREAK YY_BREAK
case 61: case 61:
/* rule 61 can match eol */ /* rule 61 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 136 "cue_scanner.l" #line 137 "cue_scanner.l"
{ yylineno++; return '\n'; } { yylineno++; return '\n'; }
YY_BREAK YY_BREAK
case 62: case 62:
YY_RULE_SETUP YY_RULE_SETUP
#line 137 "cue_scanner.l" #line 138 "cue_scanner.l"
{ fprintf(stderr, "bad character '%c'\n", yytext[0]); } { fprintf(stderr, "bad character '%c'\n", yytext[0]); }
YY_BREAK YY_BREAK
case 63: case 63:
YY_RULE_SETUP YY_RULE_SETUP
#line 139 "cue_scanner.l" #line 140 "cue_scanner.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 1430 "cue_scanner.c" #line 1689 "cue_scanner.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(NAME): case YY_STATE_EOF(NAME):
case YY_STATE_EOF(REM): case YY_STATE_EOF(REM):
@ -2408,6 +2667,6 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables" #define YYTABLES_NAME "yytables"
#line 139 "cue_scanner.l" #line 140 "cue_scanner.l"

View File

@ -11,9 +11,9 @@
#include "cd.h" #include "cd.h"
#include "cue_parser.h" #include "cue_parser.h"
char yy_buffer[PARSER_BUFFER]; char cueparser_buffer[PARSER_BUFFER];
int yylex(void); int cueparserlex(void);
%} %}
ws [ \t\r] ws [ \t\r]
@ -23,6 +23,7 @@ nonws [^ \t\r\n]
%option noyywrap %option noyywrap
%option noinput %option noinput
%option nounput %option nounput
%option prefix="cueparser"
%s NAME %s NAME
%x REM %x REM
@ -33,19 +34,19 @@ nonws [^ \t\r\n]
\'([^\']|\\\')*\' | \'([^\']|\\\')*\' |
\"([^\"]|\\\")*\" { \"([^\"]|\\\")*\" {
yylval.sval = strncpy( yy_buffer, cueparserlval.sval = strncpy( cueparser_buffer,
++yytext, ++yytext,
(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)); (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng));
yylval.sval[(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng) - 2] = '\0'; cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng) - 2] = '\0';
BEGIN(INITIAL); BEGIN(INITIAL);
return STRING; return STRING;
} }
<NAME>{nonws}+ { <NAME>{nonws}+ {
yylval.sval = strncpy( yy_buffer, cueparserlval.sval = strncpy( cueparser_buffer,
yytext, yytext,
(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)); (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng));
yylval.sval[(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)] = '\0'; cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)] = '\0';
BEGIN(INITIAL); BEGIN(INITIAL);
return STRING; return STRING;
} }
@ -62,52 +63,52 @@ MP3 { return MP3; }
FLAC { return FLAC; } FLAC { return FLAC; }
TRACK { return TRACK; } TRACK { return TRACK; }
AUDIO { yylval.ival = MODE_AUDIO; return AUDIO; } AUDIO { cueparserlval.ival = MODE_AUDIO; return AUDIO; }
MODE1\/2048 { yylval.ival = MODE_MODE1; return MODE1_2048; } MODE1\/2048 { cueparserlval.ival = MODE_MODE1; return MODE1_2048; }
MODE1\/2352 { yylval.ival = MODE_MODE1_RAW; return MODE1_2352; } MODE1\/2352 { cueparserlval.ival = MODE_MODE1_RAW; return MODE1_2352; }
MODE2\/2336 { yylval.ival = MODE_MODE2; return MODE2_2336; } MODE2\/2336 { cueparserlval.ival = MODE_MODE2; return MODE2_2336; }
MODE2\/2048 { yylval.ival = MODE_MODE2_FORM1; return MODE2_2048; } MODE2\/2048 { cueparserlval.ival = MODE_MODE2_FORM1; return MODE2_2048; }
MODE2\/2342 { yylval.ival = MODE_MODE2_FORM2; return MODE2_2342; } MODE2\/2342 { cueparserlval.ival = MODE_MODE2_FORM2; return MODE2_2342; }
MODE2\/2332 { yylval.ival = MODE_MODE2_FORM_MIX; return MODE2_2332; } MODE2\/2332 { cueparserlval.ival = MODE_MODE2_FORM_MIX; return MODE2_2332; }
MODE2\/2352 { yylval.ival = MODE_MODE2_RAW; return MODE2_2352; } MODE2\/2352 { cueparserlval.ival = MODE_MODE2_RAW; return MODE2_2352; }
FLAGS { return FLAGS; } FLAGS { return FLAGS; }
PRE { yylval.ival = FLAG_PRE_EMPHASIS; return PRE; } PRE { cueparserlval.ival = FLAG_PRE_EMPHASIS; return PRE; }
DCP { yylval.ival = FLAG_COPY_PERMITTED; return DCP; } DCP { cueparserlval.ival = FLAG_COPY_PERMITTED; return DCP; }
4CH { yylval.ival = FLAG_FOUR_CHANNEL; return FOUR_CH; } 4CH { cueparserlval.ival = FLAG_FOUR_CHANNEL; return FOUR_CH; }
SCMS { yylval.ival = FLAG_SCMS; return SCMS; } SCMS { cueparserlval.ival = FLAG_SCMS; return SCMS; }
PREGAP { return PREGAP; } PREGAP { return PREGAP; }
INDEX { return INDEX; } INDEX { return INDEX; }
POSTGAP { return POSTGAP; } POSTGAP { return POSTGAP; }
TITLE { BEGIN(NAME); yylval.ival = PTI_TITLE; return TITLE; } TITLE { BEGIN(NAME); cueparserlval.ival = PTI_TITLE; return TITLE; }
PERFORMER { BEGIN(NAME); yylval.ival = PTI_PERFORMER; return PERFORMER; } PERFORMER { BEGIN(NAME); cueparserlval.ival = PTI_PERFORMER; return PERFORMER; }
SONGWRITER { BEGIN(NAME); yylval.ival = PTI_SONGWRITER; return SONGWRITER; } SONGWRITER { BEGIN(NAME); cueparserlval.ival = PTI_SONGWRITER; return SONGWRITER; }
COMPOSER { BEGIN(NAME); yylval.ival = PTI_COMPOSER; return COMPOSER; } COMPOSER { BEGIN(NAME); cueparserlval.ival = PTI_COMPOSER; return COMPOSER; }
ARRANGER { BEGIN(NAME); yylval.ival = PTI_ARRANGER; return ARRANGER; } ARRANGER { BEGIN(NAME); cueparserlval.ival = PTI_ARRANGER; return ARRANGER; }
MESSAGE { BEGIN(NAME); yylval.ival = PTI_MESSAGE; return MESSAGE; } MESSAGE { BEGIN(NAME); cueparserlval.ival = PTI_MESSAGE; return MESSAGE; }
DISC_ID { BEGIN(NAME); yylval.ival = PTI_DISC_ID; return DISC_ID; } DISC_ID { BEGIN(NAME); cueparserlval.ival = PTI_DISC_ID; return DISC_ID; }
GENRE { BEGIN(NAME); yylval.ival = PTI_GENRE; return GENRE; } GENRE { BEGIN(NAME); cueparserlval.ival = PTI_GENRE; return GENRE; }
TOC_INFO1 { BEGIN(NAME); yylval.ival = PTI_TOC_INFO1; return TOC_INFO1; } TOC_INFO1 { BEGIN(NAME); cueparserlval.ival = PTI_TOC_INFO1; return TOC_INFO1; }
TOC_INFO2 { BEGIN(NAME); yylval.ival = PTI_TOC_INFO2; return TOC_INFO2; } TOC_INFO2 { BEGIN(NAME); cueparserlval.ival = PTI_TOC_INFO2; return TOC_INFO2; }
UPC_EAN { BEGIN(NAME); yylval.ival = PTI_UPC_ISRC; return UPC_EAN; } UPC_EAN { BEGIN(NAME); cueparserlval.ival = PTI_UPC_ISRC; return UPC_EAN; }
ISRC/{ws}+\" { BEGIN(NAME); yylval.ival = PTI_UPC_ISRC; return ISRC; } ISRC/{ws}+\" { BEGIN(NAME); cueparserlval.ival = PTI_UPC_ISRC; return ISRC; }
SIZE_INFO { BEGIN(NAME); yylval.ival = PTI_SIZE_INFO; return SIZE_INFO; } SIZE_INFO { BEGIN(NAME); cueparserlval.ival = PTI_SIZE_INFO; return SIZE_INFO; }
ISRC { BEGIN(NAME); return TRACK_ISRC; } ISRC { BEGIN(NAME); return TRACK_ISRC; }
REM { BEGIN(REM); /* exclusive rules for special exceptions */ } REM { BEGIN(REM); /* exclusive rules for special exceptions */ }
<REM>DATE { BEGIN(NAME); yylval.ival = REM_DATE; return DATE; } <REM>DATE { BEGIN(NAME); cueparserlval.ival = REM_DATE; return DATE; }
<REM>GENRE { BEGIN(NAME); yylval.ival = PTI_GENRE; return XXX_GENRE; } <REM>GENRE { BEGIN(NAME); cueparserlval.ival = PTI_GENRE; return XXX_GENRE; }
<REM>REPLAYGAIN_ALBUM_GAIN { BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_ALBUM_GAIN; <REM>REPLAYGAIN_ALBUM_GAIN { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_ALBUM_GAIN;
return REPLAYGAIN_ALBUM_GAIN; } return REPLAYGAIN_ALBUM_GAIN; }
<REM>REPLAYGAIN_ALBUM_PEAK { BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_ALBUM_PEAK; <REM>REPLAYGAIN_ALBUM_PEAK { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_ALBUM_PEAK;
return REPLAYGAIN_ALBUM_PEAK; } return REPLAYGAIN_ALBUM_PEAK; }
<REM>REPLAYGAIN_TRACK_GAIN { BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_TRACK_GAIN; <REM>REPLAYGAIN_TRACK_GAIN { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_TRACK_GAIN;
return REPLAYGAIN_TRACK_GAIN; } return REPLAYGAIN_TRACK_GAIN; }
<REM>REPLAYGAIN_TRACK_PEAK { BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_TRACK_PEAK; <REM>REPLAYGAIN_TRACK_PEAK { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_TRACK_PEAK;
return REPLAYGAIN_TRACK_PEAK; } return REPLAYGAIN_TRACK_PEAK; }
<REM>{ws}+ { BEGIN(REM); } <REM>{ws}+ { BEGIN(REM); }
@ -115,10 +116,10 @@ REM { BEGIN(REM); /* exclusive rules for special exceptions */ }
<REM>\n { BEGIN(INITIAL); } <REM>\n { BEGIN(INITIAL); }
<RPG>{nonws}+ { <RPG>{nonws}+ {
yylval.sval = strncpy( yy_buffer, cueparserlval.sval = strncpy( cueparser_buffer,
yytext, yytext,
(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)); (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng));
yylval.sval[(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)] = '\0'; cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)] = '\0';
BEGIN(SKIP); BEGIN(SKIP);
return STRING; return STRING;
} }
@ -129,7 +130,7 @@ REM { BEGIN(REM); /* exclusive rules for special exceptions */ }
{ws}+ { /* ignore whitespace */ } {ws}+ { /* ignore whitespace */ }
[[:digit:]]+ { yylval.ival = atoi(yytext); return NUMBER; } [[:digit:]]+ { cueparserlval.ival = atoi(yytext); return NUMBER; }
: { return yytext[0]; } : { return yytext[0]; }
^{ws}*\n { yylineno++; /* blank line */ } ^{ws}*\n { yylineno++; /* blank line */ }

View File

@ -0,0 +1,5 @@
#!/bin/sh
flex --nounistd -o cue_scanner.c cue_scanner.l
bison --defines=cue_parser.h -o cue_parser.c cue_parser.y