klee::expr::Lexer Class Reference

Lexer - Interface for lexing tokens from a .pc language file. More...

#include <Lexer.h>

List of all members.

Public Member Functions

 Lexer (const llvm::MemoryBuffer *_buf)
 ~Lexer ()
TokenLex (Token &Result)

Private Member Functions

int GetNextChar ()
 The current column.
int PeekNextChar ()
TokenSetTokenKind (Token &Result, Token::Kind k)
TokenSetIdentifierTokenKind (Token &Result)
void SkipToEndOfLine ()
TokenLexNumber (Token &Result)
 LexNumber - Lex a number which does not have a base specifier.
TokenLexIdentifier (Token &Result)
 LexIdentifier - Lex an identifier.

Private Attributes

const char * BufferPos
const char * BufferEnd
 The current lexer position.
unsigned LineNumber
 The buffer end position.
unsigned ColumnNumber
 The current line.


Detailed Description

Lexer - Interface for lexing tokens from a .pc language file.

Definition at line 71 of file Lexer.h.


Constructor & Destructor Documentation

Lexer::Lexer ( const llvm::MemoryBuffer *  _buf  )  [explicit]

Definition at line 65 of file Lexer.cpp.

Lexer::~Lexer (  ) 

Definition at line 70 of file Lexer.cpp.


Member Function Documentation

int Lexer::GetNextChar (  )  [private]

The current column.

GetNextChar - Eat a character or -1 from the stream.

Definition at line 79 of file Lexer.cpp.

References BufferEnd, BufferPos, ColumnNumber, and LineNumber.

Referenced by Lex(), LexIdentifier(), LexNumber(), and SkipToEndOfLine().

Here is the caller graph for this function:

Token & Lexer::Lex ( Token Result  ) 

Token & Lexer::LexIdentifier ( Token Result  )  [private]

LexIdentifier - Lex an identifier.

Definition at line 196 of file Lexer.cpp.

References GetNextChar(), isInternalIdentifierChar(), PeekNextChar(), and SetIdentifierTokenKind().

Referenced by Lex().

Here is the call graph for this function:

Here is the caller graph for this function:

Token & Lexer::LexNumber ( Token Result  )  [private]

LexNumber - Lex a number which does not have a base specifier.

Definition at line 190 of file Lexer.cpp.

References GetNextChar(), klee::expr::Token::Number, PeekNextChar(), and SetTokenKind().

Referenced by Lex().

Here is the call graph for this function:

Here is the caller graph for this function:

int Lexer::PeekNextChar (  )  [private]

PeekNextChar - Return the next character without consuming it from the stream. This does not perform newline canonicalization.

Definition at line 73 of file Lexer.cpp.

References BufferEnd, and BufferPos.

Referenced by Lex(), LexIdentifier(), and LexNumber().

Here is the caller graph for this function:

Token & Lexer::SetIdentifierTokenKind ( Token Result  )  [private]

SetTokenKind - Set an identifiers token kind. This has the same requirements as SetTokenKind and additionally takes care of keyword recognition.

Definition at line 139 of file Lexer.cpp.

References BufferPos, klee::expr::Token::Identifier, isReservedKW(), isWidthKW(), klee::expr::Token::KWFalse, klee::expr::Token::KWQuery, klee::expr::Token::KWReserved, klee::expr::Token::KWTrue, klee::expr::Token::KWWidth, SetTokenKind(), and klee::expr::Token::start.

Referenced by LexIdentifier().

Here is the call graph for this function:

Here is the caller graph for this function:

Token & Lexer::SetTokenKind ( Token Result,
Token::Kind  k 
) [private]

SetTokenKind - Set the token kind and length (using the token's start pointer, which must have been initialized).

Definition at line 102 of file Lexer.cpp.

References BufferPos, klee::expr::Token::kind, klee::expr::Token::length, and klee::expr::Token::start.

Referenced by Lex(), LexNumber(), and SetIdentifierTokenKind().

Here is the caller graph for this function:

void Lexer::SkipToEndOfLine (  )  [private]

Definition at line 182 of file Lexer.cpp.

References GetNextChar().

Referenced by Lex().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

const char* klee::expr::Lexer::BufferEnd [private]

The current lexer position.

Definition at line 73 of file Lexer.h.

Referenced by GetNextChar(), and PeekNextChar().

const char* klee::expr::Lexer::BufferPos [private]

Definition at line 72 of file Lexer.h.

Referenced by GetNextChar(), Lex(), PeekNextChar(), SetIdentifierTokenKind(), and SetTokenKind().

unsigned klee::expr::Lexer::ColumnNumber [private]

The current line.

Definition at line 75 of file Lexer.h.

Referenced by GetNextChar(), and Lex().

unsigned klee::expr::Lexer::LineNumber [private]

The buffer end position.

Definition at line 74 of file Lexer.h.

Referenced by GetNextChar(), and Lex().


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

Generated on Fri Jun 5 03:33:41 2009 for klee by  doxygen 1.5.8