}
%{
+#define NO_TAB_H
#include "parse.h"
+#undef NO_TAB_H
extern int yylex();
extern int yyparse();
void yyerror(char *err);
-extern int yylineno;
+extern int lineno;
extern FILE *yyin;
static char *path;
%token <integer> INTEGER
%token <string> STRING
%token <identifier> IDENTIFIER
-%token <bool> BOOL
+%token <bool> BOOLEAN
%token <character> '('
%token <character> ')'
%token <character> '{'
sections:
| sections '[' IDENTIFIER ']' { parse_set_section($3); } '\n'
- { ++yylineno; } lines
+ { ++lineno; } lines
;
lines:
| lines tokens { t.type='\n'; t.data.character='\n'; parse_token(&t); } '\n'
- { ++yylineno; }
+ { ++lineno; }
| lines IDENTIFIER '=' listtoken { parse_assign($2, &t); } '\n'
- { ++yylineno; }
+ { ++lineno; }
;
tokens:
| INTEGER { t.type = TOKEN_INTEGER; t.data.integer = $1; }
| STRING { t.type = TOKEN_STRING; t.data.string = $1; }
| IDENTIFIER { t.type = TOKEN_IDENTIFIER; t.data.identifier = $1; }
- | BOOL { t.type = TOKEN_BOOL; t.data.bool = $1; }
+ | BOOLEAN { t.type = TOKEN_BOOL; t.data.bool = $1; }
| list { t.type = TOKEN_LIST; t.data.list = $1; }
| '{' { t.type = $1; t.data.character = $1; }
| '}' { t.type = $1; t.data.character = $1; }
| INTEGER { t.type = TOKEN_INTEGER; t.data.integer = $1; }
| STRING { t.type = TOKEN_STRING; t.data.string = $1; }
| IDENTIFIER { t.type = TOKEN_IDENTIFIER; t.data.identifier = $1; }
- | BOOL { t.type = TOKEN_BOOL; t.data.bool = $1; }
+ | BOOLEAN { t.type = TOKEN_BOOL; t.data.bool = $1; }
| list { t.type = TOKEN_LIST; t.data.list = $1; }
| '{' { t.type = $1; t.data.character = $1; }
| '}' { t.type = $1; t.data.character = $1; }
%%
+int lineno;
+
void yyerror(char *err) {
- g_message("%s:%d: %s", path, yylineno, err);
+ g_message("%s:%d: %s", path, lineno, err);
}
void parse_rc()
}
}
- yylineno = 1;
+ lineno = 1;
yyparse();