]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
Removed primitive AST tree generator ... I'm planning a rewrite as we speak.
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index 853eb3315e581ff7ea81afbf43e3890931468958..d201c7885da237327aa51c87449acf9703d150cd 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
 //============================ lex.c ================================
 //===================================================================
 struct lex_file {
-       FILE *file;
-       char  peek  [5];
+       FILE *file;        /* file handler */
+       char *name;        /* name of file */
+       char  peek  [5];  
        char  lastok[8192];
        
-       int   line;
-       int   last;
-       int   current;
-       int   length;
-       int   size;
+       
+       int   last;    /* last token                   */
+       int   current; /* current token                */
+       
+       int   length;  /* bytes left to parse          */
+       int   size;    /* never changes (size of file) */
+       int   line;    /* what line are we on?         */
 };
 
 /*
@@ -73,10 +76,11 @@ struct lex_file {
 #define LEX_STRLIT     1130
 #define LEX_IDENT      1131
 
-int              lex_token(struct lex_file *);
-void             lex_reset(struct lex_file *);
-void             lex_close(struct lex_file *);
-struct lex_file *lex_open (FILE *);
+int              lex_token  (struct lex_file *);
+void             lex_reset  (struct lex_file *);
+void             lex_close  (struct lex_file *);
+struct lex_file *lex_include(struct lex_file *, char *);
+struct lex_file *lex_open   (FILE *);
 
 //===================================================================
 //========================== error.c ================================
@@ -91,11 +95,7 @@ int error(int, const char *, ...);
 //===================================================================
 //========================== parse.c ================================
 //===================================================================
-int parse_tree(struct lex_file *);
-struct parsenode {
-       struct parsenode *next;
-       int               type; /* some token */
-};
+int parse_gen(struct lex_file *);
 
 //===================================================================
 //========================== typedef.c ==============================
@@ -257,6 +257,5 @@ enum {
        INSTR_BITOR
 };
 
-
 void code_write();
 #endif