wok view xxdiff/stuff/bison-3.02.patch @ rev 25507
plop: cleanup
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 11 10:36:59 2023 +0000 (21 months ago) |
parents | |
children |
line source
1 from f9f3270a4253144488f87a72bf941f510891dbb1 in https://github.com/blais/xxdiff/
2 --- xxdiff-401/src/resParser.cpp
3 +++ xxdiff-401/src/resParser.cpp
4 @@ -73,7 +73,7 @@ extern int resParserparse( void* );
6 //------------------------------------------------------------------------------
7 //
8 -void resParsererror( const char* msg )
9 +void resParsererror( XxResources *, const char* msg )
10 {
11 // Send errors to stdout so we can filter out the debug info shmeglu while
12 // debugging parser.
13 @@ -794,7 +794,7 @@ int parseFromKeywordList(
14 QString os;
15 QTextStream oss( &os );
16 oss << "Unknown " << errmsg << ": " << name << flush;
17 - resParsererror( os.toLatin1().constData() );
18 + resParsererror( NULL, os.toLatin1().constData() );
19 }
20 num = ERROR_TOKEN;
21 return ERROR_TOKEN;
22 --- xxdiff-401/src/resParser.l
23 +++ xxdiff-401/src/resParser.l
24 @@ -76,7 +76,7 @@ if ( input_stream_ptr->atEnd() ) {
25 result = YY_NULL; \
26 } \
27 else { \
28 - int ii = 0; \
29 + unsigned ii = 0; \
30 for ( ; (ii < max_size) && (!input_stream_ptr->atEnd()); ++ii ) { \
31 (*input_stream_ptr) >> buf[ii]; \
32 } \
33 --- xxdiff-401/src/resParser.y
34 +++ xxdiff-401/src/resParser.y
35 @@ -20,11 +20,6 @@
36 *
37 ******************************************************************************/
39 -%union
40 -{
41 - int num;
42 - char* str;
43 -}
44 %{
46 // xxdiff imports
47 @@ -39,12 +34,22 @@
49 // The parser input is the resources object to fill in.
50 #define RESOURCES ( static_cast<XxResources*>(resources) )
51 -#define YYPARSE_PARAM resources
52 +%}
53 +
54 +%define api.pure full
55 +%parse-param {XxResources * resources}
57 +%union
58 +{
59 + int num;
60 + char* str;
61 +}
62 +
63 +%{
64 // Declare lexer from other compilation unit.
65 int resParserlex( YYSTYPE* yylval );
67 -void resParsererror( const char* msg );
68 +void resParsererror( XxResources *, const char* msg );
70 // Declare some parser functions and data defined in resParser.cpp
71 namespace XxResParserNS {
72 @@ -144,7 +149,6 @@ using namespace XxResParserNS; // Make s
73 %type <num> boolkwd
75 %start xxdiffrc
76 -%pure_parser
78 %%
79 xxdiffrc : stmts
80 @@ -188,7 +192,7 @@ prefgeometry : PREFGEOMETRY COLON GEOMSP
81 RESOURCES->setPreferredGeometry( geometry );
82 }
83 else {
84 - yyerror( "Bad geometry specification." );
85 + yyerror( NULL, "Bad geometry specification." );
86 // Should never happen, the lexer regexp should be tough
87 // enough.
88 }
89 @@ -212,7 +216,7 @@ style : STYLE COLON STRING
90 QString err = QString( "Requested style key does not exist." );
91 err += QString( "\nValid styles are: " );
92 err += styles.join( ", " );
93 - yyerror( err.toLatin1().constData() );
94 + yyerror( NULL, err.toLatin1().constData() );
95 }
96 }
97 ;
98 @@ -224,7 +228,7 @@ accel : ACCEL DOT ACCELNAME COLON STRIN
99 char buf[2048];
100 ::snprintf( buf, 2048,
101 "Unrecognized accelerator: %s\n", $5 );
102 - yyerror( buf );
103 + yyerror( NULL, buf );
104 }
105 }
106 ;