home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / SMARTMAG / V2.MSA / ADVENTUR.STQ_EASYC.H < prev    next >
Text File  |  2003-12-17  |  2KB  |  76 lines

  1. /*
  2.  * EASYC.H    typed in 1/June/86
  3.  *
  4.  * This file contains the constructs used in writing EASY C
  5.  * programs, which are basically C programs with some
  6.  * Pascal-like coding plopped on top of them.
  7.  * From the article EASY C, in May 1986 BYTE.
  8.  *
  9.  */
  10.  
  11. /* Logical operators    */
  12.  
  13. #define    AND    &&    /* logical AND    */
  14. #define OR    ||    /* logical OR    */
  15. #define NOT    !    /* logical NOT    */
  16. #define    EQ    ==    /* equal value comparison    */
  17. #define    NE    !=    /* not equal value comparison    */
  18. #define    LT    <    /* less than value comparison    */
  19. #define LE    <=    /* less than or equal to value comparison    */
  20. #define GT    >    /* greater than value comparison        */
  21. #define GE    >=    /* greater than or equal to value comparison    */
  22.  
  23. /* Bitwise operators    */
  24.  
  25. #define    BAND    &    /* bitwise AND    */
  26. #define    BOR    |    /* bitwise OR    */
  27. #define    BXOR    ^    /* bitwise exclusive OR    */
  28. #define    BNOT    ~    /* bitwise NOT    */
  29. #define    LSHF    <<    /* left shift    */
  30. #define RSHF    >>    /* right shift    */
  31.  
  32. /* Arithmetic operators    */
  33.  
  34. #define    INC    ++    /* increment    */
  35. #define DEC    --    /* decrement    */
  36. #define MOD    %    /* modulo division    */
  37.  
  38. /* CONTROL constructs.
  39.  *  Some of these constructs are my own invention, in order
  40.  *  to more easily port ACTION! code to C code.
  41.  */
  42.  
  43. /* IF_THEN_ELSEIF_ELSE construct    */
  44.  
  45. #define IF(e)        { if (e)        /* if statement        */
  46. #define THEN        {            /* then statement    */
  47. #define ELSEIF(e)    } else if (e) {        /* elseif statement    */
  48. #define ELSE        } else {        /* else statement    */
  49. #define ENDIF        ;} }            /* end of if statement    */
  50. #define FI        ;} }            /* end of if statement    */
  51.  
  52. /* CASE construct            */
  53.  
  54. #define    CASE(e)        { switch (e) {        /* head of case        */
  55. #define    CASEOF(e)    case e: {        /* case block        */
  56. #define DEFCASE        default: {        /* default case block    */
  57. #define    ENDCOF        } break;        /* end of case block    */
  58. #define    ENDCASE        } }            /* end of case        */
  59.  
  60. /* WHILE construct            */
  61.  
  62. #define    WHILE(e)    { while (e) {        /* while statement    */
  63. #define    ENDWHILE    ;} }            /* end of while statment*/
  64.  
  65. /* FOR construct            */
  66.  
  67. #define    FOR(e)        { for (e) {        /* for statement    */
  68. #define    ENDFOR        ;} }            /* end of for statement    */
  69.  
  70. /* BEGIN_END construct            */
  71.  
  72. #define    BEGIN        {            /* beginning of block    */
  73. #define    END        }            /* end of block        */
  74. #define DO        {            /* beginning of block    */
  75. #define OD        }            /* end of block        */
  76.