📄 searchcommandparser.php
字号:
<?php
/* Driver template for the PHP_SearchCommandParserrGenerator parser generator. (PHP port of LEMON)
*/
/**
* This can be used to store both the string representation of
* a token, and any useful meta-data associated with the token.
*
* meta-data should be stored as an array
*/
class SearchCommandParseryyToken implements ArrayAccess
{
public $string = '';
public $metadata = array();
function __construct($s, $m = array())
{
if ($s instanceof SearchCommandParseryyToken) {
$this->string = $s->string;
$this->metadata = $s->metadata;
} else {
$this->string = (string) $s;
if ($m instanceof SearchCommandParseryyToken) {
$this->metadata = $m->metadata;
} elseif (is_array($m)) {
$this->metadata = $m;
}
}
}
function __toString()
{
return $this->_string;
}
function offsetExists($offset)
{
return isset($this->metadata[$offset]);
}
function offsetGet($offset)
{
return $this->metadata[$offset];
}
function offsetSet($offset, $value)
{
if ($offset === null) {
if (isset($value[0])) {
$x = ($value instanceof SearchCommandParseryyToken) ?
$value->metadata : $value;
$this->metadata = array_merge($this->metadata, $x);
return;
}
$offset = count($this->metadata);
}
if ($value === null) {
return;
}
if ($value instanceof SearchCommandParseryyToken) {
if ($value->metadata) {
$this->metadata[$offset] = $value->metadata;
}
} elseif ($value) {
$this->metadata[$offset] = $value;
}
}
function offsetUnset($offset)
{
unset($this->metadata[$offset]);
}
}
/** The following structure represents a single element of the
* parser's stack. Information stored includes:
*
* + The state number for the parser at this level of the stack.
*
* + The value of the token stored at this level of the stack.
* (In other words, the "major" token.)
*
* + The semantic value stored at this level of the stack. This is
* the information used by the action routines in the grammar.
* It is sometimes called the "minor" token.
*/
class SearchCommandParseryyStackEntry
{
public $stateno; /* The state-number */
public $major; /* The major token value. This is the code
** number for the token at this stack level */
public $minor; /* The user-supplied minor token value. This
** is the value of the token */
};
// code external to the class is included here
// declare_class is output here
#line 2 "SearchCommandParser.y"
class SearchCommandParser#line 102 "SearchCommandParser.php"
{
/* First off, code is included which follows the "include_class" declaration
** in the input file. */
#line 4 "SearchCommandParser.y"
private $expr_result;
private $parse_result;
public function __construct()
{
$this->parse_result = 'ok';
}
public function getExprResult()
{
return $this->expr_result;
}
public function isExprOk()
{
return $this->parse_result == 'ok';
}
#line 128 "SearchCommandParser.php"
/* Next is all token values, as class constants
*/
/*
** These constants (all generated automatically by the parser generator)
** specify the various kinds of tokens (terminals) that the parser
** understands.
**
** Each symbol here is a terminal symbol in the grammar.
*/
const OPOR = 1;
const OPAND = 2;
const NOT = 3;
const IS = 4;
const CONTAIN = 5;
const LIKE = 6;
const BETWEEN = 7;
const START = 8;
const END = 9;
const GT = 10;
const LE = 11;
const LT = 12;
const GE = 13;
const PAR_OPEN = 14;
const PAR_CLOSE = 15;
const DOES = 16;
const CONTAINS = 17;
const COLON = 18;
const SQUARE_OPEN = 19;
const SQUARE_CLOSE = 20;
const TERMINAL = 21;
const VALUE = 22;
const COMMA = 23;
const WITH = 24;
const IS_NOT = 25;
const YY_NO_ACTION = 84;
const YY_ACCEPT_ACTION = 83;
const YY_ERROR_ACTION = 82;
/* Next are that tables used to determine what action to take based on the
** current state and lookahead token. These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.
**
** Suppose the action integer is N. Then the action is determined as
** follows
**
** 0 <= N < self::YYNSTATE Shift N. That is,
** push the lookahead
** token onto the stack
** and goto state N.
**
** self::YYNSTATE <= N < self::YYNSTATE+self::YYNRULE Reduce by rule N-YYNSTATE.
**
** N == self::YYNSTATE+self::YYNRULE A syntax error has occurred.
**
** N == self::YYNSTATE+self::YYNRULE+1 The parser accepts its
** input. (and concludes parsing)
**
** N == self::YYNSTATE+self::YYNRULE+2 No such action. Denotes unused
** slots in the yy_action[] table.
**
** The action table is constructed as a single large static array $yy_action.
** Given state S and lookahead X, the action is computed as
**
** self::$yy_action[self::$yy_shift_ofst[S] + X ]
**
** If the index value self::$yy_shift_ofst[S]+X is out of range or if the value
** self::$yy_lookahead[self::$yy_shift_ofst[S]+X] is not equal to X or if
** self::$yy_shift_ofst[S] is equal to self::YY_SHIFT_USE_DFLT, it means that
** the action is not in the table and that self::$yy_default[S] should be used instead.
**
** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
** a reduce action) then the static $yy_reduce_ofst array is used in place of
** the static $yy_shift_ofst array and self::YY_REDUCE_USE_DFLT is used in place of
** self::YY_SHIFT_USE_DFLT.
**
** The following are the tables generated in this section:
**
** self::$yy_action A single table containing all actions.
** self::$yy_lookahead A table containing the lookahead for each entry in
** yy_action. Used to detect hash collisions.
** self::$yy_shift_ofst For each state, the offset into self::$yy_action for
** shifting terminals.
** self::$yy_reduce_ofst For each state, the offset into self::$yy_action for
** shifting non-terminals after a reduce.
** self::$yy_default Default action for each state.
*/
const YY_SZ_ACTTAB = 70;
static public $yy_action = array(
/* 0 */ 52, 15, 3, 5, 39, 23, 22, 37, 34, 54,
/* 10 */ 33, 47, 4, 16, 50, 9, 44, 21, 83, 1,
/* 20 */ 8, 7, 36, 2, 3, 5, 6, 17, 13, 26,
/* 30 */ 32, 1, 35, 27, 19, 41, 1, 46, 14, 1,
/* 40 */ 20, 38, 45, 5, 1, 10, 12, 31, 42, 24,
/* 50 */ 53, 18, 28, 30, 52, 63, 49, 63, 63, 63,
/* 60 */ 63, 48, 29, 40, 63, 43, 51, 63, 11, 25,
);
static public $yy_lookahead = array(
/* 0 */ 3, 4, 1, 2, 24, 8, 9, 10, 11, 12,
/* 10 */ 13, 33, 3, 16, 17, 18, 15, 27, 28, 29,
/* 20 */ 6, 7, 25, 14, 1, 2, 2, 14, 19, 27,
/* 30 */ 21, 29, 20, 22, 27, 22, 29, 27, 30, 29,
/* 40 */ 32, 24, 27, 2, 29, 19, 17, 20, 15, 33,
/* 50 */ 31, 23, 31, 31, 3, 34, 31, 34, 34, 34,
/* 60 */ 34, 31, 31, 31, 34, 31, 31, 34, 32, 32,
);
const YY_SHIFT_USE_DFLT = -21;
const YY_SHIFT_MAX = 31;
static public $yy_shift_ofst = array(
/* 0 */ 9, -3, 9, 9, 9, 9, 13, 13, 13, 13,
/* 10 */ 13, 13, 13, 13, 13, 51, 51, 11, 11, 1,
/* 20 */ 14, 23, 17, -20, 33, 29, 41, 28, 27, 24,
/* 30 */ 12, 26,
);
const YY_REDUCE_USE_DFLT = -23;
const YY_REDUCE_MAX = 18;
static public $yy_reduce_ofst = array(
/* 0 */ -10, 8, 7, 2, 10, 15, 30, 31, 32, 25,
/* 10 */ 22, 19, 35, 21, 34, 36, 37, 16, -22,
);
static public $yyExpectedTokens = array(
/* 0 */ array(3, 14, 19, 21, ),
/* 1 */ array(3, 4, 8, 9, 10, 11, 12, 13, 16, 17, 18, 25, ),
/* 2 */ array(3, 14, 19, 21, ),
/* 3 */ array(3, 14, 19, 21, ),
/* 4 */ array(3, 14, 19, 21, ),
/* 5 */ array(3, 14, 19, 21, ),
/* 6 */ array(14, 22, ),
/* 7 */ array(14, 22, ),
/* 8 */ array(14, 22, ),
/* 9 */ array(14, 22, ),
/* 10 */ array(14, 22, ),
/* 11 */ array(14, 22, ),
/* 12 */ array(14, 22, ),
/* 13 */ array(14, 22, ),
/* 14 */ array(14, 22, ),
/* 15 */ array(3, ),
/* 16 */ array(3, ),
/* 17 */ array(22, ),
/* 18 */ array(22, ),
/* 19 */ array(1, 2, 15, ),
/* 20 */ array(6, 7, ),
/* 21 */ array(1, 2, ),
/* 22 */ array(24, ),
/* 23 */ array(24, ),
/* 24 */ array(15, ),
/* 25 */ array(17, ),
/* 26 */ array(2, ),
/* 27 */ array(23, ),
/* 28 */ array(20, ),
/* 29 */ array(2, ),
/* 30 */ array(20, ),
/* 31 */ array(19, ),
/* 32 */ array(),
/* 33 */ array(),
/* 34 */ array(),
/* 35 */ array(),
/* 36 */ array(),
/* 37 */ array(),
/* 38 */ array(),
/* 39 */ array(),
/* 40 */ array(),
/* 41 */ array(),
/* 42 */ array(),
/* 43 */ array(),
/* 44 */ array(),
/* 45 */ array(),
/* 46 */ array(),
/* 47 */ array(),
/* 48 */ array(),
/* 49 */ array(),
/* 50 */ array(),
/* 51 */ array(),
/* 52 */ array(),
/* 53 */ array(),
/* 54 */ array(),
);
static public $yy_default = array(
/* 0 */ 82, 66, 82, 82, 82, 82, 82, 82, 82, 82,
/* 10 */ 82, 82, 82, 82, 82, 66, 66, 82, 82, 82,
/* 20 */ 82, 55, 82, 82, 82, 82, 57, 73, 82, 82,
/* 30 */ 82, 82, 69, 78, 77, 68, 81, 76, 80, 79,
/* 40 */ 62, 70, 71, 60, 59, 56, 58, 72, 61, 65,
/* 50 */ 74, 64, 67, 63, 75,
);
/* The next thing included is series of defines which control
** various aspects of the generated parser.
** self::YYNOCODE is a number which corresponds
** to no legal terminal or nonterminal number. This
** number is used to fill in empty slots of the hash
** table.
** self::YYFALLBACK If defined, this indicates that one or more tokens
** have fall-back values which should be used if the
** original value of the token will not parse.
** self::YYSTACKDEPTH is the maximum depth of the parser's stack.
** self::YYNSTATE the combined number of states.
** self::YYNRULE the number of rules in the grammar
** self::YYERRORSYMBOL is the code number of the error symbol. If not
** defined, then do no error processing.
*/
const YYNOCODE = 35;
const YYSTACKDEPTH = 100;
const YYNSTATE = 55;
const YYNRULE = 27;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -