fork download
  1. : $, ( au-) here swap dup allot move ;
  2. : & ( -) parse-name dup c, $, ;
  3. : ref, ( au-) over , 0 do count + loop ;
  4.  
  5. Create keywords & do & if & for & int & auto & case
  6. & char & else & enum & goto & long & void & break
  7. & const & float & short & union & while & double
  8. & extern & return & signed & sizeof & static & struct
  9. & switch & default & typedef & continue & register
  10. & unsigned & volatile 0 c,
  11.  
  12. Create by-length keywords 2 ref, 2 ref,
  13. 8 ref, 6 ref, 8 ref, 2 ref, 3 ref, ,
  14.  
  15. : keyword? ( au-f) dup 10 2 within IF 2drop 0 exit THEN
  16. dup 2 - cells by-length + @ >r BEGIN ( au)
  17. 2dup r> count 2dup + >r dup ( not-at-end? ) WHILE
  18. compare 0= UNTIL -1 ELSE 0 THEN nip nip r> drop ;
  19.  
  20. cr s" extern" 2dup keyword? . type
  21. cr s" externa" 2dup keyword? . type
  22.  
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
-1 extern
0 externa