ReactOS  0.4.14-dev-114-gc8cbd56
parser.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  interface_info_t
 

Macros

#define parse_only   import_stack_ptr
 

Functions

int parser_parse (void)
 
int parser_lex (void)
 
int do_import (char *fname)
 
void abort_import (void)
 
void pop_import (void)
 
int is_type (const char *name)
 
int do_warning (char *toggle, warning_list_t *wnum)
 
int is_warning_enabled (int warning)
 

Variables

FILEparser_in = (FILE *) 0
 
charparser_text
 
int parser_debug
 
int yy_flex_debug
 
int import_stack_ptr
 
chartemp_name
 

Macro Definition Documentation

◆ parse_only

#define parse_only   import_stack_ptr

Definition at line 44 of file parser.h.

Function Documentation

◆ abort_import()

void abort_import ( void  )

Definition at line 2705 of file parser.yy.c.

2706 {
2707  int ptr;
2708 
2709  for (ptr=0; ptr<import_stack_ptr; ptr++)
2711 }
#define unlink
Definition: syshdrs.h:54
static PVOID ptr
Definition: dispmode.c:27
struct @4030 import_stack[MAX_IMPORT_DEPTH]
int import_stack_ptr
Definition: parser.yy.c:778
char * temp_name
Definition: parser.yy.c:776

Referenced by rm_tempfile().

◆ do_import()

int do_import ( char fname)

Definition at line 2650 of file parser.yy.c.

2651 {
2652  FILE *f;
2653  char *path, *name;
2654  struct imports *import;
2655  int ptr = import_stack_ptr;
2656  int ret, fd;
2657 
2658  import = first_import;
2659  while (import && strcmp(import->name, fname))
2660  import = import->next;
2661  if (import) return 0; /* already imported */
2662 
2663  import = xmalloc(sizeof(struct imports));
2664  import->name = xstrdup(fname);
2665  import->next = first_import;
2666  first_import = import;
2667 
2668  /* don't search for a file name with a path in the include directories,
2669  * for compatibility with MIDL */
2670  if (strchr( fname, '/' ) || strchr( fname, '\\' ))
2671  path = xstrdup( fname );
2672  else if (!(path = wpp_find_include( fname, input_name )))
2673  error_loc("Unable to open include file %s\n", fname);
2674 
2676  error_loc("Exceeded max import depth\n");
2677 
2678  import_stack[ptr].temp_name = temp_name;
2679  import_stack[ptr].input_name = input_name;
2680  import_stack[ptr].line_number = line_number;
2681  import_stack_ptr++;
2682  input_name = path;
2683  line_number = 1;
2684 
2685  name = xstrdup( "widl.XXXXXX" );
2686  if((fd = mkstemps( name, 0 )) == -1)
2687  error("Could not generate a temp name from %s\n", name);
2688 
2689  temp_name = name;
2690  if (!(f = fdopen(fd, "wt")))
2691  error("Could not open fd %s for writing\n", name);
2692 
2693  ret = wpp_parse( path, f );
2694  fclose( f );
2695  if (ret) exit(1);
2696 
2697  if((f = fopen(temp_name, "r")) == NULL)
2698  error_loc("Unable to open %s\n", temp_name);
2699 
2702  return 1;
2703 }
#define error(str)
Definition: mkdosfs.c:1605
#define YY_CURRENT_BUFFER
Definition: parser.yy.c:283
GLsizei const GLchar ** path
Definition: glext.h:7234
#define MAX_IMPORT_DEPTH
Definition: parser.yy.c:771
char * wpp_find_include(const char *name, const char *parent_name)
Definition: preproc.c:509
static int fd
Definition: io.c:51
int line_number
Definition: parser.yy.c:775
void parser__switch_to_buffer(YY_BUFFER_STATE new_buffer)
Definition: parser.yy.c:1805
void * xmalloc(int size)
Definition: uimain.c:747
static PVOID ptr
Definition: dispmode.c:27
void error_loc(const char *s,...)
Definition: utils.c:69
smooth NULL
Definition: ftsmooth.c:416
#define YY_BUF_SIZE
Definition: parser.yy.c:164
GLfloat f
Definition: glext.h:7540
struct @4030 import_stack[MAX_IMPORT_DEPTH]
YY_BUFFER_STATE parser__create_buffer(FILE *file, int size)
Definition: parser.yy.c:1850
int import_stack_ptr
Definition: parser.yy.c:778
int ret
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
#define f
Definition: ke_i.h:83
Definition: services.c:325
_Check_return_ _CRTIMP FILE *__cdecl fdopen(_In_ int _FileHandle, _In_z_ const char *_Format)
int mkstemps(char *template, int suffix_len)
Definition: mkstemps.c:73
char * temp_name
Definition: parser.yy.c:776
struct imports * first_import
char * strchr(const char *String, int ch)
Definition: utclib.c:501
Definition: name.c:36
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
void exit(int exitcode)
Definition: _exit.c:33
char * xstrdup(const char *s)
Definition: uimain.c:768
int wpp_parse(const char *input, FILE *output)
Definition: wpp.c:184
char * input_name
Definition: parser.yy.c:774
GLuint const GLchar * name
Definition: glext.h:6031

