Subversion Repositories Kolibri OS

Rev

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

  1. /*
  2.  * Tiny BASIC Interpreter and Compiler Project
  3.  * Language Options Header
  4.  *
  5.  * Released as Public Domain by Damian Gareth Walker 2019
  6.  * Created: 18-Aug-2019
  7.  */
  8.  
  9.  
  10. #ifndef __OPTIONS_H__
  11. #define __OPTIONS_H__
  12.  
  13.  
  14. /*
  15.  * Data Definitions
  16.  */
  17.  
  18.  
  19. /* line number options */
  20. typedef enum {
  21.   LINE_NUMBERS_OPTIONAL, /* they are optional numeric labels */
  22.   LINE_NUMBERS_IMPLIED, /* missing line numbers are implied */
  23.   LINE_NUMBERS_MANDATORY /* every line requires a number in sequence */
  24. } LineNumberOption;
  25.  
  26. /* comment options */
  27. typedef enum {
  28.   COMMENTS_ENABLED, /* comments and blank lines are allowed */
  29.   COMMENTS_DISABLED /* comments and blank lines are not allowed */
  30. } CommentOption;
  31.  
  32. /* language options */
  33. typedef struct language_options LanguageOptions;
  34. typedef struct language_options {
  35.   void *data; /* private data */
  36.   void (*set_line_numbers) (LanguageOptions *, LineNumberOption);
  37.   void (*set_line_limit) (LanguageOptions *, int);
  38.   void (*set_comments) (LanguageOptions *, CommentOption);
  39.   void (*set_gosub_limit) (LanguageOptions *, int);
  40.   LineNumberOption (*get_line_numbers) (LanguageOptions *);
  41.   int (*get_line_limit) (LanguageOptions *);
  42.   CommentOption (*get_comments) (LanguageOptions *);
  43.   int (*get_gosub_limit) (LanguageOptions *);
  44.   void (*destroy) (LanguageOptions *);
  45. } LanguageOptions;
  46.  
  47.  
  48. /*
  49.  * Function Declarations
  50.  */
  51.  
  52.  
  53. /*
  54.  * Constructor for language options
  55.  * returns:
  56.  *   LanguageOptions*   the new language options object
  57.  */
  58. LanguageOptions *new_LanguageOptions (void);
  59.  
  60.  
  61. #endif
  62.