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

Description

Tokens generated by the lexical analysis.

Definition at line 56 of file SymbolicExpressionParser.h.

#include <Rose/BinaryAnalysis/SymbolicExpressionParser.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 SymbolicExpression::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 SymbolicExpression::Type &exprType, const std::string &lexeme, unsigned lineNumber, unsigned columnNumber)
 Construct a token for a numeric constant. More...
 
SymbolicExpressionParser::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...
 
SymbolicExpression::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 59 of file SymbolicExpressionParser.h.

Constructor & Destructor Documentation

Rose::BinaryAnalysis::SymbolicExpressionParser::Token::Token ( )
inline

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

Definition at line 77 of file SymbolicExpressionParser.h.

Rose::BinaryAnalysis::SymbolicExpressionParser::Token::Token ( Type  tokenType,
const SymbolicExpression::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 81 of file SymbolicExpressionParser.h.

References BITVECTOR.

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

Construct a token for a numeric constant.

Definition at line 89 of file SymbolicExpressionParser.h.

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

Member Function Documentation

SymbolicExpressionParser::SyntaxError Rose::BinaryAnalysis::SymbolicExpressionParser::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 97 of file SymbolicExpressionParser.h.

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

Token type.

Definition at line 102 of file SymbolicExpressionParser.h.

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

Lexeme from which token was parsed.

Definition at line 105 of file SymbolicExpressionParser.h.

SymbolicExpression::Type Rose::BinaryAnalysis::SymbolicExpressionParser::Token::exprType ( ) const
inline

Type of expression.

Definition at line 108 of file SymbolicExpressionParser.h.

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

Bit vector for numeric constants.

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

Definition at line 111 of file SymbolicExpressionParser.h.

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

Line number for start of token.

Definition at line 114 of file SymbolicExpressionParser.h.

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

Column number for start of token.

Definition at line 117 of file SymbolicExpressionParser.h.


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