OmniSciDB  c07336695a
Parser::StringLiteral Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::StringLiteral:
+ Collaboration diagram for Parser::StringLiteral:

Public Member Functions

 StringLiteral (std::string *s)
 
const std::string * get_stringval () 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 std::string &)
 

Private Attributes

std::unique_ptr< std::string > stringval
 

Additional Inherited Members

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

Detailed Description

Definition at line 135 of file ParserNode.h.

Constructor & Destructor Documentation

◆ StringLiteral()

Parser::StringLiteral::StringLiteral ( std::string *  s)
inlineexplicit

Definition at line 137 of file ParserNode.h.

137 : stringval(s) {}
std::unique_ptr< std::string > stringval
Definition: ParserNode.h:147

Member Function Documentation

◆ analyze()

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

Implements Parser::Literal.

Definition at line 86 of file ParserNode.cpp.

89  {
90  return analyzeValue(*stringval);
91 }
static std::shared_ptr< Analyzer::Expr > analyzeValue(const std::string &)
Definition: ParserNode.cpp:93
std::unique_ptr< std::string > stringval
Definition: ParserNode.h:147

◆ analyzeValue()

std::shared_ptr< Analyzer::Expr > Parser::StringLiteral::analyzeValue ( const std::string &  stringval)
static

Definition at line 93 of file ParserNode.cpp.

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

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

94  {
95  SQLTypeInfo ti(kVARCHAR, stringval.length(), 0, true);
96  Datum d;
97  d.stringval = new std::string(stringval);
98  return makeExpr<Analyzer::Constant>(ti, false, d);
99 }
void d(const SQLTypes expected_type, const std::string &str)
Definition: ImportTest.cpp:268
std::unique_ptr< std::string > stringval
Definition: ParserNode.h:147
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_stringval()

const std::string* Parser::StringLiteral::get_stringval ( ) const
inline

Definition at line 138 of file ParserNode.h.

References anonymous_namespace{UpdateMetadataTest.cpp}::query.

Referenced by Parser::AddColumnStmt::execute(), Parser::CopyTableStmt::execute(), and Parser::ExportQueryStmt::execute().

138 { return stringval.get(); }
std::unique_ptr< std::string > stringval
Definition: ParserNode.h:147
+ Here is the caller graph for this function:

◆ to_string()

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

Implements Parser::Literal.

Definition at line 144 of file ParserNode.h.

144 { return "'" + *stringval + "'"; }
std::unique_ptr< std::string > stringval
Definition: ParserNode.h:147

Member Data Documentation

◆ stringval

std::unique_ptr<std::string> Parser::StringLiteral::stringval
private

Definition at line 147 of file ParserNode.h.


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