llvm/llvm/tools/llvm-rc/ResourceScriptToken.cpp

//===-- ResourceScriptToken.cpp ---------------------------------*- C++-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------------------------------------------------===//
//
// This file implements an interface defined in ResourceScriptToken.h.
// In particular, it defines an .rc script tokenizer.
//
//===---------------------------------------------------------------------===//

#include "ResourceScriptToken.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"

#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdlib>
#include <utility>

usingnamespacellvm;

Kind;

// Checks if Representation is a correct description of an RC integer.
// It should be a 32-bit unsigned integer, either decimal, octal (0[0-7]+),
// or hexadecimal (0x[0-9a-f]+). It might be followed by a single 'L'
// character (that is the difference between our representation and
// StringRef's one). If Representation is correct, 'true' is returned and
// the return value is put back in Num.
static bool rcGetAsInteger(StringRef Representation, uint32_t &Num) {}

RCToken::RCToken(RCToken::Kind RCTokenKind, StringRef Value)
    :{}

uint32_t RCToken::intValue() const {}

bool RCToken::isLongInt() const {}

StringRef RCToken::value() const {}

Kind RCToken::kind() const {}

bool RCToken::isBinaryOp() const {}

static Error getStringError(const Twine &message) {}

namespace {

class Tokenizer {};

void Tokenizer::skipCurrentLine() {}

Expected<std::vector<RCToken>> Tokenizer::run() {}

bool Tokenizer::advance(size_t Amount) {}

bool Tokenizer::skipWhitespaces() {}

Error Tokenizer::consumeToken(const Kind TokenKind) {}

bool Tokenizer::willNowRead(StringRef FollowingChars) const {}

bool Tokenizer::canStartIdentifier() const {}

bool Tokenizer::canContinueIdentifier() const {}

bool Tokenizer::canStartInt() const {}

bool Tokenizer::canStartBlockComment() const {}

bool Tokenizer::canStartLineComment() const {}

bool Tokenizer::canContinueInt() const {}

bool Tokenizer::canStartString() const {}

bool Tokenizer::streamEof() const {}

Kind Tokenizer::classifyCurrentToken() const {}

void Tokenizer::processIdentifier(RCToken &Token) const {}

} // anonymous namespace

namespace llvm {

Expected<std::vector<RCToken>> tokenizeRC(StringRef Input) {}

} // namespace llvm