]> git.sur5r.net Git - cc65/blobdiff - src/ca65/toklist.h
Allow conditional directives within .STRUCT7:UNION and .ENUM
[cc65] / src / ca65 / toklist.h
index fb035134970581dd7e3eadbcae4b23958df7161f..c195d54fbac2241e4035ee4567b5afa10ea586dd 100644 (file)
 
 
 
+#include "scanner.h"
+
+
+
 /*****************************************************************************/
 /*                                          Data                                    */
 /*****************************************************************************/
 /* Struct holding a token */
 typedef struct TokNode TokNode;
 struct TokNode {
-    TokNode*                   Next;           /* For single linked list */
-    enum Token         Tok;            /* Token value */
-    int                        WS;             /* Whitespace before token? */
-    long                       IVal;           /* Integer token attribute */
-    char                       SVal [1];       /* String attribute, dyn. allocated */
+    TokNode*   Next;                   /* For single linked list */
+    enum Token Tok;                    /* Token value */
+    int                WS;                     /* Whitespace before token? */
+    long               IVal;                   /* Integer token attribute */
+    char               SVal [1];               /* String attribute, dyn. allocated */
 };
 
 /* Struct holding a token list */
 typedef struct TokList TokList;
 struct TokList {
-    TokList*           Next;           /* Single linked list (for replay) */
-    TokNode*           Root;           /* First node in list */
-    TokNode*           Last;           /* Last node in list or replay */
-    unsigned           Repeat;         /* Repeat counter (used for replay) */
-    unsigned           Count;          /* Token count */
+    TokList*   Next;                   /* Single linked list (for replay) */
+    TokNode*   Root;                   /* First node in list */
+    TokNode*   Last;                   /* Last node in list or replay */
+    unsigned           RepCount;               /* Repeat counter (used for replay) */
+    unsigned   RepMax;                 /* Maximum repeat count for replay */
+    unsigned   Count;                  /* Token count */
+    void       (*Check)(TokList*);     /* Token check function */
+    void*              Data;                   /* Additional data for check */
 };
 
 
@@ -105,6 +112,12 @@ void FreeTokList (TokList* T);
 void AddCurTok (TokList* T);
 /* Add the current token to the token list */
 
+void PushTokList (TokList* List, const char* Desc);
+/* Push a token list to be used as input for InputFromStack. This includes
+ * several initializations needed in the token list structure, so don't use
+ * PushInput directly.
+ */
+
 
 
 /* End of toklist.h */