home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / animutil / pvquan / animdat / scanner.h < prev    next >
C/C++ Source or Header  |  1992-11-30  |  2KB  |  51 lines

  1. /*--------------------------------------------------------------*/
  2. /*            ANIMDAT 1.1                */
  3. /*        copyright 1992 - TODD SANKEY            */
  4. /*                                */
  5. /*  The author hereby grants permission for the use and sharing    */
  6. /* of both source code end executable versions of this software    */
  7. /* at no charge. This software is not for sale and no other    */
  8. /* shall charge for it without the expressed consent of the    */
  9. /* author.                            */
  10. /*                                */
  11. /*  The source code can be freely modified, but it must retain    */
  12. /* the original copyright notice, and the author must be    */
  13. /* notified of these changes if the altered code is to be    */
  14. /* distributed.                            */
  15. /*--------------------------------------------------------------*/
  16. /*------------------------------------------------------*/
  17. /* scanner.h    Interface for scanning and tokeninzing    */
  18. /*        an expression.                */
  19. /*------------------------------------------------------*/
  20.  
  21. #ifndef scanner_h
  22. #define scanner_h
  23.  
  24. /* token types */
  25. typedef enum {
  26.         NO_TOKEN,    IDENTIFIER,    NUMBER,        STRING,
  27.         CARET,        STAR,        LPAREN,        RPAREN,
  28.         MINUS,        PLUS,        EQUAL,        LT,
  29.         GT,        LE,        GE,        NE,
  30.         SLASH,        COMMA,        OR,        AND,
  31.         SIN,        COS,        TAN,        EXP,
  32.         LOG,        RND,        ATAN,        ASIN,
  33.         ACOS,        POUND,        QUOTE,        ERROR,
  34.         NUMSCENE,    PERCENT,    END_OF_FILE
  35.         } TOKEN_CODE;
  36.  
  37.  
  38. /* globals for accessing tokens */
  39. extern TOKEN_CODE    token;
  40. extern char        word_string[];
  41. extern double        literal_value;
  42. extern char        *token_names[];
  43.  
  44. /* routines for processing tokens */
  45. void init_scanner(char *buffer_ptr);    /* Set the scanner to a point in the
  46.                        source buffer and start scanning
  47.                        from that point. */
  48. void get_token(void);    /* updates the token global variable */
  49.  
  50. #endif
  51.