summaryrefslogtreecommitdiffstats
path: root/package/webkit/webkit-bison-2-6-compat.patch
blob: 7a94164fe6313edf8cd97df905f0417f9e0e1ba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
Bison 2.6 compatibility fix

Taken from upstream at http://trac.webkit.org/changeset/124099, with
minor adaptations.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Index: webkit-1.2.7/WebCore/ChangeLog
===================================================================
--- webkit-1.2.7.orig/WebCore/ChangeLog	2010-12-28 13:27:37.000000000 +0100
+++ webkit-1.2.7/WebCore/ChangeLog	2012-12-15 15:48:40.000000000 +0100
@@ -1,3 +1,28 @@
+2012-07-30  Alexis Menard  <alexis.menard@openbossa.org>
+
+        Build fix with newer bison 2.6.
+        https://bugs.webkit.org/show_bug.cgi?id=92264
+
+        Reviewed by Adam Barth.
+
+        As stated in http://www.gnu.org/software/bison/manual/html_node/Table-of-Symbols.html
+        YYLEX_PARAM and YYPARSE_PARAM are depecreated since version 1.875. So far all Mac OS
+        version I had access to as well as recent Linux runs at least version 2.3 so it's safe
+        to use the replacement of these deprecated macros in favor of %lex-param and %parse-param.
+        As announced http://lists.gnu.org/archive/html/info-gnu/2012-07/msg00011.html with the release
+        of version 2.6 YYLEX_PARAM and YYPARSE_PARAM are not supported anymore.
+
+        No new tests : build fix and the patch should not trigger any regressions
+
+        * css/CSSGrammar.y:
+        * css/CSSParser.cpp:
+        * xml/XPathGrammar.y: Refactored a bit to not use an intermediate PARSER define.
+        * xml/XPathParser.cpp: bison 2.6 declare xpathyyparse in the .h file now, i.e. XPathGrammar.h
+        therefore including this file within the namespace {} declarations leads to xpathyyparse being
+        defined part of WebCore::XPath namespaces but the actual implementation of xpathyyparse is in XPathGrammar.cpp
+        (generated) and not implemented within the WebCore::XPath so it lead to linking issues. Last, XPathGrammar.h needs 
+        to be included after the other includes as it uses some XPath types. It breaks the style but CSSParser.cpp is doing the same.
+
 2010-06-21  Philippe Normand  <pnormand@igalia.com>
 
         Reviewed by Xan Lopez.
Index: webkit-1.2.7/WebCore/css/CSSParser.cpp
===================================================================
--- webkit-1.2.7.orig/WebCore/css/CSSParser.cpp	2010-12-28 13:24:33.000000000 +0100
+++ webkit-1.2.7/WebCore/css/CSSParser.cpp	2012-12-15 17:29:57.000000000 +0100
@@ -81,7 +81,7 @@
 extern int cssyydebug;
 #endif
 
-extern int cssyyparse(void* parser);
+extern int cssyyparse(WebCore::CSSParser*);
 
 using namespace std;
 using namespace WTF;
@@ -226,7 +226,7 @@
     m_defaultNamespace = starAtom; // Reset the default namespace.
     
     setupParser("", string, "");
-    cssyyparse(this);
+    ::cssyyparse(this);
     m_rule = 0;
 }
 
@@ -235,7 +235,7 @@
     m_styleSheet = sheet;
     m_allowNamespaceDeclarations = false;
     setupParser("@-webkit-rule{", string, "} ");
-    cssyyparse(this);
+    ::cssyyparse(this);
     return m_rule.release();
 }
 
@@ -243,7 +243,7 @@
 {
     m_styleSheet = sheet;
     setupParser("@-webkit-keyframe-rule{ ", string, "} ");
-    cssyyparse(this);
+    ::cssyyparse(this);
     return m_keyframe.release();
 }
 
@@ -257,7 +257,7 @@
     m_id = id;
     m_important = important;
     
-    cssyyparse(this);
+    ::cssyyparse(this);
     
     m_rule = 0;
 
@@ -304,7 +304,7 @@
     m_styleSheet = static_cast<CSSStyleSheet*>(declaration->stylesheet());
 
     setupParser("@-webkit-decls{color:", string, "} ");
-    cssyyparse(this);
+    ::cssyyparse(this);
     m_rule = 0;
 
     return (m_numParsedProperties && m_parsedProperties[0]->m_id == CSSPropertyColor);
@@ -319,7 +319,7 @@
 
     setupParser("@-webkit-selector{", string, "}");
 
-    cssyyparse(this);
+    ::cssyyparse(this);
 
     m_selectorListForParseSelector = 0;
 }
@@ -330,7 +330,7 @@
     m_styleSheet = static_cast<CSSStyleSheet*>(declaration->stylesheet());
 
     setupParser("@-webkit-decls{", string, "} ");
