Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
0c6ec337
Commit
0c6ec337
authored
Nov 01, 2013
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
1 changed file
with
44 additions
and
31 deletions
+44
-31
src/modelconfig/configparser.y
src/modelconfig/configparser.y
+44
-31
No files found.
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