klee
klee::expr::Token Struct Reference

#include <Lexer.h>

Public Types

enum  Kind {
  At , Arrow , Colon , Comma ,
  Comment , EndOfFile , Equals , Identifier ,
  KWArray , KWFalse , KWQuery , KWReserved ,
  KWSymbolic , KWTrue , KWWidth , LBrace ,
  LParen , LSquare , Number , RBrace ,
  RParen , RSquare , Semicolon , Unknown ,
  KWKindFirst =KWArray , KWKindLast =KWWidth
}
 

Public Member Functions

const char * getKindName () const
 getKindName - The name of this token's kind. More...
 
std::string getString () const
 
bool isKeyword () const
 isKeyword - True if this token is a keyword. More...
 
void dump ()
 
 Token ()
 

Public Attributes

Kind kind
 
const char * start
 The token kind. More...
 
unsigned length
 The beginning of the token string. More...
 
unsigned line
 The length of the token. More...
 
unsigned column
 The line number of the start of this token. More...
 

Detailed Description

Definition at line 21 of file Lexer.h.

Member Enumeration Documentation

◆ Kind

Enumerator
At 

'@'

Arrow 

'->'

Colon 

':'

Comma 

','

Comment 

#[^
]+

EndOfFile 

<end of file>

Equals 

' = '

Identifier 

[a-zA-Z_][a-zA-Z0-9._]*

KWArray 

'array'

KWFalse 

'false'

KWQuery 

'query'

KWReserved 

fp[0-9]+([.].*)?, i[0-9]+

KWSymbolic 

'symbolic'

KWTrue 

'true'

KWWidth 

w[0-9]+

LBrace 

'{'

LParen 

'('

LSquare 

'['

Number 

[+-]?[0-9][a-zA-Z0-9_]+

RBrace 

'}'

RParen 

')'

RSquare 

']'

Semicolon 

';'

Unknown 

<other>

KWKindFirst 
KWKindLast 

Definition at line 22 of file Lexer.h.

Constructor & Destructor Documentation

◆ Token()

klee::expr::Token::Token ( )
inline

Definition at line 74 of file Lexer.h.

Member Function Documentation

◆ dump()

void Token::dump ( )

Definition at line 54 of file Lexer.cpp.

References column, getKindName(), length, line, and start.

Here is the call graph for this function:

◆ getKindName()

const char * Token::getKindName ( ) const

getKindName - The name of this token's kind.

The column number at the start of this token.

Definition at line 24 of file Lexer.cpp.

References Arrow, At, Colon, Comma, Comment, EndOfFile, Equals, Identifier, kind, KWArray, KWFalse, KWQuery, KWReserved, KWSymbolic, KWTrue, KWWidth, LBrace, LParen, LSquare, Number, RBrace, RParen, RSquare, Semicolon, and Unknown.

Referenced by dump(), and PrintInputTokens().

Here is the caller graph for this function:

◆ getString()

std::string klee::expr::Token::getString ( ) const
inline

getString - The string spanned by this token. This is not particularly efficient, use start and length when reasonable.

Definition at line 64 of file Lexer.h.

References length, and start.

◆ isKeyword()

bool klee::expr::Token::isKeyword ( ) const
inline

isKeyword - True if this token is a keyword.

Definition at line 67 of file Lexer.h.

References kind, KWKindFirst, and KWKindLast.

Member Data Documentation

◆ column

unsigned klee::expr::Token::column

The line number of the start of this token.

Definition at line 56 of file Lexer.h.

Referenced by dump(), klee::expr::Lexer::Lex(), and PrintInputTokens().

◆ kind

Kind klee::expr::Token::kind

◆ length

unsigned klee::expr::Token::length

The beginning of the token string.

Definition at line 54 of file Lexer.h.

Referenced by dump(), getString(), klee::expr::Lexer::Lex(), LookupExprInfo(), PrintInputTokens(), and klee::expr::Lexer::SetTokenKind().

◆ line

unsigned klee::expr::Token::line

The length of the token.

Definition at line 55 of file Lexer.h.

Referenced by dump(), klee::expr::Lexer::Lex(), and PrintInputTokens().

◆ start

const char* klee::expr::Token::start

The documentation for this struct was generated from the following files: