OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [ld/] [ldlex.l] - Diff between revs 157 and 166

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 157 Rev 166
Line 1... Line 1...
%option nounput
%option nounput
 
 
%{
%{
 
 
/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
   Free Software Foundation, Inc.
   Free Software Foundation, Inc.
   Written by Steve Chamberlain of Cygnus Support.
   Written by Steve Chamberlain of Cygnus Support.
 
 
   This file is part of the GNU Binutils.
   This file is part of the GNU Binutils.
 
 
Line 446... Line 446...
 
 
[ \t\r]+        { /* Eat up whitespace */ }
[ \t\r]+        { /* Eat up whitespace */ }
 
 
<> {
<> {
  include_stack_ptr--;
  include_stack_ptr--;
 
 
  if (include_stack_ptr == 0)
  if (include_stack_ptr == 0)
  {
 
    yyterminate ();
    yyterminate ();
  }
 
  else
  else
  {
 
    yy_switch_to_buffer (include_stack[include_stack_ptr]);
    yy_switch_to_buffer (include_stack[include_stack_ptr]);
  }
 
 
 
  ldfile_input_filename = file_name_stack[include_stack_ptr - 1];
 
  lineno = lineno_stack[include_stack_ptr];
  lineno = lineno_stack[include_stack_ptr];
 
 
  return END;
  return END;
}
}
 
 
Line 532... Line 526...
 
 
/* Switch flex to reading from STRING, saving the current input info
/* Switch flex to reading from STRING, saving the current input info
   on the include stack.  */
   on the include stack.  */
 
 
void
void
lex_redirect (const char *string)
lex_redirect (const char *string, const char *fake_filename, unsigned int count)
{
{
  YY_BUFFER_STATE tmp;
  YY_BUFFER_STATE tmp;
 
 
  yy_init = 0;
  yy_init = 0;
  if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
  if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
    {
    {
      einfo("%F: macros nested too deeply\n");
      einfo("%F: macros nested too deeply\n");
    }
    }
  file_name_stack[include_stack_ptr] = "redirect";
  file_name_stack[include_stack_ptr] = fake_filename;
  lineno_stack[include_stack_ptr] = lineno;
  lineno_stack[include_stack_ptr] = lineno;
  include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
  include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
  include_stack_ptr++;
  include_stack_ptr++;
  lineno = 1;
  lineno = count;
  tmp = yy_create_string_buffer (string, strlen (string));
  tmp = yy_create_string_buffer (string, strlen (string));
  yy_switch_to_buffer (tmp);
  yy_switch_to_buffer (tmp);
}
}


/* Functions to switch to a different flex start condition,
/* Functions to switch to a different flex start condition,
Line 611... Line 605...
ldlex_popstate (void)
ldlex_popstate (void)
{
{
  yy_start = *(--state_stack_p);
  yy_start = *(--state_stack_p);
}
}


 
/* Return the current file name, or the previous file if no file is
 
   current.  */
 
 
 
const char*
 
ldlex_filename (void)
 
{
 
  return file_name_stack[include_stack_ptr - (include_stack_ptr != 0)];
 
}
 

 
 
/* Place up to MAX_SIZE characters in BUF and return
/* Place up to MAX_SIZE characters in BUF and return
   either the number of characters read, or 0 to indicate EOF.  */
   either the number of characters read, or 0 to indicate EOF.  */
 
 
static int
static int
Line 683... Line 686...
     an invalid character, then most likely this is a real object file
     an invalid character, then most likely this is a real object file
     of some different format.  Treat it as such.  */
     of some different format.  Treat it as such.  */
  if (ldfile_assumed_script)
  if (ldfile_assumed_script)
    {
    {
      bfd_set_error (bfd_error_file_not_recognized);
      bfd_set_error (bfd_error_file_not_recognized);
      einfo ("%F%s: file not recognized: %E\n", ldfile_input_filename);
      einfo ("%F%s: file not recognized: %E\n", ldlex_filename ());
    }
    }
 
 
  if (! ISPRINT (*what))
  if (! ISPRINT (*what))
    {
    {
      sprintf (buf, "\\%03o", *(unsigned char *) what);
      sprintf (buf, "\\%03o", *(unsigned char *) what);
      what = buf;
      what = buf;
    }
    }
 
 
  einfo ("%P:%S: ignoring invalid character `%s'%s\n", what, where);
  einfo ("%P:%S: ignoring invalid character `%s'%s\n", NULL, what, where);
}
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.