def p_initializer_list(p):
'''initializer_list : initializer_clause
| initializer_list ',' initializer_clause
'''
pass
#---------------------------------------------------------------------------------------------------
# A.8 Classes
#---------------------------------------------------------------------------------------------------
#
# An anonymous bit-field declaration may look very like inheritance:
# const int B = 3;
# class A : B ;
# The two usages are too distant to try to create and enforce a common prefix so we have to resort to
# a parser hack by backtracking. Inheritance is much the most likely so we mark the input stream context
# and try to parse a base-clause. If we successfully reach a { the base-clause is ok and inheritance was
# the correct choice so we unmark and continue. If we fail to find the { an error token causes
# back-tracking to the alternative parse in elaborated_type_specifier which regenerates the : and
# declares unconditional success.
#
评论列表
文章目录