Subversion Repositories Kolibri OS

Rev

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

  1. /*
  2.  * Tiny BASIC Interpreter and Compiler Project
  3.  * Interpreter header
  4.  *
  5.  * Released as Public Domain by Damian Gareth Walker 2019
  6.  * Created: 23-Aug-2019
  7.  */
  8.  
  9.  
  10. #ifndef __INTERPRET_H__
  11. #define __INTERPRET_H__
  12.  
  13.  
  14. /* included headers */
  15. #include "errors.h"
  16. #include "options.h"
  17. #include "statement.h"
  18.  
  19.  
  20. /*
  21.  * Data Declarations
  22.  */
  23.  
  24.  
  25. /* the interpreter object */
  26. typedef struct interpreter_data InterpreterData;
  27. typedef struct interpreter Interpreter;
  28. typedef struct interpreter {
  29.  
  30.   /* Properties */
  31.   InterpreterData *priv; /* private data */
  32.  
  33.   /*
  34.    * Interpret the program
  35.    * params:
  36.    *   Interpreter*   the interpreter to use
  37.    *   ProgramNode*   the program to interpret
  38.    */
  39.   void (*interpret) (Interpreter *, ProgramNode *);
  40.  
  41.   /*
  42.    * Destructor
  43.    * params:
  44.    *   Interpreter*   the doomed interpreter
  45.    */
  46.   void (*destroy) (Interpreter *);
  47.  
  48. } Interpreter;
  49.  
  50.  
  51. /*
  52.  * Function Declarations
  53.  */
  54.  
  55.  
  56. /*
  57.  * Constructor
  58.  * returns:
  59.  *   Interpreter*   the new interpreter
  60.  */
  61. Interpreter *new_Interpreter (ErrorHandler *errors, LanguageOptions *options);
  62.  
  63.  
  64. #endif
  65.