def p_service(p):
 thrift = thrift_stack[(-1)]
 if (len(p) == 8):
  extends = thrift
  for name in p[4].split('.'):
   extends = getattr(extends, name, None)
   if (extends is None):
    raise ThriftParserError(("Can't find service %r for service %r to extend" % (p[4], p[2])))
  if (not hasattr(extends, 'thrift_services')):
   raise ThriftParserError(("Can't extends %r, not a service" % p[4]))
 else:
  extends = None
 val = _make_service(p[2], p[(len(p) - 2)], extends)
 setattr(thrift, p[2], val)
 _add_thrift_meta('services', val)

def p_service ( p ) : thrift = thrift_stack [ ( - 1 ) ] if ( len ( p ) == 8 ) : extends = thrift for name in p [ 4 ] . split ( '.' ) : extends = getattr ( extends , name , None ) if ( extends is None ) : raise ThriftParserError ( ( "Can't find service %r for service %r to extend" % ( p [ 4 ] , p [ 2 ] ) ) ) if ( not hasattr ( extends , 'thrift_services' ) ) : raise ThriftParserError ( ( "Can't extends %r, not a service" % p [ 4 ] ) ) else : extends = None val = _make_service ( p [ 2 ] , p [ ( len ( p ) - 2 ) ] , extends ) setattr ( thrift , p [ 2 ] , val ) _add_thrift_meta ( 'services' , val )
service : service identifier { function_seq } | service identifier extends identifier { function_seq } .