CTPP2Compiler.hpp   CTPP2Compiler.hpp 
skipping to change at line 133 skipping to change at line 133
@param szScopeName - ARRAY name @param szScopeName - ARRAY name
@param iScopeNameLength - Length of ARRAY name @param iScopeNameLength - Length of ARRAY name
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 ChangeScope(CCHAR_P szScopeName, INT_32 ChangeScope(CCHAR_P szScopeName,
const UINT_32 iScopeNameLength, const UINT_32 iScopeNameLength,
const VMDebugInfo & oDebugInfo = VMDebugInfo()); const VMDebugInfo & oDebugInfo = VMDebugInfo());
/** /**
@brief Change visibility scope of CDT data (for ARRAY iterating)
@param szFullVariable - full variable name (ns + name)
@param iFullVariableLength - full variable name length
@param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured
*/
INT_32 ChangeForeachScope(CCHAR_P szFullVariable,
const UINT_32 iFullVariableLength,
const VMDebugInfo & oDebugInfo);
/**
@brief Change visibility scope of CDT data (for ARRAY-of-ARRAYS it
erating)
@param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured
*/
INT_32 ChangeContextScope(const VMDebugInfo & oDebugInfo);
/**
@brief Reset scope to previous CDT data (for ARRAY iterating) @brief Reset scope to previous CDT data (for ARRAY iterating)
@param iIP - instruction pointer @param iIP - instruction pointer
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 ResetScope(const UINT_32 iIP, INT_32 ResetScope(const UINT_32 iIP,
const VMDebugInfo & oDebugInfo = VMDebugInfo()); const VMDebugInfo & oDebugInfo = VMDebugInfo());
/** /**
@brief Reset scope to previous CDT data (for ARRAY/FOREACH iterati
ng)
@param iIP - instruction pointer
@param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured
*/
INT_32 ResetForeachScope(const UINT_32 iIP,
const VMDebugInfo & oDebugInfo = VMDebugIn
fo());
/**
@brief Execute system call such as HREF_PARAM, FORM_PARAM, etc @brief Execute system call such as HREF_PARAM, FORM_PARAM, etc
@param szSyscallName - syscall name @param szSyscallName - syscall name
@param iSyscallNameLength - Length of syscall name @param iSyscallNameLength - Length of syscall name
@param iArgNum - number of arguments @param iArgNum - number of arguments
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 ExecuteSyscall(CCHAR_P szSyscallName, INT_32 ExecuteSyscall(CCHAR_P szSyscallName,
const UINT_32 iSyscallNameLength, const UINT_32 iSyscallNameLength,
const UINT_32 iArgNum, const UINT_32 iArgNum,
skipping to change at line 203 skipping to change at line 176
INT_32 ClearPushComplexVariable(const VMDebugInfo & oDebugInfo); INT_32 ClearPushComplexVariable(const VMDebugInfo & oDebugInfo);
/** /**
@brief Push block's variable into stack @brief Push block's variable into stack
@param iIdx - stack position @param iIdx - stack position
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 PushBlockVariable(const UINT_32 iIdx, INT_32 PushBlockVariable(const UINT_32 iIdx,
const VMDebugInfo & oDebugInfo = VMDebugInf o()); const VMDebugInfo & oDebugInfo = VMDebugInf o());
/**
@brief Prepare local scope for searching variable
@param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured
*/
INT_32 PrepareLocalScope(const VMDebugInfo & oDebugInfo = VMDebugInfo()
);
/** /**
@brief Push variable into stack @brief Push variable into stack
@param szVariableName - variable name @param szVariableName - variable name
@param iVariableNameLength - Length of variable name @param iVariableNameLength - Length of variable name
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 PushVariable(CCHAR_P szVariableName, INT_32 PushVariable(CCHAR_P szVariableName,
const UINT_32 iVariableNameLength, const UINT_32 iVariableNameLength,
const VMDebugInfo & oDebugInfo = VMDebugInfo()) ; const VMDebugInfo & oDebugInfo = VMDebugInfo()) ;
/** /**
@brief Push contextual variable into stack
@param iTokenType - type of token
@param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured
*/
INT_32 PushContextualVariable(const eCTPP2LoopContextVar & iTokenTy
pe,
const VMDebugInfo & oDebugIn
fo = VMDebugInfo());
/**
@brief Push integer value into stack @brief Push integer value into stack
@param iVariable - value to push @param iVariable - value to push
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 PushInt(const INT_64 & iVariable, INT_32 PushInt(const INT_64 & iVariable,
const VMDebugInfo & oDebugInfo = VMDebugInfo()); const VMDebugInfo & oDebugInfo = VMDebugInfo());
/** /**
@brief Push Float value into stack @brief Push Float value into stack
skipping to change at line 289 skipping to change at line 261
@param iArgCount - number of arguments @param iArgCount - number of arguments
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 CallBlock(const STLW::string & sBlockName, INT_32 CallBlock(const STLW::string & sBlockName,
const bool & bIsVariable, const bool & bIsVariable,
const UINT_32 iArgCount, const UINT_32 iArgCount,
const VMDebugInfo & oDebugInfo = VMDebugInfo()); const VMDebugInfo & oDebugInfo = VMDebugInfo());
/** /**
@brief Call block by __CONTENT__ variable
@param iArgCount - number of arguments
@param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured
*/
INT_32 CallContextBlock(const UINT_32 iArgCount, const VMDebugInfo &
oDebugInfo = VMDebugInfo());
/**
@brief Start of block @brief Start of block
@param sBlockName - block name @param sBlockName - block name
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 StartBlock(const STLW::string & sBlockName, INT_32 StartBlock(const STLW::string & sBlockName,
const VMDebugInfo & oDebugInfo = VMDebugInfo()); const VMDebugInfo & oDebugInfo = VMDebugInfo());
/** /**
@brief End of block @brief End of block
skipping to change at line 432 skipping to change at line 396
*/ */
INT_32 StoreScopedVariable(CCHAR_P szNS, INT_32 StoreScopedVariable(CCHAR_P szNS,
const UINT_32 iNSLength, const UINT_32 iNSLength,
const VMDebugInfo & oDebugInfo); const VMDebugInfo & oDebugInfo);
/** /**
@brief Push variable into stack @brief Push variable into stack
@param szVariableName - variable name @param szVariableName - variable name
@param iVariableNameLength - variable name length @param iVariableNameLength - variable name length
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@param bNoPushVariable - don't push variable, but return 0
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 PushScopedVariable(CCHAR_P szName, INT_32 PushScopedVariable(CCHAR_P szName,
const UINT_32 iNameLength, const UINT_32 iNameLength,
CCHAR_P szFullVariable, CCHAR_P szFullVariable,
const UINT_32 iFullVariableLength, const UINT_32 iFullVariableLength,
const VMDebugInfo & oDebugInfo, const VMDebugInfo & oDebugInfo);
bool bNoPushVariable);
/** /**
@brief Push variable on stack into stack @brief Push variable on stack into stack
@param iStackPos - stack position @param iStackPos - stack position
@param oDebugInfo - debug information object @param oDebugInfo - debug information object
@return instruction pointer if success, -1 if any error occured @return instruction pointer if success, -1 if any error occured
*/ */
INT_32 PushStackVariable(const INT_32 iStackPos, INT_32 PushStackVariable(const INT_32 iStackPos,
const VMDebugInfo & oDebugInfo = VMDebugIn fo()); const VMDebugInfo & oDebugInfo = VMDebugIn fo());
 End of changes. 7 change blocks. 
