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
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
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
fixed: removed GetStringFromStream() method
it returns a reference to a local object (from stream.str())
now the code is used directly
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@972 e52654a7-88a9-db11-a3e9-0013d4bc506e
* This file is a part of EZC -- Easy templating in C++ library
* and is distributed under the BSD 3-Clause licence.
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@971 e52654a7-88a9-db11-a3e9-0013d4bc506e
changed: in Functions
Functions are only for user-defined functions now
(before they could remember a string variable too)
added: class Vars for variables
a variable can be a string or an alias to an other function or block
added: now we can have nested functions calls e.g.:
[function1 [function2]]
in the above example an output (stream) from function2 will be passed
as the first argument to funcion1 (will be passed as a string)
removed: UTF8() method from PatternParser
now it is treated that when we have only std::string (or char*)
that this is an UTF-8 string
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@970 e52654a7-88a9-db11-a3e9-0013d4bc506e
in Pattern we have only the tree
in PatternParser there is the whole logic used to parse a file
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@969 e52654a7-88a9-db11-a3e9-0013d4bc506e
Generate() methods can take std::vector with pointers to streams
added: 'ezc' keyword -- currently only for selecting streams
e.g.
[ezc stream "0" "3"] - after now the output is generated to streams 0 and 3
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@445 e52654a7-88a9-db11-a3e9-0013d4bc506e
a new statement [filter]
syntax:
[filter funcion_name]....[end]
everything which is between [filter] and [end] is processed normally and
at the end it is passed to the function (function_name)
FunInfo struct has 'in' input stream now
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@333 e52654a7-88a9-db11-a3e9-0013d4bc506e
you can cache all functions (their addresses) in the pattern
changed: now we have two methods for generating content:
Generator<>::Generate(StreamType & o, Pattern & p, Functions<StreamType> & f);
similar like previous -- Set(...) methods were removed as well as the second ctor
and a second one:
Generate(StreamType & o, Pattern & p);
without functions, the functions should be cached beforehand in the pattern
by calling CacheFunctions() method on the pattern
this gives O(1) complexity when looking for a specific function
previously was O(log n)
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@329 e52654a7-88a9-db11-a3e9-0013d4bc506e
they can be even used without the rest library
as only a library for converting between wide characters and UTF-8
changed: everywhere we use std::wstring instead of std::string
changed: Generator and Functions are templates now
they take a stream type
renamed: Info to FunInfo and it is a template too
taking a stream type
now you can use other kind of streams with the library
previous was only std::ostringstream
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@326 e52654a7-88a9-db11-a3e9-0013d4bc506e