-    cssyyparse(this);
+    ::cssyyparse(this);
     m_rule = 0;
 
     bool ok = false;
@@ -354,7 +354,7 @@
     // can't use { because tokenizer state switches from mediaquery to initial state when it sees { token.
     // instead insert one " " (which is WHITESPACE in CSSGrammar.y)
     setupParser("@-webkit-mediaquery ", string, "} ");
-    cssyyparse(this);
+    ::cssyyparse(this);
 
     bool ok = false;
     if (m_mediaQuery) {
@@ -5191,7 +5191,7 @@
     nameValuePair += variableValue;
 
     setupParser("@-webkit-variables-decls{", nameValuePair, "} ");
-    cssyyparse(this);
+    ::cssyyparse(this);
     m_rule = 0;
 
     bool ok = false;
Index: webkit-1.2.7/WebCore/css/CSSGrammar.y
===================================================================
--- webkit-1.2.7.orig/WebCore/css/CSSGrammar.y	2010-09-10 15:20:33.000000000 +0200
+++ webkit-1.2.7/WebCore/css/CSSGrammar.y	2012-12-15 15:48:40.000000000 +0100
@@ -51,14 +51,13 @@
 #define YYMAXDEPTH 10000
 #define YYDEBUG 0
 
-// FIXME: Replace with %parse-param { CSSParser* parser } once we can depend on bison 2.x
-#define YYPARSE_PARAM parser
-#define YYLEX_PARAM parser
-
 %}
 
 %pure_parser
 
+%parse-param { CSSParser* parser }
+%lex-param { CSSParser* parser }
+
 %union {
     bool boolean;
     char character;
@@ -85,7 +84,7 @@
 
 %{
 
-static inline int cssyyerror(const char*)
+static inline int cssyyerror(void*, const char*)
 {
     return 1;
 }
Index: webkit-1.2.7/WebCore/xml/XPathParser.cpp
===================================================================
--- webkit-1.2.7.orig/WebCore/xml/XPathParser.cpp	2010-09-10 15:20:33.000000000 +0200
+++ webkit-1.2.7/WebCore/xml/XPathParser.cpp	2012-12-15 15:56:37.000000000 +0100
@@ -35,20 +35,18 @@
 #include "XPathEvaluator.h"
 #include "XPathException.h"
 #include "XPathNSResolver.h"
+#include "XPathPath.h"
 #include "XPathStep.h"
 #include <wtf/StdLibExtras.h>
 
-int xpathyyparse(void*);
-
+using namespace WebCore;
 using namespace WTF;
 using namespace Unicode;
 
-namespace WebCore {
-namespace XPath {
-
-class LocationPath;
+using namespace XPath;
 
-#include "XPathGrammar.h"    
+extern int xpathyyparse(WebCore::XPath::Parser*);
+#include "XPathGrammar.h"
 
 Parser* Parser::currentParser = 0;
     
@@ -630,7 +628,5 @@
     delete t;
 }
 
-}
-}
 
 #endif // ENABLE(XPATH)
Index: webkit-1.2.7/WebCore/xml/XPathGrammar.y
===================================================================
--- webkit-1.2.7.orig/WebCore/xml/XPathGrammar.y	2010-02-05 17:26:58.000000000 +0100
+++ webkit-1.2.7/WebCore/xml/XPathGrammar.y	2012-12-15 15:48:40.000000000 +0100
@@ -36,6 +36,7 @@
 #include "XPathParser.h"
 #include "XPathPath.h"
 #include "XPathPredicate.h"
+#include "XPathStep.h"
 #include "XPathVariableReference.h"
 #include <wtf/FastMalloc.h>
 
@@ -46,8 +47,6 @@
 #define YYLTYPE_IS_TRIVIAL 1
 #define YYDEBUG 0
 #define YYMAXDEPTH 10000
-#define YYPARSE_PARAM parserParameter
-#define PARSER static_cast<Parser*>(parserParameter)
 
 using namespace WebCore;
 using namespace XPath;
@@ -55,6 +54,7 @@
 %}
 
 %pure_parser
