LLVM 20.0.0git
Functions | Variables
TGLexer.cpp File Reference
#include "TGLexer.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Config/config.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/TableGen/Error.h"
#include <algorithm>
#include <cerrno>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>

Go to the source code of this file.

Functions

static bool isValidIDChar (char C, bool First)
 Returns true if C is a valid character in an identifier.
 
static const charlexMacroName (StringRef Str)
 

Variables

constexpr PreprocessorDir PreprocessorDirs []
 

Function Documentation

◆ isValidIDChar()

static bool isValidIDChar ( char  C,
bool  First 
)
static

Returns true if C is a valid character in an identifier.

If First is true, returns true if C is a valid first character of an identifier, else returns true if C is a valid non-first character of an identifier. Identifiers match the following regular expression: [a-zA-Z_][0-9a-zA-Z_]*

Definition at line 46 of file TGLexer.cpp.

References llvm::CallingConv::C, llvm::First, and isDigit().

Referenced by lexMacroName().

◆ lexMacroName()

static const char * lexMacroName ( StringRef  Str)
static

Definition at line 60 of file TGLexer.cpp.

References assert(), End, and isValidIDChar().

Referenced by llvm::TGLexer::TGLexer().

Variable Documentation

◆ PreprocessorDirs

constexpr PreprocessorDir PreprocessorDirs[]
constexpr
Initial value:
= {{tgtok::Ifdef, "ifdef"},
{tgtok::Ifndef, "ifndef"},
{tgtok::Else, "else"},
{tgtok::Endif, "endif"},
{tgtok::Define, "define"}}

Definition at line 52 of file TGLexer.cpp.