OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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::Expr
analyzeValue (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 174 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 176 of file ParserNode.h.

176 : fixedptval_(n) {}
std::unique_ptr< std::string > fixedptval_
Definition: ParserNode.h:188
constexpr double n
Definition: Utm.h:38

Member Function Documentation

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 182 of file ParserNode.cpp.

References kNUMERIC, and StringToDatum().

185  {
186  SQLTypeInfo ti(kNUMERIC, 0, 0, false);
187  Datum d = StringToDatum(*fixedptval_, ti);
188  return makeExpr<Analyzer::Constant>(ti, false, d);
189 }
std::unique_ptr< std::string > fixedptval_
Definition: ParserNode.h:188
Datum StringToDatum(const std::string_view s, SQLTypeInfo &ti)
Definition: Datum.cpp:339
Definition: Datum.h:71

+ Here is the call graph for this function:

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

Definition at line 191 of file ParserNode.cpp.

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

Referenced by RelAlgTranslator::translateLiteral().

193  {
194  SQLTypeInfo ti(kNUMERIC, 0, 0, false);
195  ti.set_scale(scale);
196  ti.set_precision(precision);
197  Datum d;
198  d.bigintval = numericval;
199  return makeExpr<Analyzer::Constant>(ti, false, d);
200 }
int64_t bigintval
Definition: Datum.h:76
Definition: Datum.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 177 of file ParserNode.h.

References fixedptval_.

177 { return fixedptval_.get(); }
std::unique_ptr< std::string > fixedptval_
Definition: ParserNode.h:188
std::string Parser::FixedPtLiteral::to_string ( ) const
inlineoverridevirtual

Implements Parser::Literal.

Definition at line 185 of file ParserNode.h.

References fixedptval_.

185 { return *fixedptval_; }
std::unique_ptr< std::string > fixedptval_
Definition: ParserNode.h:188

Member Data Documentation

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

Definition at line 188 of file ParserNode.h.

Referenced by get_fixedptval(), and to_string().


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