Commit 0c6ec337 authored by Philip Carns's avatar Philip Carns

experimental fixes for newer versions of bison

tested with Bison 2.7.1 and Flex 2.5.35 (Ubuntu 13.10)
parent 166cef58
......@@ -13,40 +13,10 @@
%name-prefix="cfgp_"
%defines
%union {
struct
{
char string_buf [512];
unsigned int curstringpos;
};
}
%start configfile
%token <string_buf> LITERAL_STRING
%token OPENSECTION
%token CLOSESECTION
%token <string_buf> IDENTIFIER
%token EQUAL_TOKEN
%token SEMICOLUMN
%token KOMMA
%token LOPEN
%token LCLOSE
%initial-action {
param->stacktop = 0;
param->sectionstack[0] = 0;
param->parser_error_code = 0;
param->parser_error_string = 0;
}
%{
#include <assert.h>
#include "src/modelconfig/configlex.h"
#include "src/modelconfig/configglue.h"
#include "codes/tools.h"
......@@ -59,6 +29,31 @@
#pragma warning(push, 1)
#endif
%}
%code requires {
#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
typedef void* yyscan_t;
#endif
}
%union {
struct
{
char string_buf [512];
unsigned int curstringpos;
};
}
%{
#include "src/modelconfig/configlex.h"
int cfgp_error (YYLTYPE * loc, yyscan_t * scanner, ParserParams * p,
const char * msg)
{
......@@ -73,9 +68,27 @@ int cfgp_error (YYLTYPE * loc, yyscan_t * scanner, ParserParams * p,
}
}
%}
%start configfile
%token <string_buf> LITERAL_STRING
%token OPENSECTION
%token CLOSESECTION
%token <string_buf> IDENTIFIER
%token EQUAL_TOKEN
%token SEMICOLUMN
%token KOMMA
%token LOPEN
%token LCLOSE
%initial-action {
param->stacktop = 0;
param->sectionstack[0] = 0;
param->parser_error_code = 0;
param->parser_error_string = 0;
}
%%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment