changed: [is ...] command
struct Info doesn't have out_string now git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@281 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
1 parent
dbe91a6d91
commit
b2aacc2da3
2 files changed
+211
-133
No files matched your search
@@ -35,11 +35,6 @@
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* version 0.9.2
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef headerfileezc
|
||||
#define headerfileezc
|
||||
@@ -87,13 +82,17 @@ public:
|
||||
item_include, item_is, item_ifone, item_comment, item_def
|
||||
};
|
||||
|
||||
|
||||
struct Directive
|
||||
{
|
||||
bool is_text; // if true that means a directive in quotes "static text"
|
||||
std::string name;
|
||||
};
|
||||
|
||||
|
||||
ItemType type;
|
||||
std::string text;
|
||||
std::vector<Item*> item_table;
|
||||
std::vector<std::string> directives;
|
||||
std::vector<Directive> directives;
|
||||
|
||||
Item();
|
||||
Item(const Item & i);
|
||||
@@ -128,6 +127,7 @@ private:
|
||||
|
||||
|
||||
bool CheckFileName(const char * name);
|
||||
std::string ReadFile(const std::string & name);
|
||||
std::string ReadFile(const char * name);
|
||||
|
||||
int ReadCharInText();
|
||||
@@ -135,9 +135,9 @@ private:
|
||||
void SkipWhiteCharacters();
|
||||
void CheckWhiteAndDelete(std::string & s);
|
||||
|
||||
std::string ReadDirective();
|
||||
std::string ReadString(bool skip_first_quote = false);
|
||||
std::string ReadDirectiveOrString();
|
||||
Item::Directive ReadDirective();
|
||||
Item::Directive ReadString();
|
||||
Item::Directive ReadDirectiveOrString();
|
||||
|
||||
void CreateTreeReadItemDirectiveCheckEnding(Item & item);
|
||||
|
||||
@@ -172,8 +172,12 @@ struct Info
|
||||
{
|
||||
// this variables you can set in your function
|
||||
std::ostringstream & out;
|
||||
std::string out_string;
|
||||
//std::string out_string;
|
||||
bool result;
|
||||
|
||||
// in a [is function "text"] statement this is the pointer to "text" object
|
||||
// otherwise this is null pointer
|
||||
const std::string * is;
|
||||
|
||||
// this is set by Generator
|
||||
// normally is 0
|
||||
@@ -183,15 +187,12 @@ struct Info
|
||||
|
||||
Info(std::ostringstream & o);
|
||||
void Clear();
|
||||
|
||||
bool IsTrue() const;
|
||||
bool IsFalse() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// functions or variables
|
||||
class Functions
|
||||
{
|
||||
public:
|
||||
@@ -252,8 +253,8 @@ private:
|
||||
bool Find(const std::string & key, Functions::Function ** function);
|
||||
|
||||
|
||||
bool Call(const std::string & name, Info & info, Functions::Function ** pfun = 0);
|
||||
void Call(Functions::Function * function, Info & info);
|
||||
void Call(Functions::Function * function, Info & info, const std::string * is = 0);
|
||||
bool Call(const std::string & name, Info & info, Functions::Function ** pfun = 0, const std::string * is = 0);
|
||||
|
||||
void CallUserFunction(Functions::Function * function, Info & info);
|
||||
void CallVariable(Functions::Function * function, Info & info);
|
||||
@@ -267,6 +268,8 @@ private:
|
||||
void MakeTextFor(Pattern::Item & item);
|
||||
void MakeTextContainer(Pattern::Item & item);
|
||||
void MakeTextNormal(Pattern::Item & item);
|
||||
bool MakeTextIsFunText(const std::string & fun_name, const std::string & text, bool & res);
|
||||
bool MakeTextIsFunFun(const std::string & fun_name1, const std::string & fun_name2, bool & res);
|
||||
void MakeTextIs(Pattern::Item & item);
|
||||
void MakeTextDefine(Pattern::Item & item);
|
||||
void MakeText(Pattern::Item & item);
|
||||
|
||||
Reference in new issue
Block a user