OmniSciDB  04ee39c94c
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 175 of file ParserNode.h.

Constructor & Destructor Documentation

◆ FixedPtLiteral()

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

Definition at line 177 of file ParserNode.h.

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

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

References anonymous_namespace{ImportTest.cpp}::d(), kNUMERIC, and StringToDatum().

127  {
128  SQLTypeInfo ti(kNUMERIC, 0, 0, false);
130  return makeExpr<Analyzer::Constant>(ti, false, d);
131 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:268
Datum StringToDatum(const std::string &s, SQLTypeInfo &ti)
Definition: Datum.cpp:90
std::unique_ptr< std::string > fixedptval
Definition: ParserNode.h:189
+ 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 133 of file ParserNode.cpp.

References Datum::bigintval, anonymous_namespace{ImportTest.cpp}::d(), kNUMERIC, SQLTypeInfoCore< TYPE_FACET_PACK >::set_precision(), and SQLTypeInfoCore< TYPE_FACET_PACK >::set_scale().

Referenced by RelAlgTranslator::translateLiteral(), and anonymous_namespace{CalciteAdapter.cpp}::CalciteAdapter::translateTypedLiteral().

135  {
136  SQLTypeInfo ti(kNUMERIC, 0, 0, false);
137  ti.set_scale(scale);
138  ti.set_precision(precision);
139  Datum d;
140  d.bigintval = numericval;
141  return makeExpr<Analyzer::Constant>(ti, false, d);
142 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:268
int64_t bigintval
Definition: sqltypes.h:126
+ 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 178 of file ParserNode.h.

References anonymous_namespace{UpdateMetadataTest.cpp}::query.

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

◆ to_string()

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

Implements Parser::Literal.

Definition at line 186 of file ParserNode.h.

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

Member Data Documentation

◆ fixedptval

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

Definition at line 189 of file ParserNode.h.


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