+%parse-param { WebCore::XPath::Parser* parser }
 
 %union
 {
@@ -73,7 +73,7 @@
 %{
 
 static int xpathyylex(YYSTYPE* yylval) { return Parser::current()->lex(yylval); }
-static void xpathyyerror(const char*) { }
+static void xpathyyerror(void*, const char*) { }
     
 %}
 
@@ -120,7 +120,7 @@
 Expr:
     OrExpr
     {
-        PARSER->m_topExpr = $1;
+        parser->m_topExpr = $1;
     }
     ;
 
@@ -140,7 +140,7 @@
     '/'
     {
         $$ = new LocationPath;
-        PARSER->registerParseNode($$);
+        parser->registerParseNode($$);
     }
     |
     '/' RelativeLocationPath
@@ -152,7 +152,7 @@
     {
         $$ = $2;
         $$->insertFirstStep($1);
-        PARSER->unregisterParseNode($1);
+        parser->unregisterParseNode($1);
     }
     ;
 
@@ -161,22 +161,22 @@
     {
         $$ = new LocationPath;
         $$->appendStep($1);
-        PARSER->unregisterParseNode($1);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->registerParseNode($$);
     }
     |
     RelativeLocationPath '/' Step
     {
         $$->appendStep($3);
-        PARSER->unregisterParseNode($3);
+        parser->unregisterParseNode($3);
     }
     |
     RelativeLocationPath DescendantOrSelf Step
     {
         $$->appendStep($2);
         $$->appendStep($3);
-        PARSER->unregisterParseNode($2);
-        PARSER->unregisterParseNode($3);
+        parser->unregisterParseNode($2);
+        parser->unregisterParseNode($3);
     }
     ;
 
@@ -185,58 +185,58 @@
     {
         if ($2) {
             $$ = new Step(Step::ChildAxis, *$1, *$2);
-            PARSER->deletePredicateVector($2);
+            parser->deletePredicateVector($2);
         } else
             $$ = new Step(Step::ChildAxis, *$1);
-        PARSER->deleteNodeTest($1);
-        PARSER->registerParseNode($$);
+        parser->deleteNodeTest($1);
+        parser->registerParseNode($$);
     }
     |
     NAMETEST OptionalPredicateList
     {
         String localName;
         String namespaceURI;
-        if (!PARSER->expandQName(*$1, localName, namespaceURI)) {
-            PARSER->m_gotNamespaceError = true;
+        if (!parser->expandQName(*$1, localName, namespaceURI)) {
+            parser->m_gotNamespaceError = true;
             YYABORT;
         }
         
         if ($2) {
             $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$2);
-            PARSER->deletePredicateVector($2);
+            parser->deletePredicateVector($2);
         } else
             $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));
-        PARSER->deleteString($1);
-        PARSER->registerParseNode($$);
+        parser->deleteString($1);
+        parser->registerParseNode($$);
     }
     |
     AxisSpecifier NodeTest OptionalPredicateList
     {
         if ($3) {
             $$ = new Step($1, *$2, *$3);
-            PARSER->deletePredicateVector($3);
+            parser->deletePredicateVector($3);
         } else
             $$ = new Step($1, *$2);
-        PARSER->deleteNodeTest($2);
-        PARSER->registerParseNode($$);
+        parser->deleteNodeTest($2);
+        parser->registerParseNode($$);
     }
     |
     AxisSpecifier NAMETEST OptionalPredicateList
     {
         String localName;
         String namespaceURI;
-        if (!PARSER->expandQName(*$2, localName, namespaceURI)) {
-            PARSER->m_gotNamespaceError = true;
+        if (!parser->expandQName(*$2, localName, namespaceURI)) {
+            parser->m_gotNamespaceError = true;
             YYABORT;
         }
 
         if ($3) {
             $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$3);
-            PARSER->deletePredicateVector($3);
+            parser->deletePredicateVector($3);
         } else
             $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));
-        PARSER->deleteString($2);
-        PARSER->registerParseNode($$);
+        parser->deleteString($2);
+        parser->registerParseNode($$);
     }
     |
     AbbreviatedStep
@@ -261,23 +261,23 @@
         else if (*$1 == "comment")
             $$ = new Step::NodeTest(Step::NodeTest::CommentNodeTest);
 
-        PARSER->deleteString($1);
-        PARSER->registerNodeTest($$);
+        parser->deleteString($1);
+        parser->registerNodeTest($$);
     }
     |
     PI '(' ')'
     {
         $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest);
-        PARSER->deleteString($1);        
-        PARSER->registerNodeTest($$);
+        parser->deleteString($1);
+        parser->registerNodeTest($$);
     }
     |
     PI '(' LITERAL ')'
     {
         $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest, $3->stripWhiteSpace());
-        PARSER->deleteString($1);        
-        PARSER->deleteString($3);
-        PARSER->registerNodeTest($$);
+        parser->deleteString($1);
+        parser->deleteString($3);
+        parser->registerNodeTest($$);
     }
     ;
 
@@ -295,14 +295,14 @@
     {
         $$ = new Vector<Predicate*>;
         $$->append(new Predicate($1));
-        PARSER->unregisterParseNode($1);
-        PARSER->registerPredicateVector($$);
+        parser->unregisterParseNode($1);
+        parser->registerPredicateVector($$);
     }
     |
     PredicateList Predicate
     {
         $$->append(new Predicate($2));
-        PARSER->unregisterParseNode($2);
+        parser->unregisterParseNode($2);
     }
     ;
 
