0
Yacc/Bison에서 부모 규칙을 어떻게 알 수 있습니까 그에 따라 조치를 취할 수 있습니까? 예를 들어Yacc/Bison 상위 규칙
:
Module
:ModuleName "=" Functions
Functions
:Functions Function
| Function
Function
: DEF ID ARGS BODY
{
/* here, I would like to identify the parent rule and do something like this*/
if ($parent_rule == "Module") {
/* take some actions */
} else {
/* this means the Function is matched recursively from the Functions rule. */
}
}