1b961d29bSDavid Blaikie//===-- ResourceScriptTokenList.h -------------------------------*- C++-*-===// 2b961d29bSDavid Blaikie// 3*2946cd70SChandler Carruth// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*2946cd70SChandler Carruth// See https://llvm.org/LICENSE.txt for license information. 5*2946cd70SChandler Carruth// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6b961d29bSDavid Blaikie// 7b961d29bSDavid Blaikie//===---------------------------------------------------------------------===// 8b961d29bSDavid Blaikie// 9b961d29bSDavid Blaikie// This is a part of llvm-rc tokenizer. It lists all the possible tokens 10b961d29bSDavid Blaikie// that might occur in a correct .rc script. 11b961d29bSDavid Blaikie// 12b961d29bSDavid Blaikie//===---------------------------------------------------------------------===// 13b961d29bSDavid Blaikie 14b961d29bSDavid Blaikie 15b961d29bSDavid Blaikie// Long tokens. They might consist of more than one character. 16b961d29bSDavid BlaikieTOKEN(Invalid) // Invalid token. Should not occur in a valid script. 17b961d29bSDavid BlaikieTOKEN(Int) // Integer (decimal, octal or hexadecimal). 18b961d29bSDavid BlaikieTOKEN(String) // String value. 19b961d29bSDavid BlaikieTOKEN(Identifier) // Script identifier (resource name or type). 20b961d29bSDavid BlaikieTOKEN(LineComment) // Beginning of single-line comment. 21b961d29bSDavid BlaikieTOKEN(StartComment) // Beginning of multi-line comment. 22b961d29bSDavid Blaikie 23b961d29bSDavid Blaikie// Short tokens. They usually consist of exactly one character. 24b961d29bSDavid Blaikie// The definitions are of the form SHORT_TOKEN(TokenName, TokenChar). 25b961d29bSDavid Blaikie// TokenChar is the one-character token representation occuring in the correct 26b961d29bSDavid Blaikie// .rc scripts. 27b961d29bSDavid BlaikieSHORT_TOKEN(BlockBegin, '{') // Start of the script block; can also be BEGIN. 28b961d29bSDavid BlaikieSHORT_TOKEN(BlockEnd, '}') // End of the block; can also be END. 29b961d29bSDavid BlaikieSHORT_TOKEN(Comma, ',') // Comma - resource arguments separator. 30b961d29bSDavid BlaikieSHORT_TOKEN(Plus, '+') // Addition operator. 31b961d29bSDavid BlaikieSHORT_TOKEN(Minus, '-') // Subtraction operator. 32b961d29bSDavid BlaikieSHORT_TOKEN(Pipe, '|') // Bitwise-OR operator. 33b961d29bSDavid BlaikieSHORT_TOKEN(Amp, '&') // Bitwise-AND operator. 34b961d29bSDavid BlaikieSHORT_TOKEN(Tilde, '~') // Bitwise-NOT operator. 35b961d29bSDavid BlaikieSHORT_TOKEN(LeftParen, '(') // Left parenthesis in the script expressions. 36b961d29bSDavid BlaikieSHORT_TOKEN(RightParen, ')') // Right parenthesis. 37b961d29bSDavid Blaikie 38b961d29bSDavid Blaikie#undef TOKEN 39b961d29bSDavid Blaikie#undef SHORT_TOKEN 40