OmniSciDB  f632821e96
Parser::FixedPtLiteral Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::FixedPtLiteral:
+ Collaboration diagram for Parser::FixedPtLiteral:

Public Member Functions

 FixedPtLiteral (std::string *n)
 
const std::string * get_fixedptval () const
 
std::shared_ptr< Analyzer::Expranalyze (const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
 
std::string to_string () const override
 
- Public Member Functions inherited from Parser::Node
virtual ~Node ()
 

Static Public Member Functions

static std::shared_ptr< Analyzer::ExpranalyzeValue (const int64_t numericval, const int scale, const int precision)
 

Private Attributes

std::unique_ptr< std::string > fixedptval
 

Additional Inherited Members

- Public Types inherited from Parser::Expr
enum  TlistRefType { TLIST_NONE, TLIST_REF, TLIST_COPY }
 

Detailed Description

Definition at line 169 of file ParserNode.h.

Constructor & Destructor Documentation

◆ FixedPtLiteral()

Parser::FixedPtLiteral::FixedPtLiteral ( std::string *  n)
inlineexplicit

Definition at line 171 of file ParserNode.h.

171 : fixedptval(n) {}
std::unique_ptr< std::string > fixedptval
Definition: ParserNode.h:183

Member Function Documentation

◆ analyze()

std::shared_ptr< Analyzer::Expr > Parser::FixedPtLiteral::analyze ( const Catalog_Namespace::Catalog catalog,
Analyzer::Query query,
TlistRefType  allow_tlist_ref = TLIST_NONE 
) const
overridevirtual

Implements Parser::Literal.

Definition at line 131 of file ParserNode.cpp.

References kNUMERIC, and StringToDatum().

134  {
135  SQLTypeInfo ti(kNUMERIC, 0, 0, false);
136  Datum d = StringToDatum(*fixedptval, ti);
137  return makeExpr<Analyzer::Constant>(ti, false, d);
138 }
Datum StringToDatum(std::string_view s, SQLTypeInfo &ti)
Definition: Datum.cpp:124
std::unique_ptr< std::string > fixedptval
Definition: ParserNode.h:183
+ Here is the call graph for this function:

◆ analyzeValue()

std::shared_ptr< Analyzer::Expr > Parser::FixedPtLiteral::analyzeValue ( const int64_t  numericval,
const int  scale,
const int  precision 
)
static

Definition at line 140 of file ParserNode.cpp.

References Datum::bigintval, kNUMERIC, SQLTypeInfo::set_precision(), and SQLTypeInfo::set_scale().

Referenced by RelAlgTranslator::translateLiteral().

142  {
143  SQLTypeInfo ti(kNUMERIC, 0, 0, false);
144  ti.set_scale(scale);
145  ti.set_precision(precision);
146  Datum d;
147  d.bigintval = numericval;
148  return makeExpr<Analyzer::Constant>(ti, false, d);
149 }
int64_t bigintval
Definition: sqltypes.h:138
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_fixedptval()

const std::string* Parser::FixedPtLiteral::get_fixedptval ( ) const
inline

Definition at line 172 of file ParserNode.h.

172 { return fixedptval.get(); }
std::unique_ptr< std::string > fixedptval
Definition: ParserNode.h:183

◆ to_string()

std::string Parser::FixedPtLiteral::to_string ( ) const
inlineoverridevirtual

Implements Parser::Literal.

Definition at line 180 of file ParserNode.h.

180 { return *fixedptval; }
std::unique_ptr< std::string > fixedptval
Definition: ParserNode.h:183

Member Data Documentation

◆ fixedptval

std::unique_ptr<std::string> Parser::FixedPtLiteral::fixedptval
private

Definition at line 183 of file ParserNode.h.


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