📄 searchcommandparser.php.svn-base
字号:
$this->yystack[$this->yyidx] = $x; continue 2; } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { $this->yyidx = $yyidx; $this->yystack = $stack; if (!$token) { // end of input: this is valid return true; } // the last token was just ignored, we can't accept // by ignoring input, this is in essence ignoring a // syntax error! return false; } elseif ($nextstate === self::YY_NO_ACTION) { $this->yyidx = $yyidx; $this->yystack = $stack; // input accepted, but not shifted (I guess) return true; } else { $yyact = $nextstate; } } while (true); } break; } while (true); $this->yyidx = $yyidx; $this->yystack = $stack; return true; } /** * Find the appropriate action for a parser given the terminal * look-ahead token iLookAhead. * * If the look-ahead token is YYNOCODE, then check to see if the action is * independent of the look-ahead. If it is, return the action, otherwise * return YY_NO_ACTION. * @param int The look-ahead token */ function yy_find_shift_action($iLookAhead) { $stateno = $this->yystack[$this->yyidx]->stateno; /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ if (!isset(self::$yy_shift_ofst[$stateno])) { // no shift actions return self::$yy_default[$stateno]; } $i = self::$yy_shift_ofst[$stateno]; if ($i === self::YY_SHIFT_USE_DFLT) { return self::$yy_default[$stateno]; } if ($iLookAhead == self::YYNOCODE) { return self::YY_NO_ACTION; } $i += $iLookAhead; if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[$i] != $iLookAhead) { if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { if (self::$yyTraceFILE) { fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " . self::$yyTokenName[$iLookAhead] . " => " . self::$yyTokenName[$iFallback] . "\n"); } return $this->yy_find_shift_action($iFallback); } return self::$yy_default[$stateno]; } else { return self::$yy_action[$i]; } } /** * Find the appropriate action for a parser given the non-terminal * look-ahead token $iLookAhead. * * If the look-ahead token is self::YYNOCODE, then check to see if the action is * independent of the look-ahead. If it is, return the action, otherwise * return self::YY_NO_ACTION. * @param int Current state number * @param int The look-ahead token */ function yy_find_reduce_action($stateno, $iLookAhead) { /* $stateno = $this->yystack[$this->yyidx]->stateno; */ if (!isset(self::$yy_reduce_ofst[$stateno])) { return self::$yy_default[$stateno]; } $i = self::$yy_reduce_ofst[$stateno]; if ($i == self::YY_REDUCE_USE_DFLT) { return self::$yy_default[$stateno]; } if ($iLookAhead == self::YYNOCODE) { return self::YY_NO_ACTION; } $i += $iLookAhead; if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[$i] != $iLookAhead) { return self::$yy_default[$stateno]; } else { return self::$yy_action[$i]; } } /** * Perform a shift action. * @param int The new state to shift in * @param int The major token to shift in * @param mixed the minor token to shift in */ function yy_shift($yyNewState, $yyMajor, $yypMinor) { $this->yyidx++; if ($this->yyidx >= self::YYSTACKDEPTH) { $this->yyidx--; if (self::$yyTraceFILE) { fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt); } while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } /* Here code is inserted which will execute if the parser ** stack ever overflows */ return; } $yytos = new SearchCommandParseryyStackEntry; $yytos->stateno = $yyNewState; $yytos->major = $yyMajor; $yytos->minor = $yypMinor; array_push($this->yystack, $yytos); if (self::$yyTraceFILE && $this->yyidx > 0) { fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt, $yyNewState); fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt); for($i = 1; $i <= $this->yyidx; $i++) { fprintf(self::$yyTraceFILE, " %s", self::$yyTokenName[$this->yystack[$i]->major]); } fwrite(self::$yyTraceFILE,"\n"); } } /** * The following table contains information about every rule that * is used during the reduce. * * <pre> * array( * array( * int $lhs; Symbol on the left-hand side of the rule * int $nrhs; Number of right-hand side symbols in the rule * ),... * ); * </pre> */ static public $yyRuleInfo = array( array( 'lhs' => 28, 'rhs' => 1 ), array( 'lhs' => 27, 'rhs' => 3 ), array( 'lhs' => 27, 'rhs' => 3 ), array( 'lhs' => 27, 'rhs' => 2 ), array( 'lhs' => 27, 'rhs' => 3 ), array( 'lhs' => 27, 'rhs' => 3 ), array( 'lhs' => 27, 'rhs' => 6 ), array( 'lhs' => 27, 'rhs' => 4 ), array( 'lhs' => 27, 'rhs' => 4 ), array( 'lhs' => 27, 'rhs' => 5 ), array( 'lhs' => 27, 'rhs' => 3 ), array( 'lhs' => 32, 'rhs' => 0 ), array( 'lhs' => 32, 'rhs' => 1 ), array( 'lhs' => 29, 'rhs' => 6 ), array( 'lhs' => 29, 'rhs' => 1 ), array( 'lhs' => 31, 'rhs' => 1 ), array( 'lhs' => 31, 'rhs' => 3 ), array( 'lhs' => 33, 'rhs' => 3 ), array( 'lhs' => 33, 'rhs' => 1 ), array( 'lhs' => 30, 'rhs' => 1 ), array( 'lhs' => 30, 'rhs' => 1 ), array( 'lhs' => 30, 'rhs' => 1 ), array( 'lhs' => 30, 'rhs' => 1 ), array( 'lhs' => 30, 'rhs' => 1 ), array( 'lhs' => 30, 'rhs' => 2 ), array( 'lhs' => 30, 'rhs' => 2 ), array( 'lhs' => 30, 'rhs' => 1 ), ); /** * The following table contains a mapping of reduce action to method name * that handles the reduction. * * If a rule is not set, it has no handler. */ static public $yyReduceMap = array( 0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 16 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15, 17 => 17, 18 => 18, 19 => 19, 20 => 20, 21 => 21, 22 => 22, 23 => 23, 24 => 24, 25 => 25, 26 => 26, ); /* Beginning here are the reduction cases. A typical example ** follows: ** #line <lineno> <grammarfile> ** function yy_r0($yymsp){ ... } // User supplied code ** #line <lineno> <thisfile> */#line 53 "SearchCommandParser.y" function yy_r0(){ $this->expr_result = $this->yystack[$this->yyidx + 0]->minor; }#line 900 "SearchCommandParser.php"#line 58 "SearchCommandParser.y" function yy_r1(){ $this->_retvalue = new OpExpr($this->yystack[$this->yyidx + -2]->minor, ExprOp::OP_AND, $this->yystack[$this->yyidx + 0]->minor); }#line 905 "SearchCommandParser.php"#line 63 "SearchCommandParser.y" function yy_r2(){ $this->_retvalue = new OpExpr($this->yystack[$this->yyidx + -2]->minor, ExprOp::OP_OR, $this->yystack[$this->yyidx + 0]->minor); }#line 910 "SearchCommandParser.php"#line 68 "SearchCommandParser.y" function yy_r3(){ $expr = $this->yystack[$this->yyidx + 0]->minor; $expr->not(!$expr->not()); $this->_retvalue = $expr; }#line 917 "SearchCommandParser.php"#line 75 "SearchCommandParser.y" function yy_r4(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; }#line 922 "SearchCommandParser.php"#line 80 "SearchCommandParser.y" function yy_r5(){ $op = $this->yystack[$this->yyidx + -1]->minor; $not = false; if ($op == ExprOp::IS_NOT) { $op = ExprOp::IS; $not = true; } $fld = new OpExpr($this->yystack[$this->yyidx + -2]->minor, $op, $this->yystack[$this->yyidx + 0]->minor); $fld->not($not); $this->_retvalue = $fld; }#line 937 "SearchCommandParser.php"#line 95 "SearchCommandParser.y" function yy_r6(){ $expr = new OpExpr($this->yystack[$this->yyidx + -5]->minor, ExprOp::BETWEEN, new BetweenValueExpr($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor)); $expr->not($this->yystack[$this->yyidx + -4]->minor); $this->_retvalue=$expr; }#line 944 "SearchCommandParser.php"#line 102 "SearchCommandParser.y" function yy_r7(){ $expr = new OpExpr($this->yystack[$this->yyidx + -3]->minor, ExprOp::LIKE, $this->yystack[$this->yyidx + 0]->minor); $expr->not($this->yystack[$this->yyidx + -2]->minor); $this->_retvalue=$expr; }#line 951 "SearchCommandParser.php"#line 109 "SearchCommandParser.y" function yy_r8(){ $expr = new OpExpr($this->yystack[$this->yyidx + -3]->minor, ExprOp::IS, $this->yystack[$this->yyidx + 0]->minor); $expr->not($this->yystack[$this->yyidx + -1]->minor); $this->_retvalue=$expr; }#line 958 "SearchCommandParser.php"#line 116 "SearchCommandParser.y" function yy_r9(){ $expr = new OpExpr($this->yystack[$this->yyidx + -4]->minor, ExprOp::CONTAINS, $this->yystack[$this->yyidx + 0]->minor); $expr->not($this->yystack[$this->yyidx + -2]->minor); $this->_retvalue=$expr; }#line 965 "SearchCommandParser.php"#line 123 "SearchCommandParser.y" function yy_r10(){ $this->_retvalue = new OpExpr($this->yystack[$this->yyidx + -2]->minor, ExprOp::CONTAINS, $this->yystack[$this->yyidx + 0]->minor); }#line 970 "SearchCommandParser.php"#line 129 "SearchCommandParser.y" function yy_r11(){ $this->_retvalue = false; }#line 975 "SearchCommandParser.php"#line 134 "SearchCommandParser.y" function yy_r12(){ $this->_retvalue = true; }#line 980 "SearchCommandParser.php"#line 139 "SearchCommandParser.y" function yy_r13(){ $registry = ExprFieldRegistry::getRegistry(); $field = $registry->resolveMetadataField($this->yystack[$this->yyidx + -4]->minor, $this->yystack[$this->yyidx + -1]->minor); $this->_retvalue = $field; }#line 987 "SearchCommandParser.php"#line 146 "SearchCommandParser.y" function yy_r14(){ $registry = ExprFieldRegistry::getRegistry(); $field=$registry->resolveAlias($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = $field; }#line 994 "SearchCommandParser.php"#line 153 "SearchCommandParser.y" function yy_r15(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -