What is the lexer naming convention?

    function yy_r9_1($yy_subpatterns)
    {

  $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;  
  $this->yypopstate();
    }

Above from smarty vocabulary in PHP, does anyone know what that means yy_r9_1?

+3
source share
1 answer

yyis a YACC prefix to avoid collisions. In the days when the YACC was built, there were no namespaces or classes, not even structures. In fact, YACC was originally written in B, the predecessor of C.

r9probably means rule number 9, and 1may be an incremental prefix for rules that need to handle multiple functions.

, , - , , . , , . , , .

+1

Source: https://habr.com/ru/post/1786586/


All Articles