def p_optional_policy(p): ''' optional_policy : OPT_POLICY OPAREN TICK interface_stmts SQUOTE CPAREN ''' o = refpolicy.OptionalPolicy() o.children = p[4] p[0] = [o]
def p_optional_policy(p): '''optional_policy : OPT_POLICY OPAREN TICK interface_stmts SQUOTE CPAREN | OPT_POLICY OPAREN TICK interface_stmts SQUOTE COMMA TICK interface_stmts SQUOTE CPAREN ''' o = refpolicy.OptionalPolicy() collect(p[4], o, val=True) if len(p) > 7: collect(p[8], o, val=False) p[0] = [o]