home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol166 / dclrn.cnv < prev    next >
Encoding:
Text File  |  1984-04-29  |  3.3 KB  |  118 lines

  1.  
  2. [DCLRN.CNV]
  3. [CNVRT compiler for "C" Declarations]
  4. [Harold V. McIntosh, 10 June 1983]
  5.  
  6.  
  7.  
  8. [compile declaration]
  9. ((
  10.   [declaration]      (<:Y:>(or, <:V:>,);) Z
  11.   [decl spec]      ((or,<:X:>(or, <:W:>,),<:W:>(or, <:X:>,))) Y
  12.   [s. c. spec]      ((or,<<
  13.             >>char,<<
  14.             >>(or,long ,short ,unsigned ,)int,<<
  15.              >>(or,long ,)float,<<
  16.             >>double,<<
  17.             >><:H:>,<<
  18.             >>tdefname)) X
  19.   [type spec]      ((or,<<
  20.             >>auto,<<
  21.             >>static,<<
  22.             >>extern,<<
  23.             >>register,<<
  24.             >>typedef)) W
  25.   [in dcl lst]      (<:U:>(or,<,> <:V:>,)) V
  26.   [init decl]      (<:M:>(or, <:6:>,)) U
  27.   [d-extender]      ((or,<(><)>,[<:o:>],[])) Q
  28.   [d-extender*]      ((or,<:Q:><:S:>,)) S
  29.   [declarator]      ((or,<:I:>,<(><:M:><)>,*<:M:>)<:S:>) M
  30.   [s or u spec]      ((or,struct,union)(or, <:I:>,)(or, {<:G:>},)) H
  31.   [st decl lst]      (<:9:>(or, <:G:>,)) G
  32.   [st decl]      (<:X:><:8:>;) 9
  33.   [st dcl list]      ( <:7:>(or,<,><:8:>,)) 8
  34.   [str. declr]      ((or,<:M:>:<:o:>,<:M:>,:<:o:>)) 7
  35.   [initializer]      (= (or,<:E:>,{<:5:>(or,<,>,)})) 6
  36.   [init. list]      ((or,<:E:>,{<:5:>})(or,<,> <:5:>,)) 5
  37.   [type-name]      (<:X:><:3:>) 4
  38.   [abst. decl]      ((or,<(><:3:><)>,*<:3:>)<:S:>,)) 3
  39.  
  40.   )()(0 1 2)(
  41.  
  42.   [prnt WS]      ((PWS)<>,);
  43.           ((and,<:Y:>,<0>)(and,(or, <:V:>,),<1>);,<<
  44.             >>/definition (z,<1><,>) %%% <0><<
  45.             >>/initialize (y,<1><,>)<<
  46.             >>);
  47.           (<:Z:>,yes);
  48.           (,no);
  49.   )) w
  50.  
  51. [token compilation of expressions]
  52. (()()(0)(
  53.         (<0>,/compiled <0>);
  54.   )) x
  55.  
  56. [split out initializations]
  57. (()()(0 1 2)(
  58.         ((and, <:M:> <:6:><,>,<0>)<1>,<0>(y,<1>));
  59.         ( <:M:><,><0>,<0>):
  60.   )) y
  61.  
  62. [remove initializations leaving definitions]
  63. (()()(0 1 2)(
  64.         ((and, <:M:>, <0>)(or, <:6:>,)<,><1>, <0><,>(z,<1>));
  65.   )) z
  66.  
  67. [main program including syntactic elements]
  68. ( (
  69.   [alfanum]   ((and,<[1]>,(IVL, ,~,))) a
  70.   [letter]    ((and,<[1]>,(or,(IVL,A,Z,),(IVL,a,z,),_))) b
  71.   [odigit]    ((and,<[1]>,(IVL,0,7,))) c
  72.   [ddigit]    ((and,<[1]>,(IVL,0,9,))) d
  73.   [hdigit]    ((and,<[1]>,(or,(IVL,0,9,),(IVL,A,F,),(IVL,a,f,)))) e
  74.   [astring]   ((or,(or,\<:a:>,(and,<:a:>,(NOT,(or,<">,<'>,\))))<:f:>,)) f
  75.   [ostring]   ((or,<:c:><:g:>,)) g
  76.   [dstring]   ((or,<:d:><:h:>,)) h
  77.   [hstring]   ((or,<:e:><:i:>,)) i
  78.   [cconst]    ((or,\<:a:>,<'><:a:><'>)) j
  79.   [iconst]    ((or,0(or,X,x)<:i:>,0<:g:>,<:d:><:h:>)) k
  80.   [fconst]    (<:h:>.<:h:>(or,(or,E,e)(or,+,-,)<:h:>,)) l
  81.   [sconst]    (<"><:f:><">) m
  82.   [cstring]   ((or,(or,<:b:>,<:d:>)<:n:>,)) n
  83.   [constant]  ((or,<:l:>,<:k:>,<:j:>,<:m:>)) o
  84.   [identifier](<:b:><:n:>) I
  85.   [aoperator] ((or,=,+=,-=,*=,/=,%=,(QUO/>>=/),(QUO/<<=/),&=,^=,|=)) p
  86.   [boperator] ((or,*,/,%,+,-,(QUO/>>/),(QUO/<</),(QUO/<=/),<<
  87.         >>(QUO/>=/),(<),(>),==,!=,&&,^,||,&,|)) q
  88.   [uoperator] ((or,*,&,-,!,~,sizeof,<(>typename<)>)) r
  89.   [uoper*]      ((or,<:r:><:s:>,)) s
  90.   [lvalue]    ((or,<<
  91.         >>(and,<:P:>,<-->[<:E:>]<>),<<
  92.         >>(and,<:P:>,<-->-(>)<:I:><>),<<
  93.         >>(and,<:P:>,<-->.<:I:><>),<<
  94.         >><:I:>,<<
  95.         >>*<:E:>,<<
  96.         >><(><:L:><)>)) L
  97.   [pexten]    ((or,[<:E:>],<(><:F:><)>,-(>)<:I:>,.<:I:>)) N
  98.   [pextn*]    ((or,<:N:><:O:>,)) O
  99.   [primary]   ((or,<:I:>,<:o:>,<(><:E:><)>)<:O:>) P
  100.   [eroot]     ((or,<<
  101.         >><:r:><:A:>,<<
  102.         >>++<:L:>,<<
  103.         >>--<:L:>,<<
  104.         >><:L:>++,<<
  105.         >><:L:>--,<<
  106.         >><:P:>)) A
  107.   [bexpr]     (<:A:>(or,<:q:><:B:>,)) B
  108.   [cexpr]     (<:B:>(or,?<:K:>:<:K:>,)) K
  109.   [aexpr]     ((or,<:L:><:p:><:D:>,<:K:>)) D
  110.   [expression](<:D:>(or,<,><:E:>,)) E
  111.   [e-list]    ((or,<:E:><:F:>,)) F
  112.   )  ()(0)(  
  113.     (;,done);
  114.     (<0>,(%C,(w,<0>))(%R)):
  115.   ))
  116.  
  117. [end]
  118.