rename the FunInfo struct to Env
This commit is contained in:
@@ -3,26 +3,34 @@
|
||||
./blocks.o: ../../pikotools/src/utf8/utf8.h
|
||||
./blocks.o: blocks.h
|
||||
./blocks.o: cache.h
|
||||
./blocks.o: env.h
|
||||
./blocks.o: functions.h
|
||||
./blocks.o: funinfo.h
|
||||
./blocks.o: item.h
|
||||
./blocks.o: objects.h
|
||||
./cache.o: ../../pikotools/src/textstream/stream.h
|
||||
./cache.o: ../../pikotools/src/utf8/utf8.h
|
||||
./cache.o: blocks.h
|
||||
./cache.o: cache.h
|
||||
./cache.o: env.h
|
||||
./cache.o: functions.h
|
||||
./cache.o: funinfo.h
|
||||
./cache.o: item.h
|
||||
./cache.o: objects.h
|
||||
./functions.o: ../../pikotools/src/textstream/stream.h
|
||||
./functions.o: ../../pikotools/src/utf8/utf8.h
|
||||
./functions.o: env.h
|
||||
./functions.o: functions.h
|
||||
./functions.o: item.h
|
||||
./item.o: item.h
|
||||
./models.o: models.h
|
||||
./objects.o: ../../pikotools/src/textstream/stream.h
|
||||
./objects.o: ../../pikotools/src/utf8/utf8.h
|
||||
./objects.o: objects.h
|
||||
./pattern.o: ../../pikotools/src/textstream/stream.h
|
||||
./pattern.o: ../../pikotools/src/utf8/utf8.h
|
||||
./pattern.o: blocks.h
|
||||
./pattern.o: cache.h
|
||||
./pattern.o: env.h
|
||||
./pattern.o: functions.h
|
||||
./pattern.o: funinfo.h
|
||||
./pattern.o: item.h
|
||||
./pattern.o: objects.h
|
||||
./pattern.o: pattern.h
|
||||
@@ -45,8 +53,8 @@
|
||||
./patternparser.o: ../../pikotools/src/utf8/utf8.h
|
||||
./patternparser.o: blocks.h
|
||||
./patternparser.o: cache.h
|
||||
./patternparser.o: env.h
|
||||
./patternparser.o: functions.h
|
||||
./patternparser.o: funinfo.h
|
||||
./patternparser.o: item.h
|
||||
./patternparser.o: objects.h
|
||||
./patternparser.o: pattern.h
|
||||
|
@@ -33,8 +33,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef headerfile_ezc_funinfo
|
||||
#define headerfile_ezc_funinfo
|
||||
#ifndef headerfile_ezc_env
|
||||
#define headerfile_ezc_env
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
@@ -144,7 +144,7 @@ struct Stack
|
||||
// !! IMPROVE ME
|
||||
// the name is bad
|
||||
// may it should be called Env (environment) or FunEnv
|
||||
struct FunInfo
|
||||
struct Env
|
||||
{
|
||||
// a result consists of a string and a boolean value
|
||||
// output stream
|
||||
@@ -207,7 +207,7 @@ struct FunInfo
|
||||
|
||||
|
||||
// arguments: output_stream, table_of_parameters, the_first_parameter
|
||||
FunInfo(pt::Stream & o,
|
||||
Env(pt::Stream & o,
|
||||
std::vector<Var> & pars,
|
||||
const std::wstring & first_par,
|
||||
const pt::Stream & input_stream,
|
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <map>
|
||||
#include "utf8/utf8.h"
|
||||
#include "funinfo.h"
|
||||
#include "env.h"
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class Functions
|
||||
{
|
||||
public:
|
||||
|
||||
typedef void (*UserFunction)(FunInfo &);
|
||||
typedef void (*UserFunction)(Env &);
|
||||
typedef std::map<std::wstring, UserFunction> FunctionsTable;
|
||||
typedef typename FunctionsTable::iterator Iterator;
|
||||
|
||||
|
@@ -313,9 +313,9 @@ private:
|
||||
bool FindInVariables(const std::wstring & name, FindHelper & find_helper);
|
||||
bool Find(Item::Function & item_fun, FindHelper & find_helper);
|
||||
|
||||
void PrepareEnvStruct(FunInfo & info);
|
||||
void PrepareEnvStruct(Env & info);
|
||||
|
||||
void CallFunction(typename Functions::UserFunction & function, FunInfo & info);
|
||||
void CallFunction(typename Functions::UserFunction & function, Env & info);
|
||||
|
||||
void CallFunction(typename Functions::UserFunction & function,
|
||||
std::vector<Var> & parameters,
|
||||
@@ -326,7 +326,7 @@ private:
|
||||
std::vector<Var> & parameters,
|
||||
pt::Stream & out_stream);
|
||||
|
||||
void CallObject(BaseObj & base_obj, int method_index, FunInfo & info);
|
||||
void CallObject(BaseObj & base_obj, int method_index, Env & info);
|
||||
|
||||
void PrintDate(pt::Date * date, std::vector<Var> & parameters, pt::Stream & out_stream);
|
||||
bool PrintDatePart(pt::Date * date, const std::wstring & field, std::vector<Var> & parameters, pt::Stream & out_stream);
|
||||
@@ -1202,7 +1202,7 @@ bool Generator::Find(Item::Function & item_fun, FindHelper & find_helper)
|
||||
|
||||
|
||||
|
||||
void Generator::PrepareEnvStruct(FunInfo & info)
|
||||
void Generator::PrepareEnvStruct(Env & info)
|
||||
{
|
||||
info.Clear();
|
||||
|
||||
@@ -1220,7 +1220,7 @@ void Generator::PrepareEnvStruct(FunInfo & info)
|
||||
|
||||
|
||||
|
||||
void Generator::CallFunction(typename Functions::UserFunction & function, FunInfo & info)
|
||||
void Generator::CallFunction(typename Functions::UserFunction & function, Env & info)
|
||||
{
|
||||
PrepareEnvStruct(info);
|
||||
(function)(info);
|
||||
@@ -1239,12 +1239,12 @@ void Generator::CallFunction(typename Functions::UserFunction & function,
|
||||
{
|
||||
if( parameters.empty() )
|
||||
{
|
||||
FunInfo info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
Env info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
CallFunction(function, info);
|
||||
}
|
||||
else
|
||||
{
|
||||
FunInfo info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
Env info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
CallFunction(function, info);
|
||||
}
|
||||
}
|
||||
@@ -1254,7 +1254,7 @@ void Generator::CallFunction(typename Functions::UserFunction & function,
|
||||
|
||||
|
||||
|
||||
void Generator::CallObject(BaseObj & base_obj, int method_index, FunInfo & info)
|
||||
void Generator::CallObject(BaseObj & base_obj, int method_index, Env & info)
|
||||
{
|
||||
PrepareEnvStruct(info);
|
||||
base_obj.CallFun(method_index, info);
|
||||
@@ -1715,14 +1715,14 @@ bool Generator::CallModelField(
|
||||
|
||||
if( parameters.empty() )
|
||||
{
|
||||
FunInfo info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
Env info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
PrepareEnvStruct(info);
|
||||
found = model.get_raw_value(nullptr, field.c_str(), nullptr, info, str, false);
|
||||
last_res = info.res;
|
||||
}
|
||||
else
|
||||
{
|
||||
FunInfo info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
Env info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
PrepareEnvStruct(info);
|
||||
found = model.get_raw_value(nullptr, field.c_str(), nullptr, info, str, false);
|
||||
last_res = info.res;
|
||||
@@ -1908,12 +1908,12 @@ void Generator::CallObject(BaseObj & base_obj,
|
||||
{
|
||||
if( parameters.empty() )
|
||||
{
|
||||
FunInfo info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
Env info(out_stream, parameters, empty, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
CallObject(base_obj, method_index, info);
|
||||
}
|
||||
else
|
||||
{
|
||||
FunInfo info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
Env info(out_stream, parameters, parameters[0].str, in_stream, stack_tab[stack_index-1], *stack_tab[stack_index-1].item);
|
||||
CallObject(base_obj, method_index, info);
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2021, Tomasz Sowa
|
||||
* Copyright (c) 2021-2024, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -38,7 +38,7 @@
|
||||
#ifdef EZC_HAS_MORM_LIBRARY
|
||||
|
||||
#include "wrapper.h"
|
||||
#include "funinfo.h"
|
||||
#include "env.h"
|
||||
#include "space/space.h"
|
||||
|
||||
|
||||
|
@@ -38,7 +38,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "utf8/utf8.h"
|
||||
#include "funinfo.h"
|
||||
#include "env.h"
|
||||
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
/*
|
||||
*
|
||||
*/
|
||||
virtual void CallFun(int fun_index, FunInfo &) = 0;
|
||||
virtual void CallFun(int fun_index, Env &) = 0;
|
||||
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user