mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 12:15:46 +00:00
llvm-rc/ResourceScriptTokenList.h: Turns this into a .def file to imply that it's non-modular
Also undef the macros at the end of the file to make it easier to use. llvm-svn: 318714
This commit is contained in:
parent
62b076325a
commit
b961d29bfd
@ -245,9 +245,7 @@ Error RCParser::consumeType(Kind TokenKind) {
|
||||
#define SHORT_TOKEN(TokenName, TokenCh) \
|
||||
case Kind::TokenName: \
|
||||
return getExpectedError(#TokenCh);
|
||||
#include "ResourceScriptTokenList.h"
|
||||
#undef SHORT_TOKEN
|
||||
#undef TOKEN
|
||||
#include "ResourceScriptTokenList.def"
|
||||
}
|
||||
|
||||
llvm_unreachable("All case options exhausted.");
|
||||
|
@ -212,9 +212,7 @@ Error Tokenizer::consumeToken(const Kind TokenKind) {
|
||||
// One-character token consumption.
|
||||
#define TOKEN(Name)
|
||||
#define SHORT_TOKEN(Name, Ch) case Kind::Name:
|
||||
#include "ResourceScriptTokenList.h"
|
||||
#undef TOKEN
|
||||
#undef SHORT_TOKEN
|
||||
#include "ResourceScriptTokenList.def"
|
||||
advance();
|
||||
return Error::success();
|
||||
|
||||
@ -340,9 +338,7 @@ Kind Tokenizer::classifyCurrentToken() const {
|
||||
#define SHORT_TOKEN(Name, Ch) \
|
||||
case Ch: \
|
||||
return Kind::Name;
|
||||
#include "ResourceScriptTokenList.h"
|
||||
#undef TOKEN
|
||||
#undef SHORT_TOKEN
|
||||
#include "ResourceScriptTokenList.def"
|
||||
|
||||
default:
|
||||
return Kind::Invalid;
|
||||
|
@ -9,7 +9,7 @@
|
||||
//
|
||||
// This declares the .rc script tokens and defines an interface for tokenizing
|
||||
// the input data. The list of available tokens is located at
|
||||
// ResourceScriptTokenList.h.
|
||||
// ResourceScriptTokenList.def.
|
||||
//
|
||||
// Note that the tokenizer does not support comments or preprocessor
|
||||
// directives. The preprocessor should do its work on the .rc file before
|
||||
@ -47,9 +47,7 @@ public:
|
||||
enum class Kind {
|
||||
#define TOKEN(Name) Name,
|
||||
#define SHORT_TOKEN(Name, Ch) Name,
|
||||
#include "ResourceScriptTokenList.h"
|
||||
#undef TOKEN
|
||||
#undef SHORT_TOKEN
|
||||
#include "ResourceScriptTokenList.def"
|
||||
};
|
||||
|
||||
RCToken(RCToken::Kind RCTokenKind, StringRef Value);
|
||||
|
@ -35,3 +35,6 @@ SHORT_TOKEN(Amp, '&') // Bitwise-AND operator.
|
||||
SHORT_TOKEN(Tilde, '~') // Bitwise-NOT operator.
|
||||
SHORT_TOKEN(LeftParen, '(') // Left parenthesis in the script expressions.
|
||||
SHORT_TOKEN(RightParen, ')') // Right parenthesis.
|
||||
|
||||
#undef TOKEN
|
||||
#undef SHORT_TOKEN
|
@ -124,9 +124,7 @@ int main(int argc_, const char *argv_[]) {
|
||||
const Twine TokenNames[] = {
|
||||
#define TOKEN(Name) #Name,
|
||||
#define SHORT_TOKEN(Name, Ch) #Name,
|
||||
#include "ResourceScriptTokenList.h"
|
||||
#undef TOKEN
|
||||
#undef SHORT_TOKEN
|
||||
#include "ResourceScriptTokenList.def"
|
||||
};
|
||||
|
||||
for (const RCToken &Token : Tokens) {
|
||||
|
Loading…
Reference in New Issue
Block a user