OmniSciDB  04ee39c94c
Parser::IsNullExpr Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::IsNullExpr:
+ Collaboration diagram for Parser::IsNullExpr:

Public Member Functions

 IsNullExpr (bool n, Expr *a)
 
bool get_is_not () 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 ()
 

Private Attributes

bool is_not
 
std::unique_ptr< Exprarg
 

Additional Inherited Members

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

Detailed Description

Definition at line 345 of file ParserNode.h.

Constructor & Destructor Documentation

◆ IsNullExpr()

Parser::IsNullExpr::IsNullExpr ( bool  n,
Expr a 
)
inline

Definition at line 347 of file ParserNode.h.

347 : is_not(n), arg(a) {}
std::unique_ptr< Expr > arg
Definition: ParserNode.h:357

Member Function Documentation

◆ analyze()

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

Implements Parser::Expr.

Definition at line 340 of file ParserNode.cpp.

References kBOOLEAN, kISNULL, kNOT, and run-benchmark-import::result.

343  {
344  auto arg_expr = arg->analyze(catalog, query, allow_tlist_ref);
345  auto result = makeExpr<Analyzer::UOper>(kBOOLEAN, kISNULL, arg_expr);
346  if (is_not) {
347  result = makeExpr<Analyzer::UOper>(kBOOLEAN, kNOT, result);
348  }
349  return result;
350 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:357
Definition: sqldefs.h:39

◆ get_is_not()

bool Parser::IsNullExpr::get_is_not ( ) const
inline

Definition at line 348 of file ParserNode.h.

References anonymous_namespace{UpdateMetadataTest.cpp}::query, and to_string().

348 { return is_not; }
+ Here is the call graph for this function:

◆ to_string()

std::string Parser::IsNullExpr::to_string ( ) const
overridevirtual

Implements Parser::Expr.

Definition at line 1370 of file ParserNode.cpp.

1370  {
1371  std::string str = arg->to_string();
1372  if (is_not) {
1373  str += " IS NOT NULL";
1374  } else {
1375  str += " IS NULL";
1376  }
1377  return str;
1378 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:357

Member Data Documentation

◆ arg

std::unique_ptr<Expr> Parser::IsNullExpr::arg
private

Definition at line 357 of file ParserNode.h.

◆ is_not

bool Parser::IsNullExpr::is_not
private

Definition at line 356 of file ParserNode.h.


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