<commit_before>//===----------------------------------------------------------------------===//
//
//                         Peloton
//
// sql_node_visitor.h
//
// Identification: src/include/common/sql_node_visitor.h
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//

#pragma once

namespace peloton {

namespace parser {
class SelectStatement;
class CreateStatement;
class InsertStatement;
class DeleteStatement;
class DropStatement;
class PrepareStatement;
class ExecuteStatement;
class TransactionStatement;
class UpdateStatement;
class CopyStatement;
struct JoinDefinition;
struct TableRef;

class GroupByDescription;
class OrderDescription;
class LimitDescription;
}

namespace expression {
class AbstractExpression;
class ComparisonExpression;
class AggregateExpression;
class ConjunctionExpression;
class ConstantValueExpression;
class OperatorExpression;
class ParameterValueExpression;
class StarExpression;
class TupleValueExpression;
class FunctionExpression;
class OperatorUnaryMinusExpression;
}

//===--------------------------------------------------------------------===//
// Query Node Visitor
//===--------------------------------------------------------------------===//

class SqlNodeVisitor {
 public:
  virtual ~SqlNodeVisitor(){};

  virtual void Visit(const parser::SelectStatement *) = 0;

  // Some sub query nodes inside SelectStatement
  virtual void Visit(const parser::JoinDefinition *) = 0;
  virtual void Visit(const parser::TableRef *) = 0;
  virtual void Visit(const parser::GroupByDescription *) = 0;
  virtual void Visit(const parser::OrderDescription *) = 0;
  virtual void Visit(const parser::LimitDescription *) = 0;

  virtual void Visit(const parser::CreateStatement *) = 0;
  virtual void Visit(const parser::InsertStatement *) = 0;
  virtual void Visit(const parser::DeleteStatement *) = 0;
  virtual void Visit(const parser::DropStatement *) = 0;
  virtual void Visit(const parser::PrepareStatement *) = 0;
  virtual void Visit(const parser::ExecuteStatement *) = 0;
  virtual void Visit(const parser::TransactionStatement *) = 0;
  virtual void Visit(const parser::UpdateStatement *) = 0;
  virtual void Visit(const parser::CopyStatement *) = 0;

  virtual void Visit(expression::ComparisonExpression *expr);
  virtual void Visit(expression::AggregateExpression *expr);
  virtual void Visit(expression::ConjunctionExpression *expr);
  virtual void Visit(expression::ConstantValueExpression *expr);
  virtual void Visit(expression::FunctionExpression *expr);
  virtual void Visit(expression::OperatorExpression *expr);
  virtual void Visit(expression::OperatorUnaryMinusExpression *expr);
  virtual void Visit(expression::ParameterValueExpression *expr);
  virtual void Visit(expression::StarExpression *expr);
  virtual void Visit(expression::TupleValueExpression *expr);
};

} /* namespace peloton */<commit_msg>Do not use pure virtual function in SqlNodeVisitor<commit_after>//===----------------------------------------------------------------------===//
//
//                         Peloton
//
// sql_node_visitor.h
//
// Identification: src/include/common/sql_node_visitor.h
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//

#pragma once

namespace peloton {

namespace parser {
class SelectStatement;
class CreateStatement;
class InsertStatement;
class DeleteStatement;
class DropStatement;
class PrepareStatement;
class ExecuteStatement;
class TransactionStatement;
class UpdateStatement;
class CopyStatement;
struct JoinDefinition;
struct TableRef;

class GroupByDescription;
class OrderDescription;
class LimitDescription;
}

namespace expression {
class AbstractExpression;
class ComparisonExpression;
class AggregateExpression;
class ConjunctionExpression;
class ConstantValueExpression;
class OperatorExpression;
class ParameterValueExpression;
class StarExpression;
class TupleValueExpression;
class FunctionExpression;
class OperatorUnaryMinusExpression;
}

//===--------------------------------------------------------------------===//
// Query Node Visitor
//===--------------------------------------------------------------------===//

class SqlNodeVisitor {
 public:
  virtual ~SqlNodeVisitor(){};

  virtual void Visit(const parser::SelectStatement *) {}

  // Some sub query nodes inside SelectStatement
  virtual void Visit(const parser::JoinDefinition *) {}
  virtual void Visit(const parser::TableRef *) {}
  virtual void Visit(const parser::GroupByDescription *) {}
  virtual void Visit(const parser::OrderDescription *) {}
  virtual void Visit(const parser::LimitDescription *) {}

  virtual void Visit(const parser::CreateStatement *) {}
  virtual void Visit(const parser::InsertStatement *) {}
  virtual void Visit(const parser::DeleteStatement *) {}
  virtual void Visit(const parser::DropStatement *) {}
  virtual void Visit(const parser::PrepareStatement *) {}
  virtual void Visit(const parser::ExecuteStatement *) {}
  virtual void Visit(const parser::TransactionStatement *) {}
  virtual void Visit(const parser::UpdateStatement *) {}
  virtual void Visit(const parser::CopyStatement *) {}

  virtual void Visit(expression::ComparisonExpression *expr);
  virtual void Visit(expression::AggregateExpression *expr);
  virtual void Visit(expression::ConjunctionExpression *expr);
  virtual void Visit(expression::ConstantValueExpression *expr);
  virtual void Visit(expression::FunctionExpression *expr);
  virtual void Visit(expression::OperatorExpression *expr);
  virtual void Visit(expression::OperatorUnaryMinusExpression *expr);
  virtual void Visit(expression::ParameterValueExpression *expr);
  virtual void Visit(expression::StarExpression *expr);
  virtual void Visit(expression::TupleValueExpression *expr);
};

} /* namespace peloton */
{'fraction_non_alphanumeric': 0.18965807646959745, 'fraction_numerical': 0.004547751389590703, 'mean_word_length': 3.4546136534133534, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6872306', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1325, 'n_words': 400}