<commit_before>/* A Bison parser, made by GNU Bison 2.3.  */

/* Skeleton implementation for Bison's Yacc-like parsers in C

   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
   Free Software Foundation, Inc.

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

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

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by <NAME>, by
   simplifying the original so-called "semantic" parser.  */

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

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

/* Bison version.  */
#define YYBISON_VERSION "2.3"

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

/* Pure parsers.  */
#define YYPURE 0

/* Using locations.  */
#define YYLSP_NEEDED 0

/* Substitute the variable and function names.  */
#define yyparse libmxmlparse
#define yylex   libmxmllex
#define yyerror libmxmlerror
#define yylval  libmxmllval
#define yychar  libmxmlchar
#define yydebug libmxmldebug
#define yynerrs libmxmlnerrs


/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     XMLDECL = 258,
     VERSION = 259,
     ENCODING = 260,
     STANDALONE = 261,
     YES = 262,
     NO = 263,
     ENDXMLDECL = 264,
     DOCTYPE = 265,
     PUBLIC = 266,
     SYSTEM = 267,
     COMMENT = 268,
     PI = 269,
     NAME = 270,
     DATA = 271,
     QUOTEDSTR = 272,
     SPACE = 273,
     LT = 274,
     GT = 275,
     ENDXMLS = 276,
     ENDXMLE = 277,
     EQ = 278
   };
#endif
/* Tokens.  */
#define XMLDECL 258
#define VERSION 259
#define ENCODING 260
#define STANDALONE 261
#define YES 262
#define NO 263
#define ENDXMLDECL 264
#define DOCTYPE 265
#define PUBLIC 266
#define SYSTEM 267
#define COMMENT 268
#define PI 269
#define NAME 270
#define DATA 271
#define QUOTEDSTR 272
#define SPACE 273
#define LT 274
#define GT 275
#define ENDXMLS 276
#define ENDXMLE 277
#define EQ 278




/* Copy the first part of user declarations.  */
#line 1 "xml.y"

/* 
  Basic xml grammar definition
  This is a basic definition of the xml grammar necessary to cover 
  the MusicXML format. It is a simplified form based on the XML document
  grammar as defined in 
  "XML in a nutshell - 2nd edition" E.R.Harold and W.S.Means,
  O'Reilly, June 2002, pp:366--371
*/


#include <stdio.h>
#include <string.h>
#include <iostream>
#include "reader.h"

#include "xmllex.c++"

using namespace std;

int yyline = 1;

#ifdef __cplusplus
extern "C" {
#endif
//int		yyparse (void);
void	yyerror(const char *s);
int		libmxmlwrap();
bool	readfile   (const char * file, reader * r);
bool	readstream (FILE * file, reader * r);
bool	readbuffer (const char * buffer, reader * r);
#ifdef __cplusplus
}
#endif

int   yylex (void);
extern char * libmxmltext;
extern int libmxmllineno;
extern FILE * libmxmlin;

#define YYERROR_VERBOSE
#define ERROR(str)	{ yyerror(str); YYABORT; }
#define MAXLEN	1024
#define VLEN	256
char attributeName[MAXLEN];
char attributeVal[MAXLEN];

char xmlversion[VLEN];
char xmlencoding[MAXLEN];
int xmlStandalone = -1;

char eltName[MAXLEN];
char doctypeStart[MAXLEN];
char doctypePub[MAXLEN];
char doctypeSys[MAXLEN];

reader * gReader;

static void init (reader * r) {
	gReader = r;
	xmlStandalone = -1;
	eltName[0]		= 0;
	attributeName[0] = 0;
	attributeVal[0] = 0;
	xmlversion[0]   = 0;
	xmlencoding[0]  = 0;
	doctypeStart[0]	= 0;
	doctypePub[0]	= 0;
	doctypeSys[0]	= 0;
}

static char * unquote (char * text) {
	int n = strlen(text);
	if (n > 0) {
		text[n-1]=0;
		return &text[1];
	}
	return text;
}

static void store (char * dst, const char * text) {
	strcpy (dst, text);
}

int		libmxmlwrap()		{ return(1); }<commit_msg>Resolve potential name clash with GuidoLib using namespace<commit_after>/* A Bison parser, made by GNU Bison 2.3.  */

/* Skeleton implementation for Bison's Yacc-like parsers in C

   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
   Free Software Foundation, Inc.

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

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

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.

   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by <NAME>, by
   simplifying the original so-called "semantic" parser.  */

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

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

/* Bison version.  */
#define YYBISON_VERSION "2.3"

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

/* Pure parsers.  */
#define YYPURE 0

/* Using locations.  */
#define YYLSP_NEEDED 0

/* Substitute the variable and function names.  */
#define yyparse libmxmlparse
#define yylex   libmxmllex
#define yyerror libmxmlerror
#define yylval  libmxmllval
#define yychar  libmxmlchar
#define yydebug libmxmldebug
#define yynerrs libmxmlnerrs


/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     XMLDECL = 258,
     VERSION = 259,
     ENCODING = 260,
     STANDALONE = 261,
     YES = 262,
     NO = 263,
     ENDXMLDECL = 264,
     DOCTYPE = 265,
     PUBLIC = 266,
     SYSTEM = 267,
     COMMENT = 268,
     PI = 269,
     NAME = 270,
     DATA = 271,
     QUOTEDSTR = 272,
     SPACE = 273,
     LT = 274,
     GT = 275,
     ENDXMLS = 276,
     ENDXMLE = 277,
     EQ = 278
   };
#endif
/* Tokens.  */
#define XMLDECL 258
#define VERSION 259
#define ENCODING 260
#define STANDALONE 261
#define YES 262
#define NO 263
#define ENDXMLDECL 264
#define DOCTYPE 265
#define PUBLIC 266
#define SYSTEM 267
#define COMMENT 268
#define PI 269
#define NAME 270
#define DATA 271
#define QUOTEDSTR 272
#define SPACE 273
#define LT 274
#define GT 275
#define ENDXMLS 276
#define ENDXMLE 277
#define EQ 278




/* Copy the first part of user declarations.  */
#line 1 "xml.y"

/* 
  Basic xml grammar definition
  This is a basic definition of the xml grammar necessary to cover 
  the MusicXML format. It is a simplified form based on the XML document
  grammar as defined in 
  "XML in a nutshell - 2nd edition" E.R.Harold and W.S.Means,
  O'Reilly, June 2002, pp:366--371
*/


#include <stdio.h>
#include <string.h>
#include <iostream>
#include "reader.h"

#include "xmllex.c++"

using namespace std;

int yyline = 1;

#ifdef __cplusplus
extern "C" {
#endif
//int		yyparse (void);
void	yyerror(const char *s);
int		libmxmlwrap();
bool	readfile   (const char * file, reader * r);
bool	readstream (FILE * file, reader * r);
bool	readbuffer (const char * buffer, reader * r);
#ifdef __cplusplus
}
#endif

int   yylex (void);
extern char * libmxmltext;
extern int libmxmllineno;
extern FILE * libmxmlin;

#define YYERROR_VERBOSE
#define ERROR(str)	{ yyerror(str); YYABORT; }
#define MAXLEN	1024
#define VLEN	256
char attributeName[MAXLEN];
char attributeVal[MAXLEN];

char xmlversion[VLEN];
char xmlencoding[MAXLEN];
int xmlStandalone = -1;

char eltName[MAXLEN];
char doctypeStart[MAXLEN];
char doctypePub[MAXLEN];
char doctypeSys[MAXLEN];

namespace MusicXML2
{
reader * gReader;

} // namespace MUSICXML2

using namespace MusicXML2;

static void init (reader * r) {
	gReader = r;
	xmlStandalone = -1;
	eltName[0]		= 0;
	attributeName[0] = 0;
	attributeVal[0] = 0;
	xmlversion[0]   = 0;
	xmlencoding[0]  = 0;
	doctypeStart[0]	= 0;
	doctypePub[0]	= 0;
	doctypeSys[0]	= 0;
}

static char * unquote (char * text) {
	int n = strlen(text);
	if (n > 0) {
		text[n-1]=0;
		return &text[1];
	}
	return text;
}

static void store (char * dst, const char * text) {
	strcpy (dst, text);
}

int		libmxmlwrap()		{ return(1); }
{'fraction_non_alphanumeric': 0.08335646220741974, 'fraction_numerical': 0.04301970580072162, 'mean_word_length': 3.4339622641509435, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 44}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3359795', 'n_tokens_mistral': 4016, 'n_tokens_neox': 3466, 'n_words': 1442}