@@ -317,7 +317,7 @@
     SLASHSLASH
     {
         $$ = new Step(Step::DescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));
-        PARSER->registerParseNode($$);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -325,13 +325,13 @@
     '.'
     {
         $$ = new Step(Step::SelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));
-        PARSER->registerParseNode($$);
+        parser->registerParseNode($$);
     }
     |
     DOTDOT
     {
         $$ = new Step(Step::ParentAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));
-        PARSER->registerParseNode($$);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -339,8 +339,8 @@
     VARIABLEREFERENCE
     {
         $$ = new VariableReference(*$1);
-        PARSER->deleteString($1);
-        PARSER->registerParseNode($$);
+        parser->deleteString($1);
+        parser->registerParseNode($$);
     }
     |
     '(' Expr ')'
@@ -351,15 +351,15 @@
     LITERAL
     {
         $$ = new StringExpression(*$1);
-        PARSER->deleteString($1);
-        PARSER->registerParseNode($$);
+        parser->deleteString($1);
+        parser->registerParseNode($$);
     }
     |
     NUMBER
     {
         $$ = new Number($1->toDouble());
-        PARSER->deleteString($1);
-        PARSER->registerParseNode($$);
+        parser->deleteString($1);
+        parser->registerParseNode($$);
     }
     |
     FunctionCall
@@ -371,8 +371,8 @@
         $$ = createFunction(*$1);
         if (!$$)
             YYABORT;
-        PARSER->deleteString($1);
-        PARSER->registerParseNode($$);
+        parser->deleteString($1);
+        parser->registerParseNode($$);
     }
     |
     FUNCTIONNAME '(' ArgumentList ')'
@@ -380,9 +380,9 @@
         $$ = createFunction(*$1, *$3);
         if (!$$)
             YYABORT;
-        PARSER->deleteString($1);
-        PARSER->deleteExpressionVector($3);
-        PARSER->registerParseNode($$);
+        parser->deleteString($1);
+        parser->deleteExpressionVector($3);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -391,14 +391,14 @@
     {
         $$ = new Vector<Expression*>;
         $$->append($1);
-        PARSER->unregisterParseNode($1);
-        PARSER->registerExpressionVector($$);
+        parser->unregisterParseNode($1);
+        parser->registerExpressionVector($$);
     }
     |
     ArgumentList ',' Argument
     {
         $$->append($3);
-        PARSER->unregisterParseNode($3);
+        parser->unregisterParseNode($3);
     }
     ;
 
@@ -414,9 +414,9 @@
         $$ = new Union;
         $$->addSubExpression($1);
         $$->addSubExpression($3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -432,9 +432,9 @@
     {
         $3->setAbsolute(true);
         $$ = new Path(static_cast<Filter*>($1), $3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     |
     FilterExpr DescendantOrSelf RelativeLocationPath
@@ -442,10 +442,10 @@
         $3->insertFirstStep($2);
         $3->setAbsolute(true);
         $$ = new Path(static_cast<Filter*>($1), $3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($2);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($2);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -455,9 +455,9 @@
     PrimaryExpr PredicateList
     {
         $$ = new Filter($1, *$2);
-        PARSER->unregisterParseNode($1);
-        PARSER->deletePredicateVector($2);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->deletePredicateVector($2);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -467,9 +467,9 @@
     OrExpr OR AndExpr
     {
         $$ = new LogicalOp(LogicalOp::OP_Or, $1, $3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -479,9 +479,9 @@
     AndExpr AND EqualityExpr
     {
         $$ = new LogicalOp(LogicalOp::OP_And, $1, $3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -491,9 +491,9 @@
     EqualityExpr EQOP RelationalExpr
     {
         $$ = new EqTestOp($2, $1, $3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -503,9 +503,9 @@
     RelationalExpr RELOP AdditiveExpr
     {
         $$ = new EqTestOp($2, $1, $3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -515,17 +515,17 @@
     AdditiveExpr PLUS MultiplicativeExpr
     {
         $$ = new NumericOp(NumericOp::OP_Add, $1, $3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     |
     AdditiveExpr MINUS MultiplicativeExpr
     {
         $$ = new NumericOp(NumericOp::OP_Sub, $1, $3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -535,9 +535,9 @@
     MultiplicativeExpr MULOP UnaryExpr
     {
         $$ = new NumericOp($2, $1, $3);
-        PARSER->unregisterParseNode($1);
-        PARSER->unregisterParseNode($3);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($1);
+        parser->unregisterParseNode($3);
+        parser->registerParseNode($$);
     }
     ;
 
@@ -548,8 +548,8 @@
     {
         $$ = new Negative;
         $$->addSubExpression($2);
-        PARSER->unregisterParseNode($2);
-        PARSER->registerParseNode($$);
+        parser->unregisterParseNode($2);
+        parser->registerParseNode($$);
     }
     ;