holy shit thats a lot of changed to asmrigs

This commit is contained in:
2026-01-17 23:45:36 +02:00
parent ee7735b610
commit fe1273e539
21 changed files with 645 additions and 197 deletions

View File

@@ -0,0 +1,55 @@
#ifndef ASMRIGS_TOKEN_PARSER
#define ASMRIGS_TOKEN_PARSER
#include "tier2/tokenizer.h"
class CTokenParser
{
public:
bool IsEOF();
const char *PeekToken();
bool IsToken( const char *szString );
const char *PeekStringLiteral();
bool Continue();
Token_t *m_pTokens;
Token_t *m_pTokensEnd;
Token_t *m_pCurrentToken;
};
inline const char *CTokenParser::PeekToken()
{
if ( m_pCurrentToken->m_bIsQuoted )
return NULL;
return m_pCurrentToken->m_szValue;
}
inline bool CTokenParser::IsEOF()
{
if (m_pCurrentToken == m_pTokensEnd)
return true;
return false;
};
inline bool CTokenParser::IsToken( const char *szString )
{
if ( !V_strcmp(szString, m_pCurrentToken->m_szValue))
return true;
return false;
};
inline const char *CTokenParser::PeekStringLiteral()
{
if ( !m_pCurrentToken->m_bIsQuoted )
return NULL;
return m_pCurrentToken->m_szValue;
}
inline bool CTokenParser::Continue()
{
m_pCurrentToken++;
if ( m_pCurrentToken == m_pTokensEnd )
return false;
return true;
}
#endif