<commit_before>/***************************Copyright-DO-NOT-REMOVE-THIS-LINE**
 * CONDOR Copyright Notice
 *
 * See LICENSE.TXT for additional notices and disclaimers.
 *
 * Copyright (c)1990-1998 CONDOR Team, Computer Sciences Department, 
 * University of Wisconsin-Madison, Madison, WI.  All Rights Reserved.  
 * No use of the CONDOR Software Program Source Code is authorized 
 * without the express consent of the CONDOR Team.  For more information 
 * contact: CONDOR Team, Attention: Prof<NAME>, 
 * 7367 Computer Sciences, 1210 W. Dayton St., Madison, WI 53706-1685, 
 * (608) 262-0856 or <EMAIL>.
 *
 * U.S. Government Rights Restrictions: Use, duplication, or disclosure 
 * by the U.S. Government is subject to restrictions as set forth in 
 * subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer 
 * Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and 
 * (2) of Commercial Computer Software-Restricted Rights at 48 CFR 
 * 52.227-19, as applicable, CONDOR Team, Attention: Prof<NAME> 
 * Livny, 7367 Computer Sciences, 1210 W. Dayton St., Madison, 
 * WI 53706-1685, (608) 262-0856 or <EMAIL>.
****************************Copyright-DO-NOT-REMOVE-THIS-LINE**/

#ifndef __FN_CALL_H__
#define __FN_CALL_H__

#include <map>
#include <vector>
#include "classad.h"

BEGIN_NAMESPACE( classad )

typedef vector<ExprTree*> ArgumentList;

/// Node of the expression which represents a call to an inbuilt function
class FunctionCall : public ExprTree
{
	public:
		/// Constructor
		FunctionCall ();

		/// Destructor
		~FunctionCall ();

		static FunctionCall *MakeFunctionCall( const string &fnName, 
					vector<ExprTree*> &argList );
		void GetComponents( string &, vector<ExprTree*> &) const;

		virtual FunctionCall* Copy( ) const;

		typedef	bool(*ClassAdFunc)(const char*, const ArgumentList&, EvalState&,
					Value&);
		typedef map<string, void*, CaseIgnLTStr > FuncTable;

	private:
		virtual void _SetParentScope( const ClassAd* );
		virtual bool _Evaluate( EvalState &, Value & ) const;
		virtual bool _Evaluate( EvalState &, Value &, ExprTree *& ) const;
		virtual bool _Flatten( EvalState&, Value&, ExprTree*&, OpKind* ) const;

		// information common to all function calls
		// a mapping from function names (char*) to static methods
		static FuncTable functionTable;
		static bool		 initialized;

		// function call specific information<commit_msg>+ Added documentation + Made ctor protected + Changed _Flatten to take a int* instead of an OpKind*<commit_after>/***************************Copyright-DO-NOT-REMOVE-THIS-LINE**
 * CONDOR Copyright Notice
 *
 * See LICENSE.TXT for additional notices and disclaimers.
 *
 * Copyright (c)1990-1998 CONDOR Team, Computer Sciences Department, 
 * University of Wisconsin-Madison, Madison, WI.  All Rights Reserved.  
 * No use of the CONDOR Software Program Source Code is authorized 
 * without the express consent of the CONDOR Team.  For more information 
 * contact: CONDOR Team, Attention: Professor <NAME>, 
 * 7367 Computer Sciences, 1210 W. Dayton St., Madison, WI 53706-1685, 
 * (608) 262-0856 or <EMAIL>.
 *
 * U.S. Government Rights Restrictions: Use, duplication, or disclosure 
 * by the U.S. Government is subject to restrictions as set forth in 
 * subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer 
 * Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and 
 * (2) of Commercial Computer Software-Restricted Rights at 48 CFR 
 * 52.227-19, as applicable, CONDOR Team, Attention: <NAME> 
 * Livny, 7367 Computer Sciences, 1210 W. Dayton St., Madison, 
 * WI 53706-1685, (608) 262-0856 or <EMAIL>.
****************************Copyright-DO-NOT-REMOVE-THIS-LINE**/

#ifndef __FN_CALL_H__
#define __FN_CALL_H__

#include <map>
#include <vector>
#include "classad.h"

BEGIN_NAMESPACE( classad );

typedef vector<ExprTree*> ArgumentList;

/// Node of the expression which represents a call to an inbuilt function
class FunctionCall : public ExprTree
{
	public:
		/// Destructor
		~FunctionCall ();

		/** Factory method to make a function call expression
		 * 	@param fnName	The name of the function to be called
		 * 	@param argList	A vector representing the argument list
		 * 	@return The constructed function call expression
		 */
		static FunctionCall *MakeFunctionCall( const string &fnName, 
					vector<ExprTree*> &argList );

		/** Deconstructor to get the components of a function call
		 * 	@param fnName	The name of the function being called
		 * 	@param argList  The argument list
		 */
		void GetComponents( string &, vector<ExprTree*> &) const;

		/// Make a deep copy of the expression
		virtual FunctionCall* Copy( ) const;

	protected:
		/// Constructor
		FunctionCall ();

		typedef	bool(*ClassAdFunc)(const char*, const ArgumentList&, EvalState&,
					Value&);
		typedef map<string, void*, CaseIgnLTStr > FuncTable;

	private:
		virtual void _SetParentScope( const ClassAd* );
		virtual bool _Evaluate( EvalState &, Value & ) const;
		virtual bool _Evaluate( EvalState &, Value &, ExprTree *& ) const;
		virtual bool _Flatten( EvalState&, Value&, ExprTree*&, int* ) const;

		// information common to all function calls
		// a mapping from function names (char*) to static methods
		static FuncTable functionTable;
		static bool		 initialized;

		// function call specific information
{'fraction_non_alphanumeric': 0.11467116357504216, 'fraction_numerical': 0.03147835862844295, 'mean_word_length': 4.142581888246628, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '2244538', 'n_tokens_mistral': 1797, 'n_tokens_neox': 1525, 'n_words': 588}