ROSE  0.9.10.44
Public Types | Public Member Functions | List of all members
Rose::BinaryAnalysis::SymbolicExprParser::Token Class Reference

Description

Tokens generated by the lexical analysis.

Definition at line 37 of file BinarySymbolicExprParser.h.

#include <BinarySymbolicExprParser.h>

Public Types

enum  Type {
  NONE = 0,
  LTPAREN,
  RTPAREN,
  BITVECTOR,
  SYMBOL
}
 Token types. More...
 

Public Member Functions

 Token ()
 Constructs an end-of-input token with no position information. More...
 
 Token (Type type, size_t width, const std::string &lexeme, unsigned lineNumber, unsigned columnNumber)
 Constructs a specific token from a string. More...
 
 Token (Type type, size_t width, size_t width2, const std::string &lexeme, unsigned lineNumber, unsigned columnNumber)
 Constructs a specific token from a string. More...
 
 Token (const Sawyer::Container::BitVector &bv, const std::string &lexeme, unsigned lineNumber, unsigned columnNumber)
 Construct a token for a numeric constant. More...
 
SymbolicExprParser::SyntaxError syntaxError (const std::string &mesg, const std::string &name="input") const
 Creates a syntax error from a token plus message. More...
 
Type type () const
 Token type. More...
 
const std::string & lexeme () const
 Lexeme from which token was parsed. More...
 
size_t width () const
 Width of expression in bits. More...
 
size_t width2 () const
 Width of domain (address) in bits for memory states. More...
 
const Sawyer::Container::BitVectorbits () const
 Bit vector for numeric constants. More...
 
unsigned lineNumber () const
 Line number for start of token. More...
 
unsigned columnNumber () const
 Column number for start of token. More...
 

Member Enumeration Documentation

Token types.

Enumerator
NONE 

End of input.

LTPAREN 

Left parenthesis.

RTPAREN 

Right parenthesis.

BITVECTOR 

Numeric constant.

SYMBOL 

Symbol.

Symbols are basically anything but white space, comments, and the other token types.

Definition at line 40 of file BinarySymbolicExprParser.h.

Constructor & Destructor Documentation

Rose::BinaryAnalysis::SymbolicExprParser::Token::Token ( )
inline

Constructs an end-of-input token with no position information.

Definition at line 59 of file BinarySymbolicExprParser.h.

Rose::BinaryAnalysis::SymbolicExprParser::Token::Token ( Type  type,
size_t  width,
const std::string &  lexeme,
unsigned  lineNumber,
unsigned  columnNumber 
)
inline

Constructs a specific token from a string.

Do not use this to construct numeric tokens.

Definition at line 63 of file BinarySymbolicExprParser.h.

References BITVECTOR.

Rose::BinaryAnalysis::SymbolicExprParser::Token::Token ( Type  type,
size_t  width,
size_t  width2,
const std::string &  lexeme,
unsigned  lineNumber,
unsigned  columnNumber 
)
inline

Constructs a specific token from a string.

Do not use this to construct numeric tokens.

Definition at line 70 of file BinarySymbolicExprParser.h.

References BITVECTOR.

Rose::BinaryAnalysis::SymbolicExprParser::Token::Token ( const Sawyer::Container::BitVector bv,
const std::string &  lexeme,
unsigned  lineNumber,
unsigned  columnNumber 
)
inline

Construct a token for a numeric constant.

Definition at line 77 of file BinarySymbolicExprParser.h.

Member Function Documentation

SymbolicExprParser::SyntaxError Rose::BinaryAnalysis::SymbolicExprParser::Token::syntaxError ( const std::string &  mesg,
const std::string &  name = "input" 
) const
inline

Creates a syntax error from a token plus message.

Definition at line 82 of file BinarySymbolicExprParser.h.

Type Rose::BinaryAnalysis::SymbolicExprParser::Token::type ( ) const
inline

Token type.

Definition at line 87 of file BinarySymbolicExprParser.h.

const std::string& Rose::BinaryAnalysis::SymbolicExprParser::Token::lexeme ( ) const
inline

Lexeme from which token was parsed.

Definition at line 90 of file BinarySymbolicExprParser.h.

size_t Rose::BinaryAnalysis::SymbolicExprParser::Token::width ( ) const
inline

Width of expression in bits.

Definition at line 93 of file BinarySymbolicExprParser.h.

size_t Rose::BinaryAnalysis::SymbolicExprParser::Token::width2 ( ) const
inline

Width of domain (address) in bits for memory states.

Definition at line 96 of file BinarySymbolicExprParser.h.

const Sawyer::Container::BitVector& Rose::BinaryAnalysis::SymbolicExprParser::Token::bits ( ) const
inline

Bit vector for numeric constants.

The bit vector will be empty for non-numeric tokens.

Definition at line 99 of file BinarySymbolicExprParser.h.

unsigned Rose::BinaryAnalysis::SymbolicExprParser::Token::lineNumber ( ) const
inline

Line number for start of token.

Definition at line 102 of file BinarySymbolicExprParser.h.

unsigned Rose::BinaryAnalysis::SymbolicExprParser::Token::columnNumber ( ) const
inline

Column number for start of token.

Definition at line 105 of file BinarySymbolicExprParser.h.


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