cc.fs (520B) - raw
1 \ C compiler 2 ?f<< /comp/c/gen.fs 3 ?f<< /comp/c/pp.fs 4 5 : _err ( -- ) abort" CC error" ; 6 : _assert ( f -- ) not if _err then ; 7 8 : :c ccio$ cctok$ nextt cparse ; 9 10 : calias 11 ccio$ cctok$ ' nextt parseType _assert parseDeclarator ( w cdecl ) 12 read; dup addSymbol to CDecl offset ; 13 14 : cc<< ( -- ) 15 word curpath :find# Path :open to ccio 16 cctypes$ ccpp$ cctok$ begin ( ) nextt? ?dup while cparse repeat 17 ccio File :close ; 18 19 :c typedef unsigned char uchar ; 20 :c typedef unsigned short ushort ; 21 :c typedef unsigned int uint ;