53 lines changed or deleted 10 lines changed or added


 CTPP2Exception.hpp   CTPP2Exception.hpp 
skipping to change at line 260 skipping to change at line 260
/** @return A asciz string describing the general cause of error */ /** @return A asciz string describing the general cause of error */
CCHAR_P what() const throw(); CCHAR_P what() const throw();
/** A destructor */ /** A destructor */
~CTPPGetTextError() throw(); ~CTPPGetTextError() throw();
private: private:
/** Error description */ /** Error description */
CHAR_P sReason; CHAR_P sReason;
}; };
/**
@class CTPPNoMemory CTPP2Exception.hpp <CTPP2Exception.hpp>
@brief Gettext error
*/
class CTPP2DECL CTPPNoMemoryError:
public CTPPException
{
public:
/**
@brief Constrcutor
@param sIReason - Error description
*/
CTPPNoMemoryError() throw();
/** @return A asciz string describing the general cause of error */
CCHAR_P what() const throw();
/** A destructor */
~CTPPNoMemoryError() throw();
};
} // namespace CTPP } // namespace CTPP
#endif // _CTPP2_EXCEPTION_HPP__ #endif // _CTPP2_EXCEPTION_HPP__
// End. // End.
 End of changes. 1 change blocks. 
0 lines changed or deleted 21 lines changed or added


 CTPP2Parser.hpp   CTPP2Parser.hpp 
