Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Caitlin Ross
codes
Commits
0c6ec337
Commit
0c6ec337
authored
Nov 01, 2013
by
Philip Carns
Browse files
experimental fixes for newer versions of bison
tested with Bison 2.7.1 and Flex 2.5.35 (Ubuntu 13.10)
parent
166cef58
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/modelconfig/configparser.y
View file @
0c6ec337
...
...
@@ -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;
}
%%
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment