added config files

This commit is contained in:
bronku 2025-11-20 10:30:59 +01:00
parent e0b407f8fb
commit fd2d08fb24
7 changed files with 90 additions and 54 deletions

View file

@ -1,49 +1,23 @@
/* Require bison minimal version */
%require "3.0.4"
/* use newer C++ skeleton file */
%skeleton "lalr1.cc"
/* write out a header file containing the token defines */
%defines
/* namespace to enclose parser in */
%define api.prefix {yy}
/* set the parser's class identifier */
%define api.parser.class {Parser}
/* it will generate a location class which can be used in your lexer */
%skeleton "lalr1.cc"
%defines
%define api.prefix {yy}
%define api.parser.class {Parser}
%locations
/* use the constructor for each token, and make_TOKENNAME functions will be generated */
%define api.token.constructor
/* use the variant type for $1~$n and $$ those variables */
%define api.token.constructor
%define api.value.type variant
%define parse.trace
%define parse.error verbose
%code requires
{
/* you may need these header files
* add more header file if you need more
*/
#include <list>
#include <string>
#include <functional>
#include "../src/ParserCtx.hpp"
/* define the sturctures using as types for non-terminals */
/* end the structures for non-terminal types */
}
%code
{
yy::Parser::symbol_type yylex(void* yyscanner, yy::location& loc);
@ -51,10 +25,7 @@ yy::Parser::symbol_type yylex(void* yyscanner, yy::location& loc);
%token END 0;
/* specify tokens, type of non-terminals and terminals here */
%token FUNCTION
/* end of token specifications */
/* The driver is passed by reference to the parser and to the scanner. This