(p)
const_ref : IDENTIFIER
const_ref : IDENTIFIER
const_ref : IDENTIFIER
def p_const_ref(p):
    '''const_ref : IDENTIFIER'''
    child = thrift_stack[-1]
    for name in p[1].split('.'):
        father = child
        child = getattr(child, name, None)
        if child is None:
            raise ThriftParserError('Cann\'t find name %r at line %d'
                                    % (p[1], p.lineno(1)))

    if _get_ttype(child) is None or _get_ttype(father) == TType.I32:
        # child is a constant or enum value
        p[0] = child
    else:
        raise ThriftParserError('No enum value or constant found '
                                'named %r' % p[1])
def p_const_ref ( p ) : child = thrift_stack [ - 1 ] for name in p [ 1 ] . split ( '.' ) : father = child child = getattr ( child , name , None ) if child is None : raise ThriftParserError ( 'Cann\'t find name %r at line %d' % ( p [ 1 ] , p . lineno ( 1 ) ) ) if _get_ttype ( child ) is None or _get_ttype ( father ) == TType . I32 : # child is a constant or enum value p [ 0 ] = child else : raise ThriftParserError ( 'No enum value or constant found ' 'named %r' % p [ 1 ] )