#include <Lexer.h>
Public Member Functions | |
| Lexer (const llvm::MemoryBuffer *_buf) | |
| ~Lexer () | |
| Token & | Lex (Token &Result) |
Private Member Functions | |
| int | GetNextChar () |
| The current column. | |
| int | PeekNextChar () |
| Token & | SetTokenKind (Token &Result, Token::Kind k) |
| Token & | SetIdentifierTokenKind (Token &Result) |
| void | SkipToEndOfLine () |
| Token & | LexNumber (Token &Result) |
| LexNumber - Lex a number which does not have a base specifier. | |
| Token & | LexIdentifier (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. | |
Definition at line 71 of file Lexer.h.
| Lexer::Lexer | ( | const llvm::MemoryBuffer * | _buf | ) | [explicit] |
| 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().

Lex - Return the next token from the file or EOF continually when the end of the file is reached. The input argument is used as the result, for convenience.
Definition at line 204 of file Lexer.cpp.
References klee::expr::Token::Arrow, klee::expr::Token::At, BufferPos, klee::expr::Token::Colon, klee::expr::Token::column, ColumnNumber, klee::expr::Token::Comma, klee::expr::Token::Comment, klee::expr::Token::EndOfFile, klee::expr::Token::Equals, GetNextChar(), klee::expr::Token::kind, klee::expr::Token::LBrace, klee::expr::Token::length, LexIdentifier(), LexNumber(), klee::expr::Token::line, LineNumber, klee::expr::Token::LParen, klee::expr::Token::LSquare, PeekNextChar(), klee::expr::Token::RBrace, klee::expr::Token::RParen, klee::expr::Token::RSquare, klee::expr::Token::Semicolon, SetTokenKind(), SkipToEndOfLine(), klee::expr::Token::start, and klee::expr::Token::Unknown.
Referenced by PrintInputTokens().


LexIdentifier - Lex an identifier.
Definition at line 196 of file Lexer.cpp.
References GetNextChar(), isInternalIdentifierChar(), PeekNextChar(), and SetIdentifierTokenKind().
Referenced by Lex().


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().


| 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().

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().


| 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().

| void Lexer::SkipToEndOfLine | ( | ) | [private] |
Definition at line 182 of file Lexer.cpp.
References GetNextChar().
Referenced by Lex().


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] |
unsigned klee::expr::Lexer::LineNumber [private] |
The buffer end position.
Definition at line 74 of file Lexer.h.
Referenced by GetNextChar(), and Lex().
1.5.8