stage1_2/stage1_2_priv.hh
changeset 769 ffd8ac7e82f5
parent 757 f1fc4aa6f0e3
child 761 7b52623a2f37
equal deleted inserted replaced
758:1972c31c844d 769:ffd8ac7e82f5
   116  * between user defined (i.e. derived) enumerated datatypes, and some basic datatypes 
   116  * between user defined (i.e. derived) enumerated datatypes, and some basic datatypes 
   117  * (e.g. INT, STRING, etc...)
   117  * (e.g. INT, STRING, etc...)
   118  */
   118  */
   119 void include_string(const char *source_code);
   119 void include_string(const char *source_code);
   120 
   120 
   121 /**************************************/
   121 
   122 /* The name of the file being parsed. */
   122 /**********************************/
   123 /**************************************/
   123 /* Tell flex which file to parse. */
   124 /* The name of the file currently being parsed...
   124 /**********************************/
   125  * Note that flex accesses and updates this global variable
   125 /* This is a service that flex provides to bison... */
   126  * apropriately whenever it comes across an (*#include <filename> *)
   126 /* Tell flex which file to parse. This function will not imediately start parsing the file.
   127  * directive...
   127  * To parse the file, you then need to call yyparse()
   128  * ... and bison will use it when producing error messages.
   128  *
   129  * Note that bison also sets this variable correctly to the first
   129  * Returns -1 on error opening the file (and a valid errno), or 0 on success.
   130  * file being parsed.
   130  */
   131  */
   131 int parse_file(const char *filename);
   132 extern const char *current_filename;
   132 
   133 
   133 
   134 
   134 
   135 #define MAX_BUFFER_LENGTH 1000
       
   136 
       
   137 typedef struct {
       
   138     int eof;
       
   139     int lineNumber;
       
   140     int currentChar;
       
   141     int lineLength;
       
   142     int currentTokenStart;
       
   143     char* buffer;
       
   144     FILE *in_file;
       
   145   } tracking_t;
       
   146 
       
   147 int GetNextChar(char *b, int maxBuffer);
       
   148 tracking_t* GetNewTracking(FILE* in_file);
       
   149 
   135 
   150 /****************************************************/
   136 /****************************************************/
   151 /* Controlling the entry to the body_state in flex. */
   137 /* Controlling the entry to the body_state in flex. */
   152 /****************************************************/
   138 /****************************************************/
   153 void cmd_goto_body_state(void);
   139 void cmd_goto_body_state(void);