r2814 - getParseTreeFromLexems(): suppress SYNT_EXPR token on reduction, when it...
authorDenis Ovsienko <infrastation@yandex.ru>
Tue, 2 Jun 2009 20:59:26 +0000 (20:59 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Tue, 2 Jun 2009 20:59:26 +0000 (20:59 +0000)
inc/code.php

index e9ecde763e137117931006f400abd24b179c15d2..5dc621f3324b5299db150e5a8b8d62411161e562 100644 (file)
@@ -672,12 +672,12 @@ function getParseTreeFromLexems ($lexems)
                                                'type' => 'SYNT_GRANT',
                                                'lineno' => $stacktop['lineno'],
                                                'decision' => $stacksecondtop['type'],
-                                               'condition' => $stacktop
+                                               'condition' => isset ($stacktop['load']) ? $stacktop['load'] : $stacktop
                                        )
                                );
                                continue;
                        }
-                       // DEFINE ::= define PREDICATE
+                       // DEFINITION ::= DEFINE EXPRESSION
                        if
                        (
                                $stacktop['type'] == 'SYNT_EXPR' and
@@ -695,7 +695,7 @@ function getParseTreeFromLexems ($lexems)
                                                'type' => 'SYNT_DEFINITION',
                                                'lineno' => $stacktop['lineno'],
                                                'term' => $stacksecondtop['load'],
-                                               'definition' => $stacktop['load']
+                                               'definition' => isset ($stacktop['load']) ? $stacktop['load'] : $stacktop
                                        )
                                );
                                continue;
@@ -722,7 +722,7 @@ function getParseTreeFromLexems ($lexems)
                                                'type' => 'SYNT_ADJUSTMENT',
                                                'lineno' => $stacktop['lineno'],
                                                'modlist' => $stackthirdtop['load'],
-                                               'condition' => $stacktop['load']
+                                               'condition' => isset ($stacktop['load']) ? $stacktop['load'] : $stacktop
                                        )
                                );
                                continue;