◆ do_warning()

int do_warning ( char toggle,
warning_list_t wnum 
)

Definition at line 2768 of file parser.yy.c.

2769 {
2770  warning_t *warning, *next;
2771  int ret = 1;
2772  if(!disabled_warnings)
2773  {
2776  }
2777 
2778  if(!strcmp(toggle, "disable"))
2780  warning_disable(warning->num);
2781  else if(!strcmp(toggle, "enable"))
2783  warning_enable(warning->num);
2784  else
2785  ret = 0;
2786 
2788  free(warning);
2789  return ret;
2790 }
#define free
Definition: debug_ros.c:5
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
void * xmalloc(int size)
Definition: uimain.c:747
static warning_list_t * disabled_warnings
Definition: parser.yy.c:769
static void warning_disable(int warning)
Definition: parser.yy.c:2745
static void warning_enable(int warning)
Definition: parser.yy.c:2756
int ret
uint32_t entry
Definition: isohybrid.c:63
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define warning(s)
Definition: debug.h:71

Referenced by yyparse().

◆ is_type()

int is_type ( const char name)

Definition at line 6173 of file parser.tab.c.

6174 {
6175  return find_type(name, current_namespace, 0) != NULL;
6176 }
smooth NULL
Definition: ftsmooth.c:416
type_t * find_type(const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:6139
static struct namespace * current_namespace
Definition: parser.tab.c:210
Definition: name.c:36

Referenced by kw_token().

◆ is_warning_enabled()

int is_warning_enabled ( int  warning)

Definition at line 2792 of file parser.yy.c.

2793 {
2794  warning_t *warning_entry;
2795  if(!disabled_warnings)
2796  return 1;
2798  if(warning_entry->num == warning)
2799  return 0;
2800  return 1;
2801 }
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static warning_list_t * disabled_warnings
Definition: parser.yy.c:769
uint32_t entry
Definition: isohybrid.c:63
#define warning(s)
Definition: debug.h:71

Referenced by ctl2_alloc_guid().

◆ parser_lex()

int parser_lex ( void  )

◆ parser_parse()

int parser_parse ( void  )

◆ pop_import()

void pop_import ( void  )

Definition at line 2628 of file parser.yy.c.

2629 {
2630  int ptr = import_stack_ptr-1;
2631 
2632  fclose(parser_in);
2635  if (temp_name) {
2636  unlink(temp_name);
2637  free(temp_name);
2638  }
2639  temp_name = import_stack[ptr].temp_name;
2640  input_name = import_stack[ptr].input_name;
2641  line_number = import_stack[ptr].line_number;
2642  import_stack_ptr--;
2643 }
void parser__delete_buffer(YY_BUFFER_STATE b)
Definition: parser.yy.c:1878
FILE * parser_in
Definition: parser.yy.c:357
#define YY_CURRENT_BUFFER
Definition: parser.yy.c:283
#define free
Definition: debug_ros.c:5
#define unlink
Definition: syshdrs.h:54
int line_number
Definition: parser.yy.c:775
void parser__switch_to_buffer(YY_BUFFER_STATE new_buffer)
Definition: parser.yy.c:1805
static PVOID ptr
Definition: dispmode.c:27
struct @4030 import_stack[MAX_IMPORT_DEPTH]
int import_stack_ptr
Definition: parser.yy.c:778
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
char * temp_name
Definition: parser.yy.c:776
YY_BUFFER_STATE state
Definition: parser.yy.c:773
char * input_name
Definition: parser.yy.c:774

Referenced by yyparse().

Variable Documentation

◆ import_stack_ptr

int import_stack_ptr

Definition at line 778 of file parser.yy.c.

Referenced by abort_import(), do_import(), pop_import(), switch_to_acf(), and while().

◆ parser_debug

int parser_debug

Definition at line 111 of file widl.c.

Referenced by main(), and wpp_set_debug().

◆ parser_in

FILE * parser_in = (FILE *) 0

Definition at line 357 of file parser.yy.c.

Referenced by main().

◆ parser_text

char * parser_text

Definition at line 703 of file parser.yy.c.

Referenced by init_loc_info().

◆ temp_name

char* temp_name

◆ yy_flex_debug

int yy_flex_debug

Definition at line 111 of file widl.c.

Referenced by main().