skipping to change at line 84 skipping to change at line 84
const INT_32 iIRecursionLevel = 0); const INT_32 iIRecursionLevel = 0);
/** /**
@brief Compile CTPP2 template @brief Compile CTPP2 template
@param iHalt - if set to 1, add to end of code HLT instruction @param iHalt - if set to 1, add to end of code HLT instruction
@return 0 if success, -1 if any error occured @return 0 if success, -1 if any error occured
*/ */
INT_32 Compile(const UINT_32 & iHalt = 1); INT_32 Compile(const UINT_32 & iHalt = 1);
/** /**
@brief Set parameter names translation map
@param oIParamTranslationMap - translation map
*/
void SetParamMap(const IncludeMapType & oIParamTranslationMap);
/**
@brief A destructor @brief A destructor
*/ */
~CTPP2Parser() throw(); ~CTPP2Parser() throw();
private: private:
typedef STLW::map<STLW::string, UINT_32> BlockArgMapType; typedef STLW::map<STLW::string, UINT_32> BlockArgMapType;
typedef STLW::map<STLW::string, UINT_32> BlockArgSizeMapType; typedef STLW::map<STLW::string, UINT_32> BlockArgSizeMapType;
enum eCTPP2Operator { UNDEF = 0, enum eCTPP2Operator { UNDEF = 0,
TMPL_var = 1, TMPL_var = 1,
TMPL_if = 2, TMPL_if = 2,
TMPL_unless = 3, TMPL_unless = 3,
TMPL_else = 4, TMPL_else = 4,
TMPL_elsif = 5, TMPL_elsif = 5,
TMPL_loop = 6, // TMPL_loop = 6, // Obsolete
TMPL_foreach = 7, TMPL_foreach = 7,
TMPL_include = 8, TMPL_include = 8,
TMPL_call = 9, TMPL_call = 9,
TMPL_udf = 10, TMPL_udf = 10,
TMPL_comment = 11, TMPL_comment = 11,
TMPL_break = 12, TMPL_break = 12,
TMPL_block = 13, TMPL_block = 13,
TMPL_verbose = 14 }; TMPL_verbose = 14 };
enum eCTPP2ExprOperator { EXPR_UNDEF = 0, enum eCTPP2ExprOperator { EXPR_UNDEF = 0,
skipping to change at line 166 skipping to change at line 160
CCHAR_P keyword; CCHAR_P keyword;
/** keyword length */ /** keyword length */
UINT_32 keyword_length; UINT_32 keyword_length;
/** keyword corresponding operator */ /** keyword corresponding operator */
eCTPP2Operator keyword_operator; eCTPP2Operator keyword_operator;
}; };
/** Keywords table */ /** Keywords table */
static CTPP2Keyword aKeywords[]; static CTPP2Keyword aKeywords[];
/** /**
@class CTPP2LoopKeyword CTPP2Parser.hpp <CTPP2Parser.hpp>
@brief CTPP2 reserverd words for loops
*/
struct CTPP2LoopKeyword
{
/** keyword */
CCHAR_P keyword;
/** keyword length */
UINT_32 keyword_length;
/** keyword corresponding operator */
UINT_32 keyword_operator;
};
/** Loop modifiers */
static CTPP2LoopKeyword aLoopKeywords [];
/**
@struct CTPP2Relation CTPP2Parser.hpp <CTPP2Parser.hpp> @struct CTPP2Relation CTPP2Parser.hpp <CTPP2Parser.hpp>
@brief CTPP2 Relation @brief CTPP2 Relation
*/ */
struct CTPP2Relation struct CTPP2Relation
{ {
/** keyword */ /** keyword */
CCHAR_P keyword; CCHAR_P keyword;
/** keyword length */ /** keyword length */
UINT_32 keyword_length; UINT_32 keyword_length;
/** keyword corresponding operator */ /** keyword corresponding operator */
eCTPP2Relation keyword_operator; eCTPP2Relation keyword_operator;
}; };
/** Relations */ /** Relations */
static CTPP2Relation aCTPP2Relations []; static CTPP2Relation aCTPP2Relations [];
/**
@struct CTPP2LoopContextVar CTPP2Parser.hpp <CTPP2Parser.hpp>
@brief CTPP2 Loop context variable
*/
struct CTPP2LoopContextVar
{
/** keyword */
CCHAR_P keyword;
/** keyword length */
UINT_32 keyword_length;
/** keyword corresponding operator */
eCTPP2LoopContextVar keyword_operator;
};
/** Loop context variable */
static CTPP2LoopContextVar aLoopContextVars [];
/** Current operator */ /** Current operator */
eCTPP2Operator eBreakFound; eCTPP2Operator eBreakFound;
/** Temp. buffer */ /** Temp. buffer */
STLW::string sTMPBuf; STLW::string sTMPBuf;
/** Parsed integer value */ /** Parsed integer value */
INT_64 iIntData; INT_64 iIntData;
/** Parsed floating value */ /** Parsed floating value */
W_FLOAT dFloatData; W_FLOAT dFloatData;
/** Type of parsed value */ /** Type of parsed value */
skipping to change at line 239 skipping to change at line 199
CTPP2SourceLoader * pSourceLoader; CTPP2SourceLoader * pSourceLoader;
/** Compiler */ /** Compiler */
CTPP2Compiler * pCTPP2Compiler; CTPP2Compiler * pCTPP2Compiler;
/** Syscalls */ /** Syscalls */
StaticText & oSyscalls; StaticText & oSyscalls;
/** Static data segment */ /** Static data segment */
StaticData & oStaticData; StaticData & oStaticData;
/** Static text segment */ /** Static text segment */
StaticText & oStaticText; StaticText & oStaticText;
/** Translation map */
IncludeMapType oParamTranslationMap;
/** Template source name */ /** Template source name */
STLW::string sSourceName; STLW::string sSourceName;
/** Template source name ID */ /** Template source name ID */
UINT_32 iSourceNameId; UINT_32 iSourceNameId;
/** Foreach flag */ /** Foreach flag */
bool bInForeach; bool bInForeach;
/** Recursion level */ /** Recursion level */
INT_32 iRecursionLevel; INT_32 iRecursionLevel;
/** Complex variable flag */ /** Complex variable flag */
bool bInsideComplexVariable; bool bInsideComplexVariable;
/** No push variable on stack */
bool bNoPushVariable;
/** No map variable */
bool bNoMapVariable;
/** enable/disable verbose mode */ /** enable/disable verbose mode */
bool bVerboseMode; bool bVerboseMode;
/** Block flag */ /** Block flag */
bool bInBlock; bool bInBlock;
/** Current block arguments */ /** Current block arguments */
BlockArgMapType mCurrentBlock; BlockArgMapType mCurrentBlock;
/** Map of number of arguments of blocks */ /** Map of number of arguments of blocks */
BlockArgSizeMapType mBlockArgSizes; BlockArgSizeMapType mBlockArgSizes;
/** JMP points for TMPL_break */
STLW::vector<STLW::vector<INT_32> > vBreakJMPPoints;
// Simple tokens: open and close tags, operators, variables, strings and numbers ////////////////////////////////////////////////////////////// //////////////////// // Simple tokens: open and close tags, operators, variables, strings and numbers ////////////////////////////////////////////////////////////// ////////////////////
/** /**
@brief Open tag ([Tt][Mm][Pp][Ll]) @brief Open tag ([Tt][Mm][Pp][Ll])
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator IsOpenTag(CCharIterator szData, CCharIterator szEnd); CCharIterator IsOpenTag(CCharIterator szData, CCharIterator szEnd);
/** /**
@brief Close tag (/[Tt][Mm][Pp][Ll]) @brief Close tag (/[Tt][Mm][Pp][Ll])
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator IsCloseTag(CCharIterator szData, CCharIterator szEnd); CCharIterator IsCloseTag(CCharIterator szData, CCharIterator szEnd);
/** /**
@brief Operator (var | if | else | unless | loop | foreach | udf | comment | call | break) @brief Operator (var | if | else | unless | foreach | udf | commen t | call | break)
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@param oOperatorType - operator type @param oOperatorType - operator type
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator IsOperator(CCharIterator szData, CCharIterator szEnd, eCTPP2Operator & oOperatorType); CCharIterator IsOperator(CCharIterator szData, CCharIterator szEnd, eCTPP2Operator & oOperatorType);
/** /**
@brief Function [a-zA-Z_][a-zA-Z0-9_]( Expr [, Expr2 ... ] ) @brief Function [a-zA-Z_][a-zA-Z0-9_]( Expr [, Expr2 ... ] )
@param szData - current stream position @param szData - current stream position
skipping to change at line 335 skipping to change at line 291
/** /**
@brief CTPP2 string "blah-blah \" clah-clah " | 'blah-blah \' clah -clah ' @brief CTPP2 string "blah-blah \" clah-clah " | 'blah-blah \' clah -clah '
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator IsString(CCharIterator szData, CCharIterator szEnd); CCharIterator IsString(CCharIterator szData, CCharIterator szEnd);
/** /**
@brief CTPP2 old fashion string blah-blah.clah-clah
@param szData - current stream position
@param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequenc
*/
CCharIterator IsStringCompatOldVersion(CCharIterator szData, CCharIt
erator szEnd);
/**
@brief Number [-]0-9[. [0-9] ] [E [+-] 0-9] @brief Number [-]0-9[. [0-9] ] [E [+-] 0-9]
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator IsNum(CCharIterator szData, CCharIterator szEnd); CCharIterator IsNum(CCharIterator szData, CCharIterator szEnd);
/** /**
@brief Parse Float value @brief Parse Float value
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
*/ */
void ParseFloat(CCharIterator & szData, CCharIterator & szEnd); void ParseFloat(CCharIterator & szData, CCharIterator & szEnd);
/** /**
@brief CTPP2 Loop contextual variable (__first__ | __last__ | __in
ner__ | __odd__ | __even__ | __counter__ | __size__ )
@param szData - current stream position
@param szEnd - end of stream position
@param eContextVariable - contextual variable that was found
@return NULL if sequence not found or pointer to end of sequence
*/
CCharIterator IsContextVar(CCharIterator szData, CCharIterator szEnd
, eCTPP2LoopContextVar & eContextVariable);
/**
@brief Loop operator keyword (__global_vars__ | __context_vars__ |
__no_global_vars__ | __no_context_vars__ )
@param szData - current stream position
@param szEnd - end of stream position
@param iLoopKeyword - keyword name
@return NULL if sequence not found or pointer to end of sequence
*/
CCharIterator IsLoopKeyword(CCharIterator szData, CCharIterator szEn
d, UINT_32 & iLoopKeyword);
/**
@brief Foreach operator keyword (as) @brief Foreach operator keyword (as)
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator IsForeachKeyword(CCharIterator szData, CCharIterator s zEnd); CCharIterator IsForeachKeyword(CCharIterator szData, CCharIterator s zEnd);
/** /**
@brief White space (Tab | ' ') @brief White space (Tab | ' ')
@param szData - current stream position @param szData - current stream position
skipping to change at line 523 skipping to change at line 453
/** /**
@brief CTPP2 reverse branch expression; &lt;TMPL_unless UnlessExpr &gt; @brief CTPP2 reverse branch expression; &lt;TMPL_unless UnlessExpr &gt;
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@param eResultOperator - Result operand of expression @param eResultOperator - Result operand of expression
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator IsUnlessExpr(CCharIterator szData, CCharIterator szEnd , eCTPP2ExprOperator & eResultOperator); CCharIterator IsUnlessExpr(CCharIterator szData, CCharIterator szEnd , eCTPP2ExprOperator & eResultOperator);
/** /**
@brief CTPP2 loop expression; &lt;TMPL_loop LoopExpr&gt;
@param szData - current stream position
@param szEnd - end of stream position
@param iRetPoint - return point instruction number [out]
@return NULL if sequence not found or pointer to end of sequence
*/
CCharIterator IsLoopExpr(CCharIterator szData, CCharIterator szEnd,
UINT_32 & iRetPoint);
/**
@brief Foreach expression &lt;TMPL_loop ForeachExpr&gt; @brief Foreach expression &lt;TMPL_loop ForeachExpr&gt;
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@param iRetPoint - return point instruction number [out] @param iRetPoint - return point instruction number [out]
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator IsForeachExpr(CCharIterator szData, CCharIterator szEn d, UINT_32 & iRetPoint); CCharIterator IsForeachExpr(CCharIterator szData, CCharIterator szEn d, UINT_32 & iRetPoint);
/**
@brief Break expression; &lt;TMPL_break BreakExpr&gt;
@param szData - current stream position
@param szEnd - end of stream position
@param iRetPoint - return point instruction number
@return NULL if sequence not found or pointer to end of sequence
*/
CCharIterator IsBreakExpr(CCharIterator szData, CCharIterator szEnd,
UINT_32 & iRetPoint);
// Operators /////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// //////////////////// // Operators /////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// ////////////////////
/** /**
@brief Variable/Function/Exression output operator&lt;TMPL_var Exp r&gt; @brief Variable/Function/Exression output operator&lt;TMPL_var Exp r&gt;
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator VarOperator(CCharIterator szData, CCharIterator szEnd) ; CCharIterator VarOperator(CCharIterator szData, CCharIterator szEnd) ;
skipping to change at line 576 skipping to change at line 488
/** /**
@brief Reverse branch operator &lt;TMPL_unless IfExpr&gt; blah-bla h-blah [ &lt;TMPL_else&gt; clah-clah-clah ] &lt;/TMPL_unless&gt; @brief Reverse branch operator &lt;TMPL_unless IfExpr&gt; blah-bla h-blah [ &lt;TMPL_else&gt; clah-clah-clah ] &lt;/TMPL_unless&gt;
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator UnlessOperator(CCharIterator szData, CCharIterator szE nd); CCharIterator UnlessOperator(CCharIterator szData, CCharIterator szE nd);
/** /**
@brief Loop operator &lt;TMPL_loop Expr&gt; blah-blah-blah &lt/TMP
L_loop&gt;
@param szData - current stream position
@param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence
*/
CCharIterator LoopOperator(CCharIterator szData, CCharIterator szEnd
);
/**
@brief Foreach operator &lt;TMPL_foreach var_array as var&gt; blah -blah-blah &lt/TMPL_foreach&gt; @brief Foreach operator &lt;TMPL_foreach var_array as var&gt; blah -blah-blah &lt/TMPL_foreach&gt;
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator ForeachOperator(CCharIterator szData, CCharIterator sz End); CCharIterator ForeachOperator(CCharIterator szData, CCharIterator sz End);
/** /**
@brief Include operator &lt;TMPL_include Expr&gt; @brief Include operator &lt;TMPL_include Expr&gt;
@param szData - current stream position @param szData - current stream position
skipping to change at line 631 skipping to change at line 535
CCharIterator BlockOperator(CCharIterator szData, CCharIterator szEn d); CCharIterator BlockOperator(CCharIterator szData, CCharIterator szEn d);
/** /**
@brief Ignore spaces &lt;TMPL_verbose&gt; ..... &lt/TMPL_verbose&g t; @brief Ignore spaces &lt;TMPL_verbose&gt; ..... &lt/TMPL_verbose&g t;
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence @return NULL if sequence not found or pointer to end of sequence
*/ */
CCharIterator VerboseOperator(CCharIterator szData, CCharIterator sz End); CCharIterator VerboseOperator(CCharIterator szData, CCharIterator sz End);
/**
@brief Break operator; &lt;TMPL_break&gt;
@param szData - current stream position
@param szEnd - end of stream position
@return NULL if sequence not found or pointer to end of sequence
*/
CCharIterator BreakOperator(CCharIterator szData, CCharIterator szEn
d);
// Other stuff ///////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// //////////////////// // Other stuff ///////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// ////////////////////
/** /**
@brief Parse CTPP2 template @brief Parse CTPP2 template
@param szData - template start @param szData - template start
@param szEnd - template end @param szEnd - template end
@return 0 if success, -1 if any error occured @return 0 if success, -1 if any error occured
*/ */
CCharIterator Parse(CCharIterator szData, CCharIterator szEnd); CCharIterator Parse(CCharIterator szData, CCharIterator szEnd);
/** /**
@brief CTPP2 include map: map { a:b, c:d }
@param szData - current stream position
@param szEnd - end of stream position
@param oIncludeTranslationMap - translation map
@return NULL if sequence not found or pointer to end of sequence
*/
CCharIterator IncludeMap(CCharIterator szData,
CCharIterator szEnd,
IncludeMapType & oIncludeTranslationMap);
/**
@brief Store comparison result (if branch) @brief Store comparison result (if branch)
@param szData - current position in stream @param szData - current position in stream
@param eResultOperator - type of parsed expression @param eResultOperator - type of parsed expression
@return instruction pointer to JMP or JXX instrution @return instruction pointer to JMP or JXX instrution
*/ */
UINT_32 StoreIfComparisonResult(CCharIterator szData, const eCTPP2Ex prOperator & eResultOperator); UINT_32 StoreIfComparisonResult(CCharIterator szData, const eCTPP2Ex prOperator & eResultOperator);
/** /**
@brief Store comparison result (unless branch) @brief Store comparison result (unless branch)
@param szData - current position in stream @param szData - current position in stream
@param eResultOperator - type of parsed expression @param eResultOperator - type of parsed expression
@return instruction pointer to JMP or JXX instrution @return instruction pointer to JMP or JXX instrution
*/ */
UINT_32 StoreUnlessComparisonResult(CCharIterator szData, const eCTP P2ExprOperator & eResultOperator); UINT_32 StoreUnlessComparisonResult(CCharIterator szData, const eCTP P2ExprOperator & eResultOperator);
/** /**
@brief Check translation map
@param sParam - parameter to check
*/
void CheckParamMap(STLW::string & sParam);
/**
@brief Get printable operator name @brief Get printable operator name
@param oOperator operator type @param oOperator operator type
@return printable operator name @return printable operator name
*/ */
CCHAR_P GetOperatorName(const eCTPP2Operator & oOperator); CCHAR_P GetOperatorName(const eCTPP2Operator & oOperator);
/** /**
@brief Check trailing newline flag @brief Check trailing newline flag
@param szData - current stream position @param szData - current stream position
@param szEnd - end of stream position @param szEnd - end of stream position
 End of changes. 16 change blocks. 
127 lines changed or deleted 13 lines changed or added


 CTPP2Syntax.h   CTPP2Syntax.h 
skipping to change at line 54 skipping to change at line 54
// Open tag // Open tag
#define CTPP2_OPEN_TAG "tmpl" #define CTPP2_OPEN_TAG "tmpl"
#define CTPP2_CLOSE_TAG "tmpl" #define CTPP2_CLOSE_TAG "tmpl"
// Operators // Operators
#define TMPL_VAR_TOK "var" #define TMPL_VAR_TOK "var"
#define TMPL_IF_TOK "if" #define TMPL_IF_TOK "if"
#define TMPL_ELSE_TOK "else" #define TMPL_ELSE_TOK "else"
#define TMPL_ELSIF_TOK "elsif" #define TMPL_ELSIF_TOK "elsif"
#define TMPL_UNLESS_TOK "unless" #define TMPL_UNLESS_TOK "unless"
#define TMPL_LOOP_TOK "loop"
#define TMPL_FOREACH_TOK "foreach" #define TMPL_FOREACH_TOK "foreach"
#define TMPL_UDF_TOK "udf" #define TMPL_UDF_TOK "udf"
#define TMPL_INCLUDE_TOK "include" #define TMPL_INCLUDE_TOK "include"
#define TMPL_CALL_TOK "call" #define TMPL_CALL_TOK "call"
#define TMPL_COMMENT_TOK "comment" #define TMPL_COMMENT_TOK "comment"
#define TMPL_BREAK_TOK "break" #define TMPL_BREAK_TOK "break"
#define TMPL_BLOCK_TOK "block" #define TMPL_BLOCK_TOK "block"
#define TMPL_VERBOSE_TOK "verbose" #define TMPL_VERBOSE_TOK "verbose"
// Loop modifiers
#define TMPL_GLOBAL_VARS_TOK "__global_vars__"
#define TMPL_CONTEXT_VARS_TOK "__context_vars__"
#define TMPL_NO_GLOBAL_VARS_TOK "__no_global_vars__"
#define TMPL_NO_CONTEXT_VARS_TOK "__no_context_vars__"
// Modifiers flags
#define TMPL_USE_GLOBAL_VARS 0x00000001
#define TMPL_USE_CONTEXT_VARS 0x00000002
#define TMPL_NO_GLOBAL_VARS 0x00000004
#define TMPL_NO_CONTEXT_VARS 0x00000008
// Loop context vars
#define TMPL_LOOP_FIRST_TOK "__first__"
#define TMPL_LOOP_LAST_TOK "__last__"
#define TMPL_LOOP_INNER_TOK "__inner__"
#define TMPL_LOOP_OUTER_TOK "__outer__"
#define TMPL_LOOP_ODD_TOK "__odd__"
#define TMPL_LOOP_EVEN_TOK "__even__"
#define TMPL_LOOP_COUNTER_TOK "__counter__"
#define TMPL_LOOP_RCOUNTER_TOK "__rcounter__"
#define TMPL_LOOP_SIZE_TOK "__size__"
#define TMPL_LOOP_CONTENT_TOK "__content__"
enum eCTPP2LoopContextVar { TMPL_LOOP_UNDEF = 0,
TMPL_LOOP_FIRST = 1,
TMPL_LOOP_LAST = 2,
TMPL_LOOP_INNER = 3,
TMPL_LOOP_OUTER = 4,
TMPL_LOOP_ODD = 5,
TMPL_LOOP_EVEN = 6,
TMPL_LOOP_COUNTER = 7,
TMPL_LOOP_RCOUNTER = 8,
TMPL_LOOP_SIZE = 9,
TMPL_LOOP_CONTENT = 10};
// Relations // Relations
#define TMPL_EQ "eq" #define TMPL_EQ "eq"
#define TMPL_NE "ne" #define TMPL_NE "ne"
#define TMPL_GT "gt" #define TMPL_GT "gt"
#define TMPL_LT "lt" #define TMPL_LT "lt"
#define TMPL_GE "ge" #define TMPL_GE "ge"
#define TMPL_LR "le" #define TMPL_LR "le"
#define TMPL_N_EQ "==" #define TMPL_N_EQ "=="
#define TMPL_N_NE "!=" #define TMPL_N_NE "!="
 End of changes. 2 change blocks. 
37 lines changed or deleted 0 lines changed or added


 CTPP2SysHeaders.h   CTPP2SysHeaders.h 
skipping to change at line 81 skipping to change at line 81
#define CTPP_ESCAPE_BUFFER_LEN 1024 #define CTPP_ESCAPE_BUFFER_LEN 1024
#define CTPP_MAX_TEMPLATE_RECURSION_DEPTH 1024 #define CTPP_MAX_TEMPLATE_RECURSION_DEPTH 1024
#define ICONV_SUPPORT 1 #define ICONV_SUPPORT 1
#define ICONV_DISCARD_ILSEQ 1 #define ICONV_DISCARD_ILSEQ 1
#define ICONV_TRANSLITERATE 1 #define ICONV_TRANSLITERATE 1
#define CTPP_VERSION "2.8.1" #define CTPP_VERSION "2.8.2"
#define CTPP_IDENT "Dzoraget" #define CTPP_IDENT "Dzoraget"
#define CTPP_MASTER_SITE_URL "http://ctpp.havoc.ru/" #define CTPP_MASTER_SITE_URL "http://ctpp.havoc.ru/"
/* #undef THROW_EXCEPTION_IN_COMPARATORS */ /* #undef THROW_EXCEPTION_IN_COMPARATORS */
#endif /* _CTPP2_SYS_HEADERS_H__ */ #endif /* _CTPP2_SYS_HEADERS_H__ */
/* End. */ /* End. */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 CTPP2Util.hpp   CTPP2Util.hpp 
skipping to change at line 47 skipping to change at line 47
@file CTPP2Util.hpp @file CTPP2Util.hpp
@brief CTPP2 useful utilities @brief CTPP2 useful utilities
*/ */
namespace CTPP // C++ Template Engine namespace CTPP // C++ Template Engine
{ {
// FWD // FWD
class CDT; class CDT;
/** /**
@class DumpBuffer CTPP2Util.hpp <CTPP2Util.hpp>
@brief Buffer for dumping CDTs. Used as an alternative for std::string (a
s string's append is quite slow)
*/
class DumpBuffer {
public:
/**
@var typedef UINT_32 StreamSize
@brief internal size_t analog
*/
typedef UINT_32 StreamSize;
/**
@brief Constructor
*/
DumpBuffer();
/**
@brief Destructor
*/
~DumpBuffer();
/**
@brief Appends data to the buffer
@param data - ponter to data to append
@param n - number of bytes to append
*/
void Write(CCHAR_P pData , StreamSize iSize);
/**
@brief Returns pointer to buffer's start
@return Pointer to buffer's start
*/
CCHAR_P Data() const;
/**
@brief Returns number of bytes available in buffer
@return Number of bytes available in buffer
*/
StreamSize Size() const;
private:
/**
@brief Reallocates buffer if necessary
@param n - new capacity (if it's less then current capacity, metho
d does nothing)
*/
void Reserve(StreamSize iSize);
CHAR_P pBuffer;
CHAR_P pPos;
StreamSize iCapacity;
};
/**
@fn UINT_32 crc32(UCCHAR_P sBuffer, const UINT_32 & iSize) @fn UINT_32 crc32(UCCHAR_P sBuffer, const UINT_32 & iSize)
@brief Calculate crc32 checksum @brief Calculate crc32 checksum
@param sBuffer - buffer with source data to calculate CRC @param sBuffer - buffer with source data to calculate CRC
@param iSize - buffer size @param iSize - buffer size
@return CRC32 checksum @return CRC32 checksum
*/ */
UINT_32 crc32(UCCHAR_P sBuffer, const UINT_32 & iSize); UINT_32 crc32(UCCHAR_P sBuffer, const UINT_32 & iSize);
/** /**
@fn UINT_32 Swap32(const UINT_32 & iValue) @fn UINT_32 Swap32(const UINT_32 & iValue)
skipping to change at line 120 skipping to change at line 174
/** /**
@fn void CDT2JSON(const CTPP::CDT & oCDT, STLW::string & sData) @fn void CDT2JSON(const CTPP::CDT & oCDT, STLW::string & sData)
@brief Dump CDT to JSON @brief Dump CDT to JSON
@param oCDT - input data @param oCDT - input data
@param sData - output string @param sData - output string
*/ */
void CDT2JSON(const CDT & oCDT, STLW::string & sData); void CDT2JSON(const CDT & oCDT, STLW::string & sData);
/** /**
@fn void DumpCDT2JSON(const CTPP::CDT & oCDT, DumpBuffer & oBuffer)
@brief Dump CDT to JSON
@param oCDT - input data
@param oBuffer - buffer to dump CDT to
@return reference to oBuffer
*/
DumpBuffer & DumpCDT2JSON(const CTPP::CDT & oCDT, DumpBuffer & oBuffer);
/**
@brief Escape string, if need @brief Escape string, if need
@param sSource - input data @param sSource - input data
@param bECMAConventions - use ECMA-262 conventions for escape sequences @param bECMAConventions - use ECMA-262 conventions for escape sequences
@return Escaped string @return Escaped string
*/ */
STLW::string EscapeJSONString(const STLW::string & sSource, STLW::string EscapeJSONString(const STLW::string & sSource,
const bool & bECMAConventions = true , const bool & bECMAConventions = true ,
const bool & bHTMLSafe = true); const bool & bHTMLSafe = true);
/** /**
@brief Escape and dump string to buffer
@param oBuffer - buffer to dump string to
@param sSource - input data
@param bECMAConventions - use ECMA-262 conventions for escape sequences
@return reference to oBuffer
*/
DumpBuffer & DumpJSONString(DumpBuffer& oBuffer,
const STLW::string & sSource,
const bool & bECMAConventions = true,
const bool & bHTMLSafe = true);
/**
@fn STLW::string Base64Encode(const STLW::string & sData); @fn STLW::string Base64Encode(const STLW::string & sData);
@brief Encode value in BASE64 encoding @brief Encode value in BASE64 encoding
@param sData - value to encode @param sData - value to encode
@return Encoded value @return Encoded value
*/ */
STLW::string Base64Encode(const STLW::string & sData); STLW::string Base64Encode(const STLW::string & sData);
/** /**
@fn STLW::string Base64Decode(const STLW::string & sData); @fn STLW::string Base64Decode(const STLW::string & sData);
@brief Decode value from BASE64 encoding @brief Decode value from BASE64 encoding
 End of changes. 3 change blocks. 
0 lines changed or deleted 77 lines changed or added


 CTPP2VMOpcodes.h   CTPP2VMOpcodes.h 
skipping to change at line 63 skipping to change at line 63
#define CALLNAME 0x01020000 // Call procedure by name #define CALLNAME 0x01020000 // Call procedure by name
#define CALLIND 0x01030000 // Call procedure by name given in regs iter or stack (indirect) #define CALLIND 0x01030000 // Call procedure by name given in regs iter or stack (indirect)
#define CALL 0x01040000 // Procedure call #define CALL 0x01040000 // Procedure call
#define RET 0x01050000 // Return from procedure #define RET 0x01050000 // Return from procedure
#define JMP 0x01060000 // Unconditional jump #define JMP 0x01060000 // Unconditional jump
#define LOOP 0x01070000 // Loop #define LOOP 0x01070000 // Loop
#define RCALL 0x01140000 // Procedure call, relational version #define RCALL 0x01140000 // Procedure call, relational version
#define RJMP 0x01160000 // Unconditional jump, relational versi on #define RJMP 0x01160000 // Unconditional jump, relational versi on
#define RLOOP 0x01170000 // Loop, relational version #define RLOOP_OBSOLETE 0x01170000 // Loop, relational version
// Stack operations //// 0x-2-X---- /////////////////////////////////////// ///////////////////////// // Stack operations //// 0x-2-X---- /////////////////////////////////////// /////////////////////////
#define PUSH 0x02010000 // Push value into stack #define PUSH 0x02010000 // Push value into stack
#define POP 0x02020000 // Pop value from stack #define POP 0x02020000 // Pop value from stack
#define PUSH13 0x02030000 // Push AR, BR, CR, DR registers into s tack #define PUSH13 0x02030000 // Push AR, BR, CR, DR registers into s tack
#define POP13 0x02040000 // Pop AR, BR, CR, DR registers from st ack #define POP13 0x02040000 // Pop AR, BR, CR, DR registers from st ack
#define PUSH47 0x02050000 // Push ER, FR, GR, HR registers into s tack #define PUSH47 0x02050000 // Push ER, FR, GR, HR registers into s tack
#define POP47 0x02060000 // Pop ER, FR, GR, HR registers from st ack #define POP47 0x02060000 // Pop ER, FR, GR, HR registers from st ack
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/