ROSE 0.11.145.192
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.
 
 Token (Type tokenType, const SymbolicExpression::Type &exprType, const std::string &lexeme, unsigned lineNumber, unsigned columnNumber)
 Constructs a specific token from a string.
 
 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.
 
SymbolicExpressionParser::SyntaxError syntaxError (const std::string &mesg, const std::string &name="input") const
 Creates a syntax error from a token plus message.
 
Type tokenType () const
 Token type.
 
const std::string & lexeme () const
 Lexeme from which token was parsed.
 
SymbolicExpression::Type exprType () const
 Type of expression.
 
const Sawyer::Container::BitVectorbits () const
 Bit vector for numeric constants.
 
unsigned lineNumber () const
 Line number for start of token.
 
unsigned columnNumber () const
 Column number for start of token.
 

Member Enumeration Documentation

◆ Type

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

◆ Token() [1/3]

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

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

Definition at line 77 of file SymbolicExpressionParser.h.

◆ Token() [2/3]

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, and tokenType().

◆ Token() [3/3]

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 exprType(), Rose::BinaryAnalysis::SymbolicExpression::Type::nBits(), and Sawyer::Container::BitVector::size().

Member Function Documentation

◆ syntaxError()

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.

◆ tokenType()

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

Token type.

Definition at line 102 of file SymbolicExpressionParser.h.

Referenced by Token().

◆ lexeme()

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

Lexeme from which token was parsed.

Definition at line 105 of file SymbolicExpressionParser.h.

◆ exprType()

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

Type of expression.

Definition at line 108 of file SymbolicExpressionParser.h.

Referenced by Token().

◆ bits()

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.

◆ lineNumber()

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

Line number for start of token.

Definition at line 114 of file SymbolicExpressionParser.h.

◆ columnNumber()

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: