/*
 * This file is part of Beastie <https://purl.org/nxg/dist/beastie>
 * SPDX-FileCopyrightText: 2023 Norman Gray <https://nxg.me.uk>
 * SPDX-License-Identifier: BSD-2-Clause
 */

#ifndef PARSE_AUTHORS_H
#define PARSE_AUTHORS_H 1

#include "beastie.h"            // for YYSTYPE and s7_pointer
#include "yycommon.h"           // for YYLTYPE

struct authors_extra_s {
    const char* current_string; // the string currently being parsed, for error messages
    const char* location;       // a location string, arbitrary contents, for error messages
    void* yyscanbuf;            // cast from YY_BUFFER_STATE
};
typedef struct authors_extra_s* authors_extra_t;

// defined in parse-authors.lex
yyscan_t parse_authors_setup_string(authors_extra_t, const char* s);
void parse_authors_finish(authors_extra_t, yyscan_t);
int authorslex(YYSTYPE* lvalp, YYLTYPE* llocp, yyscan_t scanner);

// defined in parse-authors.y
int authorsparse(authors_extra_t, s7_pointer* parse_result, yyscan_t scanner);

#endif /* PARSE_AUTHORS_H */
