home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume6 / rpc2 / part10 / rpc / rpcgen / rpc_parse.h < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  2.1 KB  |  135 lines

  1. /* @(#)rpc_parse.h 1.1 86/03/26 (C) 1986 SMI */
  2.  
  3. /*
  4.  * rpc_parse.h, Definitions for the RPCL parser 
  5.  * Copyright (C) 1986, Sun Microsystems, Inc.
  6.  */
  7.  
  8. enum defkind {
  9.     DEF_ARRAY,
  10.     DEF_STRUCT,
  11.     DEF_UNION,
  12.     DEF_ENUM,
  13.     DEF_TYPEDEF,
  14.     DEF_PROGRAM
  15. };
  16. typedef enum defkind defkind;
  17.  
  18. struct array_def {
  19.     char *len_name;
  20.     char *array_name;
  21.     char *array_prefix;
  22.     char *array_type;
  23.     char *array_max;    
  24. };
  25. typedef struct array_def array_def;
  26.  
  27. enum relation {
  28.     REL_VECTOR,
  29.     REL_POINTER,
  30.     REL_ALIAS,
  31. };
  32. typedef enum relation relation;
  33.  
  34. struct typedef_def {
  35.     char *old_prefix;
  36.     char *old_type;
  37.     relation rel;
  38.     char *array_max;
  39. };
  40. typedef struct typedef_def typedef_def;
  41.  
  42.  
  43. struct enumval_list {
  44.     char *name;
  45.     char *assignment;
  46.     struct enumval_list *next;
  47. };
  48. typedef struct enumval_list enumval_list;
  49.  
  50. struct enum_def {
  51.     enumval_list *vals;
  52. };
  53. typedef struct enum_def enum_def;
  54.  
  55.  
  56. struct declaration {
  57.     char *prefix;
  58.     char *type;
  59.     char *name;
  60.     relation rel;
  61.     char *array_max;
  62. };
  63. typedef struct declaration declaration;
  64.  
  65.  
  66. struct decl_list {
  67.     declaration decl;
  68.     struct decl_list *next;
  69. };
  70. typedef struct decl_list decl_list;
  71.  
  72. struct struct_def {
  73.     decl_list *decls;
  74. };
  75. typedef struct struct_def struct_def;
  76.  
  77.  
  78. struct case_list {
  79.     char *case_name;
  80.     declaration case_decl;
  81.     struct case_list *next;
  82. };
  83. typedef struct case_list case_list;
  84.  
  85. struct union_def {
  86.     declaration enum_decl;
  87.     case_list *cases;
  88.     declaration *default_decl;
  89. };
  90. typedef struct union_def union_def;
  91.  
  92.  
  93.  
  94. struct proc_list {
  95.     char *proc_name;
  96.     char *proc_num;
  97.     char *arg_type;
  98.     char *arg_prefix;
  99.     char *res_type;
  100.     char *res_prefix;
  101.     struct proc_list *next;
  102. };
  103. typedef struct proc_list proc_list;
  104.  
  105.  
  106. struct version_list {
  107.     char *vers_name;
  108.     char *vers_num;    
  109.     proc_list *procs;
  110.     struct version_list *next;
  111. };
  112. typedef struct version_list version_list;
  113.  
  114. struct program_def {    
  115.     char *prog_num;
  116.     version_list *versions;
  117. };
  118. typedef struct program_def program_def;
  119.  
  120. struct definition {
  121.     char *def_name;
  122.     defkind def_kind;
  123.     union {
  124.         array_def ar;
  125.         struct_def st;
  126.         union_def un;
  127.         enum_def en;
  128.         typedef_def ty;
  129.         program_def pr;
  130.     } def;
  131. };
  132. typedef struct definition definition;
  133.  
  134. definition *get_definition();
  135.