]> git.sur5r.net Git - cc65/blobdiff - src/ca65/toklist.h
More lineinfo usage.
[cc65] / src / ca65 / toklist.h
index fb035134970581dd7e3eadbcae4b23958df7161f..b31df38afea130ad4834abce7b59510774d900ec 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 2000-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 
 
 
+/* common */
+#include "strbuf.h"
+
+/* ca65 */
+#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 */
+    Token       T;                      /* Token value */
 };
 
 /* 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 */
 };
 
 
@@ -84,13 +92,13 @@ enum TC {
 TokNode* NewTokNode (void);
 /* Create and return a token node with the current token value */
 
-void FreeTokNode (TokNode* T);
+void FreeTokNode (TokNode* N);
 /* Free the given token node */
 
-void TokSet (TokNode* T);
+void TokSet (TokNode* N);
 /* Set the scanner token from the given token node */
 
-enum TC TokCmp (const TokNode* T);
+enum TC TokCmp (const TokNode* N);
 /* Compare the token given as parameter against the current token */
 
 void InitTokList (TokList* T);
@@ -102,9 +110,21 @@ TokList* NewTokList (void);
 void FreeTokList (TokList* T);
 /* Delete the token list including all token nodes */
 
+token_t GetTokListTerm (token_t Term);
+/* Determine if the following token list is enclosed in curly braces. This is
+ * the case if the next token is the opening brace. If so, skip it and return
+ * a closing brace, otherwise return Term.
+ */
+
 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 */