#define IMP_UInt 130
#define IMP_Define 131
+/* This is used for tracking the include files/machine pairs. */
+struct IncludeHistoryItem
+{
+ IncludeHistoryItem( const char *fileName, const char *sectionName )
+ : fileName(fileName), sectionName(sectionName) {}
+
+ const char *fileName;
+ const char *sectionName;
+};
+
+typedef Vector<IncludeHistoryItem> IncludeHistory;
struct Parser
{
token KW_Machine, KW_Include, KW_Import, KW_Write, KW_Action, KW_AlphType,
KW_Range, KW_GetKey, KW_Include, KW_Write, KW_Machine, KW_InWhen,
KW_When, KW_OutWhen, KW_Eof, KW_Err, KW_Lerr, KW_To, KW_From,
- KW_Export;
+ KW_Export, KW_PrePush, KW_PostPop;
# Specials in code blocks.
token KW_Break, KW_Exec, KW_Hold, KW_PChar, KW_Char, KW_Goto, KW_Call,
void init();
int parseLangEl( int type, const Token *token );
- Parser( char *fileName, char *sectionName, InputLoc §ionLoc )
+ Parser( const char *fileName, char *sectionName, InputLoc §ionLoc )
: sectionName(sectionName)
{
pd = new ParseData( fileName, sectionName, sectionLoc );
exportContext.append( false );
+ includeHistory.append( IncludeHistoryItem(
+ fileName, sectionName ) );
}
int token( InputLoc &loc, int tokId, char *tokstart, int toklen );
NameRefList nameRefList;
Vector<bool> exportContext;
+ IncludeHistory includeHistory;
};
%% write token_defs;