added sign form parX for the FUNCTION block.

This commit is contained in:
nemu
2009-12-17 06:47:56 +00:00
parent 3635df7fc9
commit 20fa6f88fb
3 changed files with 37 additions and 3 deletions

View File

@ -76,6 +76,7 @@ typedef struct func_tree_node {
Int_t fOperatorTag; ///< tag for '+', '-', '*', '/'
Int_t fFunctionTag; ///< tag got "cos", "sin", ...
Int_t fIvalue; ///< for parameter numbers and maps
Bool_t fSign; ///< for sign, true means '-', false '+'
Double_t fDvalue; ///< for numbers
vector<func_tree_node> children; ///< holding sub-tree
} PFuncTreeNode;
@ -95,6 +96,7 @@ class PFunction {
virtual TString* GetFuncString() { return &fFuncString; }
protected:
virtual void InitNode(PFuncTreeNode &node);
virtual Bool_t SetFuncNo();
virtual Bool_t FindAndCheckMapAndParamRange(PFuncTreeNode &node, UInt_t mapSize, UInt_t paramSize);

View File

@ -85,7 +85,8 @@ struct PFunctionGrammar : public grammar<PFunctionGrammar>
fun_label = leaf_node_d[ ( lexeme_d[ "FUN" >> +digit_p ] ) ];
parameter = leaf_node_d[ ( lexeme_d[ "PAR" >> +digit_p ] ) ];
parameter = leaf_node_d[ ( lexeme_d[ "PAR" >> +digit_p ] ) |
( lexeme_d[ "-PAR" >> +digit_p ] ) ];
map = leaf_node_d[ ( lexeme_d[ "MAP" >> +digit_p ] ) ];