def p_definition_token(p):
 for i in p[3]:
  if (i[0] not in '\'"'):
   tokenlist.append(i)
 if (p[1] == '%left'):
  preclist.append((('left',) + tuple(p[3])))
 elif (p[1] == '%right'):
  preclist.append((('right',) + tuple(p[3])))
 elif (p[1] == '%nonassoc'):
  preclist.append((('nonassoc',) + tuple(p[3])))

def p_definition_token ( p ) : for i in p [ 3 ] : if ( i [ 0 ] not in '\'"' ) : tokenlist . append ( i ) if ( p [ 1 ] == '%left' ) : preclist . append ( ( ( 'left' , ) + tuple ( p [ 3 ] ) ) ) elif ( p [ 1 ] == '%right' ) : preclist . append ( ( ( 'right' , ) + tuple ( p [ 3 ] ) ) ) elif ( p [ 1 ] == '%nonassoc' ) : preclist . append ( ( ( 'nonassoc' , ) + tuple ( p [ 3 ] ) ) )
definition : toktype opttype idlist optsemi .