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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [gengtype.h] - Diff between revs 280 and 338

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 280 Rev 338
/* Process source files and output type information.
/* Process source files and output type information.
   Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
   Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
 
 
This file is part of GCC.
This file is part of GCC.
 
 
GCC is free software; you can redistribute it and/or modify it under
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
Software Foundation; either version 3, or (at your option) any later
version.
version.
 
 
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.
for more details.
 
 
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  */
<http://www.gnu.org/licenses/>.  */
 
 
#ifndef GCC_GENGTYPE_H
#ifndef GCC_GENGTYPE_H
#define GCC_GENGTYPE_H
#define GCC_GENGTYPE_H
 
 
/* A file position, mostly for error messages.
/* A file position, mostly for error messages.
   The FILE element may be compared using pointer equality.  */
   The FILE element may be compared using pointer equality.  */
struct fileloc {
struct fileloc {
  const char *file;
  const char *file;
  int line;
  int line;
};
};
 
 
/* Data types handed around within, but opaque to, the lexer and parser.  */
/* Data types handed around within, but opaque to, the lexer and parser.  */
typedef struct pair *pair_p;
typedef struct pair *pair_p;
typedef struct type *type_p;
typedef struct type *type_p;
typedef const struct type *const_type_p;
typedef const struct type *const_type_p;
typedef struct options *options_p;
typedef struct options *options_p;
 
 
/* Variables used to communicate between the lexer and the parser.  */
/* Variables used to communicate between the lexer and the parser.  */
extern int lexer_toplevel_done;
extern int lexer_toplevel_done;
extern struct fileloc lexer_line;
extern struct fileloc lexer_line;
 
 
/* Print an error message.  */
/* Print an error message.  */
extern void error_at_line
extern void error_at_line
  (struct fileloc *pos, const char *msg, ...) ATTRIBUTE_PRINTF_2;
  (struct fileloc *pos, const char *msg, ...) ATTRIBUTE_PRINTF_2;
 
 
/* Like asprintf, but calls fatal() on out of memory.  */
/* Like asprintf, but calls fatal() on out of memory.  */
extern char *xasprintf(const char *, ...) ATTRIBUTE_PRINTF_1;
extern char *xasprintf(const char *, ...) ATTRIBUTE_PRINTF_1;
 
 
/* Constructor routines for types.  */
/* Constructor routines for types.  */
extern void do_typedef (const char *s, type_p t, struct fileloc *pos);
extern void do_typedef (const char *s, type_p t, struct fileloc *pos);
extern void do_scalar_typedef (const char *s, struct fileloc *pos);
extern void do_scalar_typedef (const char *s, struct fileloc *pos);
extern type_p resolve_typedef (const char *s, struct fileloc *pos);
extern type_p resolve_typedef (const char *s, struct fileloc *pos);
extern type_p new_structure (const char *name, int isunion,
extern type_p new_structure (const char *name, int isunion,
                             struct fileloc *pos, pair_p fields,
                             struct fileloc *pos, pair_p fields,
                             options_p o);
                             options_p o);
extern type_p find_structure (const char *s, int isunion);
extern type_p find_structure (const char *s, int isunion);
extern type_p create_scalar_type (const char *name);
extern type_p create_scalar_type (const char *name);
extern type_p create_pointer (type_p t);
extern type_p create_pointer (type_p t);
extern type_p create_array (type_p t, const char *len);
extern type_p create_array (type_p t, const char *len);
extern options_p create_option (options_p, const char *name, const void *info);
extern options_p create_option (options_p, const char *name, const void *info);
extern options_p create_nested_ptr_option (options_p, type_p t,
extern options_p create_nested_ptr_option (options_p, type_p t,
                                           const char *from, const char *to);
                                           const char *from, const char *to);
extern pair_p create_field_at (pair_p next, type_p type, const char *name,
extern pair_p create_field_at (pair_p next, type_p type, const char *name,
                               options_p opt, struct fileloc *pos);
                               options_p opt, struct fileloc *pos);
extern pair_p nreverse_pairs (pair_p list);
extern pair_p nreverse_pairs (pair_p list);
extern type_p adjust_field_type (type_p, options_p);
extern type_p adjust_field_type (type_p, options_p);
extern void note_variable (const char *s, type_p t, options_p o,
extern void note_variable (const char *s, type_p t, options_p o,
                           struct fileloc *pos);
                           struct fileloc *pos);
extern void note_def_vec (const char *type_name, bool is_scalar,
extern void note_def_vec (const char *type_name, bool is_scalar,
                          struct fileloc *pos);
                          struct fileloc *pos);
extern void note_def_vec_alloc (const char *type, const char *astrat,
extern void note_def_vec_alloc (const char *type, const char *astrat,
                                struct fileloc *pos);
                                struct fileloc *pos);
 
 
/* Lexer and parser routines.  */
/* Lexer and parser routines.  */
extern int yylex (const char **yylval);
extern int yylex (const char **yylval);
extern void yybegin (const char *fname);
extern void yybegin (const char *fname);
extern void yyend (void);
extern void yyend (void);
extern void parse_file (const char *name);
extern void parse_file (const char *name);
extern bool hit_error;
extern bool hit_error;
 
 
/* Token codes.  */
/* Token codes.  */
enum {
enum {
  EOF_TOKEN = 0,
  EOF_TOKEN = 0,
 
 
  /* Per standard convention, codes in the range (0, UCHAR_MAX]
  /* Per standard convention, codes in the range (0, UCHAR_MAX]
     represent single characters with those character codes.  */
     represent single characters with those character codes.  */
 
 
  CHAR_TOKEN_OFFSET = UCHAR_MAX + 1,
  CHAR_TOKEN_OFFSET = UCHAR_MAX + 1,
  GTY_TOKEN = CHAR_TOKEN_OFFSET,
  GTY_TOKEN = CHAR_TOKEN_OFFSET,
  TYPEDEF,
  TYPEDEF,
  EXTERN,
  EXTERN,
  STATIC,
  STATIC,
  UNION,
  UNION,
  STRUCT,
  STRUCT,
  ENUM,
  ENUM,
  VEC_TOKEN,
  VEC_TOKEN,
  DEFVEC_OP,
  DEFVEC_OP,
  DEFVEC_I,
  DEFVEC_I,
  DEFVEC_ALLOC,
  DEFVEC_ALLOC,
  ELLIPSIS,
  ELLIPSIS,
  PTR_ALIAS,
  PTR_ALIAS,
  NESTED_PTR,
  NESTED_PTR,
  PARAM_IS,
  PARAM_IS,
  NUM,
  NUM,
  SCALAR,
  SCALAR,
  ID,
  ID,
  STRING,
  STRING,
  CHAR,
  CHAR,
  ARRAY,
  ARRAY,
 
 
  /* print_token assumes that any token >= FIRST_TOKEN_WITH_VALUE may have
  /* print_token assumes that any token >= FIRST_TOKEN_WITH_VALUE may have
     a meaningful value to be printed.  */
     a meaningful value to be printed.  */
  FIRST_TOKEN_WITH_VALUE = PARAM_IS
  FIRST_TOKEN_WITH_VALUE = PARAM_IS
};
};
#endif
#endif
 
 

powered by: WebSVN 2.1.0

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