Skip to content
Snippets Groups Projects
Select Git revision
  • dfc66876bfa9f155235a7a694d154f3cfe02079b
  • master default protected
  • vertical_relations
  • lu_without_semantic_frames
  • hierarchy
  • additional-unification-filters
  • v0.1.1
  • v0.1.0
  • v0.0.9
  • v0.0.8
  • v0.0.7
  • v0.0.6
  • v0.0.5
  • v0.0.4
  • v0.0.3
  • v0.0.2
  • v0.0.1
17 results

FreeLu.vue

Blame
  • debug.h 1.25 KiB
    #ifndef LIBWCCL_OPS_FUNCTIONS_BOOL_PREDICATES_DEBUG_H
    #define LIBWCCL_OPS_FUNCTIONS_BOOL_PREDICATES_DEBUG_H
    
    #include <libwccl/ops/functions/bool/predicate.h>
    #include <libwccl/values/value.h>
    
    namespace Wccl {
    
    /**
     * Diagnostic predicate that prints the value
     */
    class DebugPrint : public Predicate
    {
    public:
    	typedef boost::shared_ptr<FunctionBase> FunctionPtr;
    
    	DebugPrint(const FunctionPtr& expr)
    		: expr_(expr)
    	{
    		BOOST_ASSERT(expr_);
    	}
    
    	/**
    	 * @returns String representation of the function in the form of:
    	 * "inside(arg_expr_string)"
    	 */
    	std::string to_string(const Corpus2::Tagset& tagset) const;
    
    	/**
    	 * @returns Name of the function: "debug"
    	 */
    	std::string raw_name() const {
    		return "debug";
    	}
    
    protected:
    	const FunctionPtr expr_;
    
    	/**
    	 * Outputs the string value of the returned value
    	 * @returns True
    	 */
    	BaseRetValPtr apply_internal(const FunExecContext& context) const;
    
    	/**
    	 * Writes raw string representation of the function in the form of:
    	 * "debug(expr)"
    	 * @note This version doesn't require a tagset, but may be incomplete
    	 * and/or contain internal info.
    	 * @returns Stream written to.
    	 */
    	std::ostream& write_to(std::ostream& os) const;
    };
    
    
    } /* end ns Wccl */
    
    #endif // LIBWCCL_OPS_FUNCTIONS_BOOL_PREDICATES_DEBUG_H