#include "parser.h"
#include "scanner.h"
-extern int testparse(yyscan_t);
-
int main ( int argc, char** argv )
{
yyscan_t scanner;
* PURPOSE.
*/
+%parse-param { void* scanner }
+
/*
How to compile:
bison --defines --output-file="parser.c" --name-prefix="test" parser.y
#include "config.h"
#define YYERROR_VERBOSE 1
-#define YYPARSE_PARAM scanner
#define YYLEX_PARAM scanner
-int yyerror(char* msg);
extern int testget_lineno(void*);
%%
-int yyerror(char* msg) {
+int yyerror(void* scanner, char* msg) {
fprintf(stderr,"%s\n",msg);
return 0;
}
#include "parser.h"
#include "scanner.h"
-extern int testparse(yyscan_t);
-
int main ( int argc, char** argv )
{
yyscan_t scanner;
How to compile:
bison --defines --output-file="parser.c" --name-prefix="test" parser.y
*/
+%parse-param { void* scanner }
%{
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#define YYERROR_VERBOSE 1
-#define YYPARSE_PARAM scanner
#define YYLEX_PARAM scanner
-int yyerror(char* msg);
-
/* A dummy function. A check against seg-faults in yylval->str. */
int process_text(char* s) {
endtag: LTSLASH TAGNAME GT { process_text($2);free($2);} ;
%%
-int yyerror(char* msg) {
+int yyerror(void* scanner, char* msg) {
fprintf(stderr,"%s\n",msg);
return 0;
}