diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /sp/src/public/tier1/tokenreader.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'sp/src/public/tier1/tokenreader.h')
| -rw-r--r-- | sp/src/public/tier1/tokenreader.h | 198 |
1 files changed, 99 insertions, 99 deletions
diff --git a/sp/src/public/tier1/tokenreader.h b/sp/src/public/tier1/tokenreader.h index 14061e76..b174869c 100644 --- a/sp/src/public/tier1/tokenreader.h +++ b/sp/src/public/tier1/tokenreader.h @@ -1,99 +1,99 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#ifndef TOKENREADER_H
-#define TOKENREADER_H
-#ifdef _WIN32
-#pragma once
-#endif
-
-#include "tier0/basetypes.h"
-
-#ifdef _WIN32
-#pragma warning(push, 1)
-#pragma warning(disable:4701 4702 4530)
-#endif
-
-#undef min
-#undef max
-#include <fstream>
-#include "valve_minmax_on.h"
-
-#ifdef _WIN32
-#pragma warning(pop)
-#endif
-
-#include <assert.h>
-
-
-typedef enum
-{
- TOKENSTRINGTOOLONG = -4,
- TOKENERROR = -3,
- TOKENNONE = -2,
- TOKENEOF = -1,
- OPERATOR,
- INTEGER,
- STRING,
- IDENT
-} trtoken_t;
-
-
-#define IsToken(s1, s2) !strcmpi(s1, s2)
-
-#define MAX_TOKEN 128 + 1
-#define MAX_IDENT 64 + 1
-#define MAX_STRING 128 + 1
-
-
-class TokenReader : private std::ifstream
-{
-public:
-
- TokenReader();
-
- bool Open(const char *pszFilename);
- trtoken_t NextToken(char *pszStore, int nSize);
- trtoken_t NextTokenDynamic(char **ppszStore);
- void Close();
-
- void IgnoreTill(trtoken_t ttype, const char *pszToken);
- void Stuff(trtoken_t ttype, const char *pszToken);
- bool Expecting(trtoken_t ttype, const char *pszToken);
- const char *Error(char *error, ...);
- trtoken_t PeekTokenType(char* = NULL, int maxlen = 0);
-
- inline int GetErrorCount(void);
-
-private:
- // compiler can't generate an assignment operator since descended from std::ifstream
- inline TokenReader(TokenReader const &);
- inline int operator=(TokenReader const &);
-
- trtoken_t GetString(char *pszStore, int nSize);
- bool SkipWhiteSpace(void);
-
- int m_nLine;
- int m_nErrorCount;
-
- char m_szFilename[128];
- char m_szStuffed[128];
- bool m_bStuffed;
- trtoken_t m_eStuffed;
-};
-
-
-//-----------------------------------------------------------------------------
-// Purpose: Returns the total number of parsing errors since this file was opened.
-//-----------------------------------------------------------------------------
-int TokenReader::GetErrorCount(void)
-{
- return(m_nErrorCount);
-}
-
-
-#endif // TOKENREADER_H
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef TOKENREADER_H +#define TOKENREADER_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tier0/basetypes.h" + +#ifdef _WIN32 +#pragma warning(push, 1) +#pragma warning(disable:4701 4702 4530) +#endif + +#undef min +#undef max +#include <fstream> +#include "valve_minmax_on.h" + +#ifdef _WIN32 +#pragma warning(pop) +#endif + +#include <assert.h> + + +typedef enum +{ + TOKENSTRINGTOOLONG = -4, + TOKENERROR = -3, + TOKENNONE = -2, + TOKENEOF = -1, + OPERATOR, + INTEGER, + STRING, + IDENT +} trtoken_t; + + +#define IsToken(s1, s2) !strcmpi(s1, s2) + +#define MAX_TOKEN 128 + 1 +#define MAX_IDENT 64 + 1 +#define MAX_STRING 128 + 1 + + +class TokenReader : private std::ifstream +{ +public: + + TokenReader(); + + bool Open(const char *pszFilename); + trtoken_t NextToken(char *pszStore, int nSize); + trtoken_t NextTokenDynamic(char **ppszStore); + void Close(); + + void IgnoreTill(trtoken_t ttype, const char *pszToken); + void Stuff(trtoken_t ttype, const char *pszToken); + bool Expecting(trtoken_t ttype, const char *pszToken); + const char *Error(char *error, ...); + trtoken_t PeekTokenType(char* = NULL, int maxlen = 0); + + inline int GetErrorCount(void); + +private: + // compiler can't generate an assignment operator since descended from std::ifstream + inline TokenReader(TokenReader const &); + inline int operator=(TokenReader const &); + + trtoken_t GetString(char *pszStore, int nSize); + bool SkipWhiteSpace(void); + + int m_nLine; + int m_nErrorCount; + + char m_szFilename[128]; + char m_szStuffed[128]; + bool m_bStuffed; + trtoken_t m_eStuffed; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Returns the total number of parsing errors since this file was opened. +//----------------------------------------------------------------------------- +int TokenReader::GetErrorCount(void) +{ + return(m_nErrorCount); +} + + +#endif // TOKENREADER_H |