e.g.:
[for space_object]
[space_object.this] instead of [space_object "current"]
[end]
"this" can be nested, e.g. if we have two nested tables:
[for space_object]
[for space_object.this]
[space_object.this.this]
[end]
[end]
removed: "current" parameter for tables
changed: added one new parameter to Outstreams class: template<class StreamType, bool is_pikotools_stream = false> class OutStreams
removed macros: EZC_GENERATOR_HAS_PT_STREAM, EZC_GENERATOR_HAS_WINIX_STREAM
[if-def my_function] returns true if my_function is defined somewhere (either a model, model container, space, date, block, function or variable)
add support for "noescape" or "raw" parameters to Space fields
fixed: CallWrapper() didn't return a status if a model/space/date/container was found
[ezc clear_all_white_nodes "yes"]...[end] - will clear a text node if the text consists of only white characters
[ezc trim_text_nodes "yes"]...[end] - will trim text nodes (removes white characters at the beginning and at the end)
"yes" is assumed by default if not present, also "no" can be specified to change the behavior
- "dump" or "dump_to_space" parameters to make a dump in Space format
- "dump_to_json" parameter to make json dump
- "pretty" parameter to make the dump pretty (with new lines and indents)
added macro EZC_GENERATOR_HAS_WINIX_STREAM which is used by Generator::CopyStream(pt::WTextStream & src_stream, StreamType & dst_stream, bool should_escape)
if this macro is defined then Generator is able to escape output stream
- added method SetLogger(pt::Log & logger)
- removed SetCommentary(...) methods
- added logs when a model is not found
PatternParser uses only pt::Log
- removed SetCommentary(...) methods
now we are using morm::ModelWrapper... classes as wrappers on models and list/vector of models
and Models class is using these wrappers
this allows us to iterate through list/vectors in [for...] statements
- [def] is used to define a variable (like before)
but if we assign a string such as [def var "string"] the string is evaluated to bool
in a different way: empty string is false, not empty string is true
- added [def?] statement - similar like [def] but define a variable only if such
a variable is not already defined
- added [let] statement - similar like [def] but with lazy evaluation (it is an alias to a function)
if it is called to assign a string e.g. [let var "string"] then this has the
same meaning like [def] - an alias is only created when we assign a function e.g. [let var my_function]
both [def] and [let] are using the same Vars object
- added [let?] - make an alias but only if such a variable is not already defined
- a std::map of variables moved outside of Generator
added method void SetVariables(Vars & variables);
- fixed: a result status was not correctly propagated when evaluating [def] statements,
this was in Call(...) function: last_res from variables was set in Find()
but later was overwritten by Call(...) called for parameters (recursively)
fixed: container was not correctly parsed (in template mode)
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@1139 e52654a7-88a9-db11-a3e9-0013d4bc506e
this will be mainly used in conjuction with [for ...] statements
[for my_function:xxx]
[for my_function]
[my_function_value]
[my_function_valu:xxx] (references the first loop)
[end]
[end]
added: to FunInfo<>: a reference to current item from a pattern (const Item & item)
similary on the stack is added a pointer to an item
by having this reference you can compare a function's name and its postfix
added methods:
Stack * FindLastFor(const std::wstring & name);
Stack * FindLastFor(const std::wstring & name, const std::wstring & postfix);
template<class FunUserObject> FunUserObject * FindUserObject(const std::wstring & function_name, Stack ** ezc_stack = 0);
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@1038 e52654a7-88a9-db11-a3e9-0013d4bc506e
the syntax has been changed, now [ezc ...] is used with [end] statement
added: OutStreams<StreamType> class with a pool with output streams,
the Generator::Generate() method can take it as its argument
(Generator API has been changed)
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@1014 e52654a7-88a9-db11-a3e9-0013d4bc506e
added: objects.h with a base class for the object
and Objects container (similar as Functions container)
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@1011 e52654a7-88a9-db11-a3e9-0013d4bc506e
now this [fun1 fun2 "something" fun3]
will call fun1 with three arguments: fun2, "something" and fun3
and this [fun1 [fun2 "something"] fun3]
will call fun1 with two arguments: [fun2 "something] and fun3
"something" is an argument for fun2 function
removed: statements: [if-one] [if-any] [if-no] [if-any-no] [if-one-no]
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@1004 e52654a7-88a9-db11-a3e9-0013d4bc506e
we can provide a user definied function which does the same
added: to FunInfo<>:
Stack * stack_tab
size_t stack_index
a stack table and an index to the current stack item
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@988 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed: a user definied function now is able to get a string and a boolean value (parameters)
changed: we do not longer support aliases for variables
a variable is only a string and a boolean value now
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@981 e52654a7-88a9-db11-a3e9-0013d4bc506e
(copied from cache.h)
fixed: in Generator: memory leak from block_stack
objects pointing by block_stack_tab[].out_stream
were not deleted
fixed: in Item: ClearCache() didn't clear all pointers
Function::parameters table were not used
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@979 e52654a7-88a9-db11-a3e9-0013d4bc506e
(now we have a tree in Item::Function.parameters too
and we should go through that tree as well)
fixed: in Generator: Item::Function.par should be cleared
only if Item::Function.name is not empty
changed: in Generator: use method 'write' of an output stream
instead of operator<<
added: Clear() method to Blocks class
changed: in Generator
Generator has its own Vars class now
we don't need SetVars() method
added: to Generator:
void CanUseCache(bool can_use_cache);
// set whether or not we can use cache for functions or blocks
// true by default
void CanUseVars(bool can_use_variables);
// set whether or not we can use variables: [def ...] statement
// true by default
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@977 e52654a7-88a9-db11-a3e9-0013d4bc506e
added: caching functions and blocks
caching is added into Pattern and Blocks
methods: CacheFunctions() and CacheBlocks()
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@975 e52654a7-88a9-db11-a3e9-0013d4bc506e