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)):
  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 ) ) : p [ 0 ] = child else : raise ThriftParserError ( ( 'No enum value or constant found named %r' % p [ 1 ] ) )
const_ref : identifier .