ROSE  0.11.52.0
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 55 of file SymbolicExprParser.h.

#include <SymbolicExprParser.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 tokenType, const SymbolicExpr::Type &exprType, const std::string &lexeme, unsigned lineNumber, unsigned columnNumber)
 Constructs a specific token from a string. More...
 
 Token (const Sawyer::Container::BitVector &bv, const SymbolicExpr::Type &exprType, 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 tokenType () const
 Token type. More...
 
const std::string & lexeme () const
 Lexeme from which token was parsed. More...
 
SymbolicExpr::Type exprType () const
 Type of expression. 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 58 of file SymbolicExprParser.h.

Constructor & Destructor Documentation

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

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

Definition at line 76 of file SymbolicExprParser.h.

Rose::BinaryAnalysis::SymbolicExprParser::Token::Token ( Type  tokenType,
const SymbolicExpr::Type exprType,
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 80 of file SymbolicExprParser.h.

References BITVECTOR.

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

Construct a token for a numeric constant.

Definition at line 88 of file SymbolicExprParser.h.

References Rose::BinaryAnalysis::SymbolicExpr::Type::nBits(), and Sawyer::Container::BitVector::size().

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 96 of file SymbolicExprParser.h.

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

Token type.

Definition at line 101 of file SymbolicExprParser.h.

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

Lexeme from which token was parsed.

Definition at line 104 of file SymbolicExprParser.h.

SymbolicExpr::Type Rose::BinaryAnalysis::SymbolicExprParser::Token::exprType ( ) const
inline

Type of expression.

Definition at line 107 of file SymbolicExprParser.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 110 of file SymbolicExprParser.h.

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

Line number for start of token.

Definition at line 113 of file SymbolicExprParser.h.

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

Column number for start of token.

Definition at line 116 of file SymbolicExprParser.h.


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