试图了解如何聪明地编译

时间:2010-12-29 09:00:02

标签: php smarty

有人可以解释这些数组的含义吗?

$yy_action

$yy_lookahead

$yy_shift_ofst

$yy_reduce_ofst

$yyExpectedTokens

$yy_default

$yyRuleInfo

$yyReduceMap

更新

以下是什么意思?

** 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.

1 个答案:

答案 0 :(得分:0)

http://code.google.com/p/smarty-php/source/browse/branches/Smarty3Dev/development/lexer/Lempar+Original.php?r=3662所示,这些是

  

...用于根据当前状态和先行标记确定要采取的操作的表。这些表用于实现采用状态编号和先行值并返回操作整数的函数。