Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Tiny BASIC
  3.  * Tokenisation Header
  4.  *
  5.  * Copyright (C) Damian Walker 2019
  6.  * Created: 04-Aug-2019
  7.  */
  8.  
  9.  
  10. #ifndef __TOKENISER_H__
  11. #define __TOKENISER_H__
  12.  
  13.  
  14. /* pre-requisite headers */
  15. #include "token.h"
  16.  
  17.  
  18. /*
  19.  * Structure Defnitions
  20.  */
  21.  
  22.  
  23. /* Token stream */
  24. typedef struct token_stream TokenStream;
  25. typedef struct token_stream {
  26.   void *data; /* private data */
  27.   Token *(*next) (TokenStream *);
  28.   int (*get_line) (TokenStream *);
  29.   void (*destroy) (TokenStream *);
  30. } TokenStream;
  31.  
  32.  
  33. /*
  34.  * Constructor Declarations
  35.  */
  36.  
  37.  
  38. /*
  39.  * Constructor for TokenStream
  40.  * params:
  41.  *   FILE*   input   Input file
  42.  * returns:
  43.  *   TokenStream*    The new token stream
  44.  */
  45. TokenStream *new_TokenStream (FILE *input);
  46.  
  47.  
  48. #endif
  49.