+#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 */
};
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 */