]> git.sur5r.net Git - cc65/blobdiff - src/ca65/toklist.h
Free expression trees when they're no longer needed
[cc65] / src / ca65 / toklist.h
index 498631d830b2f661f593e9f37b3aa9c98fc4b1a3..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 */
 };