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

Constructor & Destructor Documentation

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

Definition at line 148 of file ParserNode.h.

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

Member Function Documentation

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

93  {
94  return analyzeValue(*stringval);
95 }
static std::shared_ptr< Analyzer::Expr > analyzeValue(const std::string &)
Definition: ParserNode.cpp:97
std::unique_ptr< std::string > stringval
Definition: ParserNode.h:158
std::shared_ptr< Analyzer::Expr > Parser::StringLiteral::analyzeValue ( const std::string &  stringval)
static

Definition at line 97 of file ParserNode.cpp.

References kVARCHAR, and Datum::stringval.

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

98  {
99  SQLTypeInfo ti(kVARCHAR, stringval.length(), 0, true);
100  Datum d;
101  d.stringval = new std::string(stringval);
102  return makeExpr<Analyzer::Constant>(ti, false, d);
103 }
std::string * stringval
Definition: sqltypes.h:134
std::unique_ptr< std::string > stringval
Definition: ParserNode.h:158

+ Here is the caller graph for this function:

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

Definition at line 149 of file ParserNode.h.

References stringval.

Referenced by Parser::anonymous_namespace{ParserNode.cpp}::bool_from_string_literal(), Parser::AddColumnStmt::execute(), Parser::CopyTableStmt::execute(), and Parser::ExportQueryStmt::execute().

149 { return stringval.get(); }
std::unique_ptr< std::string > stringval
Definition: ParserNode.h:158

+ Here is the caller graph for this function:

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

Implements Parser::Literal.

Definition at line 155 of file ParserNode.h.

References stringval.

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

Member Data Documentation

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

Definition at line 158 of file ParserNode.h.

Referenced by get_stringval(), and to_string().


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