<commit_before>#ifndef EXPR_HPP
#define EXPR_HPP

/*
 * BIG TODO : Check exception safety and add exception specifications
 */

#include <functional>
#include <boost/any.hpp>

#include "globals.hpp"

class expression;

namespace ex {

struct abstract_visitor;

/**
 * Virtual super-class for expression tree
 *
 * All important types and functions for outside users are 
 * defined here.
 */
class expr {
public:

    /* It might be better to use policy class instead */
    //using ptr_type = std::unique_ptr<expr>;
    typedef expression ptr_type;
    typedef std::string string_type;
    typedef double eval_type;
    typedef std::function<eval_type(string_type)> valuation_type;
    typedef std::size_t size_type;

    virtual ptr_type clone() = 0;
    
    virtual size_type arity() = 0;
    virtual ptr_type & operator[] (size_type n) = 0;

    virtual void accept(abstract_visitor & v) = 0;
};


} // end namespace ex

#endif<commit_msg>syntax tree is completely stand-alone<commit_after>#ifndef EXPR_HPP
#define EXPR_HPP

/*
 * BIG TODO : Check exception safety and add exception specifications
 */

#include <functional>
#include <memory>

#include "globals.hpp"

class expression;

namespace ex {

struct abstract_visitor;

/**
 * Virtual super-class for expression tree
 *
 * All important types and functions for outside users are 
 * defined here.
 */
class expr {
public:

    /* It might be better to use policy class instead */
    //using ptr_type = std::unique_ptr<expr>;
    typedef std::unique_ptr<expr> ptr_type;
    typedef std::string string_type;
    typedef double eval_type;
    typedef std::function<eval_type(string_type)> valuation_type;
    typedef std::size_t size_type;

    virtual ptr_type clone() = 0;
    
    virtual size_type arity() = 0;
    virtual ptr_type & operator[] (size_type n) = 0;

    virtual void accept(abstract_visitor & v) = 0;
};


} // end namespace ex

#endif
{'fraction_non_alphanumeric': 0.0975991649269311, 'fraction_numerical': 0.0041753653444676405, 'mean_word_length': 3.698529411764706, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '3771639', 'n_tokens_mistral': 601, 'n_tokens_neox': 569, 'n_words': 191}