klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 ()
 

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

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.

Member Function Documentation

void Token::dump ( )

Definition at line 54 of file Lexer.cpp.

References line.

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.

Referenced by PrintInputTokens().

Here is the caller graph for this function:

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.

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

unsigned klee::expr::Token::column

The line number of the start of this token.

Definition at line 56 of file Lexer.h.

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

Kind klee::expr::Token::kind
unsigned klee::expr::Token::length

The beginning of the token string.

Definition at line 54 of file Lexer.h.

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

unsigned klee::expr::Token::line

The length of the token.

Definition at line 55 of file Lexer.h.

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

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

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