LLVM 20.0.0git
ResourceScriptToken.h
Go to the documentation of this file.
1//===-- ResourceScriptToken.h -----------------------------------*- C++-*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===---------------------------------------------------------------------===//
8//
9// This declares the .rc script tokens.
10// The list of available tokens is located at ResourceScriptTokenList.h.
11//
12// Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa380599(v=vs.85).aspx
13//
14//===---------------------------------------------------------------------===//
15
16#ifndef LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_SCRIPTTOKEN_H
17#define LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_SCRIPTTOKEN_H
18
19#include "llvm/ADT/StringRef.h"
20
21namespace llvm {
22
23// A definition of a single resource script token. Each token has its kind
24// (declared in ResourceScriptTokenList) and holds a value - a reference
25// representation of the token.
26// RCToken does not claim ownership on its value. A memory buffer containing
27// the token value should be stored in a safe place and cannot be freed
28// nor reallocated.
29class RCToken {
30public:
31 enum class Kind {
32#define TOKEN(Name) Name,
33#define SHORT_TOKEN(Name, Ch) Name,
35#undef TOKEN
36#undef SHORT_TOKEN
37 };
38
40
41 // Get an integer value of the integer token.
43 bool isLongInt() const;
44
46 Kind kind() const;
47
48 // Check if a token describes a binary operator.
49 bool isBinaryOp() const;
50
51private:
52 Kind TokenKind;
53 StringRef TokenValue;
54};
55
56} // namespace llvm
57
58#endif
StringRef value() const
Kind kind() const
bool isBinaryOp() const
RCToken(RCToken::Kind RCTokenKind, StringRef Value)
bool isLongInt() const
uint32_t intValue() const
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
LLVM Value Representation.
Definition: Value.h:74
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18