X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fca65%2Ftoklist.h;h=c195d54fbac2241e4035ee4567b5afa10ea586dd;hb=64c5165a5b2984d15035dd17d1e953502db25d36;hp=fb035134970581dd7e3eadbcae4b23958df7161f;hpb=522c7e8c46d0aae3b13885a769ca4a9e87e36733;p=cc65 diff --git a/src/ca65/toklist.h b/src/ca65/toklist.h index fb0351349..c195d54fb 100644 --- a/src/ca65/toklist.h +++ b/src/ca65/toklist.h @@ -38,6 +38,10 @@ +#include "scanner.h" + + + /*****************************************************************************/ /* Data */ /*****************************************************************************/ @@ -47,21 +51,24 @@ /* 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 */