Parser#

#include <Parser.h>

Representation des donnees de la classe Parser .

How to cite this class in this doc#

:ref:`Parser <class-parser>`
[Parser](#class-parser)

Detailed description#

Inherited by#

List of Public Methods#

List of Protected Methods#

List of Protected Static Methods#

Complete Member Function Documentation#

addCst
void Parser::addCst(const Constante &cst)
References
Referenced By
How to cite in this doc:
:ref:`void Parser::addCst(const Constante &cst) <public-void-parser-addcst-const-constante-ref-cst>`
[void Parser::addCst(const Constante &cst)](#public-void-parser-addcst-const-constante-ref-cst)
addVar
void Parser::addVar(const char *)

permet d’ajouter une variable en specifiant sa chaine representative (par ex. : x, y1 etc…)

References
Referenced By
How to cite in this doc:
:ref:`void Parser::addVar(const char *) <public-void-parser-addvar-const-char-ptr>`
[void Parser::addVar(const char *)](#public-void-parser-addvar-const-char-ptr)
eval
double Parser::eval()

Sert a evaluer l’expression mathematique correspondante a la chaine de caracteres. Poru cela il faut avant toute chose construire l’arbre par la methode parseString() .

References
Referenced By
How to cite in this doc:
:ref:`double Parser::eval() <public-double-parser-eval>`
[double Parser::eval()](#public-double-parser-eval)
getmaxVar
int Parser::getmaxVar()
References
Referenced By
How to cite in this doc:
:ref:`int Parser::getmaxVar() <public-int-parser-getmaxvar>`
[int Parser::getmaxVar()](#public-int-parser-getmaxvar)
getNbVar
int Parser::getNbVar()
References
Referenced By
How to cite in this doc:
:ref:`int Parser::getNbVar() <public-int-parser-getnbvar>`
[int Parser::getNbVar()](#public-int-parser-getnbvar)
getString
std::string & Parser::getString()
References
Referenced By
How to cite in this doc:
:ref:`std::string & Parser::getString() <public-std-string-ref-parser-getstring>`
[std::string & Parser::getString()](#public-std-string-ref-parser-getstring)
init_parser
void Parser::init_parser()
References
Referenced By
How to cite in this doc:
:ref:`void Parser::init_parser() <public-void-parser-init-parser>`
[void Parser::init_parser()](#public-void-parser-init-parser)
Parser
Parser::Parser()

Initialise le parser avec une chaine “0” : ne sert a rien !!

References
How to cite in this doc:
:ref:`Parser::Parser() <public-parser-parser>`
[Parser::Parser()](#public-parser-parser)
Parser
Parser::Parser(const Parser &)
References
How to cite in this doc:
:ref:`Parser::Parser(const Parser &) <public-parser-parser-const-parser-ref>`
[Parser::Parser(const Parser &)](#public-parser-parser-const-parser-ref)
Parser
Parser::Parser(std::string &, int n=1)

Construit un objet Parser avec une chaine specifiee et un nb max de variables a indiquer avec la methode addVar.

References
How to cite in this doc:
:ref:`Parser::Parser(std::string &, int n=1) <public-parser-parser-std-string-ref-int-n-equal-1>`
[Parser::Parser(std::string &, int n=1)](#public-parser-parser-std-string-ref-int-n-equal-1)
parseString
void Parser::parseString()

Construit l’arbre correspondant a la chaine de caracteres. Cet arbre doit etre construit une seule fois et la chaine de caractere est evaluee en parcourant cet arbre par la methode eval() autant de fois qu’on le souhaite.

References
Referenced By
How to cite in this doc:
:ref:`void Parser::parseString() <public-void-parser-parsestring>`
[void Parser::parseString()](#public-void-parser-parsestring)
setImpulsion
void Parser::setImpulsion(double tinit, double periode)

Fixe le temps initial et la periode de la fonction impulsion

References
Referenced By
How to cite in this doc:
:ref:`void Parser::setImpulsion(double tinit, double periode) <public-void-parser-setimpulsion-double-tinit-double-periode>`
[void Parser::setImpulsion(double tinit, double periode)](#public-void-parser-setimpulsion-double-tinit-double-periode)
setNbVar
void Parser::setNbVar(int nvar)

Fixe le nombre max de variables a indiquer avec la methode addVar.

References
Referenced By
How to cite in this doc:
:ref:`void Parser::setNbVar(int nvar) <public-void-parser-setnbvar-int-nvar>`
[void Parser::setNbVar(int nvar)](#public-void-parser-setnbvar-int-nvar)
setString
void Parser::setString(const std::string &s)
References
Referenced By
How to cite in this doc:
:ref:`void Parser::setString(const std::string &s) <public-void-parser-setstring-const-std-string-ref-s>`
[void Parser::setString(const std::string &s)](#public-void-parser-setstring-const-std-string-ref-s)
setVar
void Parser::setVar(const char *sv, double val)

Fixe la valeur de la variable representee par une chaine sv.

References
Referenced By
How to cite in this doc:
:ref:`void Parser::setVar(const char *sv, double val) <public-void-parser-setvar-const-char-ptr-sv-double-val>`
[void Parser::setVar(const char *sv, double val)](#public-void-parser-setvar-const-char-ptr-sv-double-val)
setVar
void Parser::setVar(const std::string &v, double val)

Fixe la valeur de la variable representee par v.

References
Referenced By
How to cite in this doc:
:ref:`void Parser::setVar(const std::string &v, double val) <public-void-parser-setvar-const-std-string-ref-v-double-val>`
[void Parser::setVar(const std::string &v, double val)](#public-void-parser-setvar-const-std-string-ref-v-double-val)
setVar
void Parser::setVar(int i, double val)

Fixe la valeur de la variable de numero specifie. Ce numero correspondt a l’ordre de l’ajout des variables par la methode addVar() .

References
How to cite in this doc:
:ref:`void Parser::setVar(int i, double val) <public-void-parser-setvar-int-i-double-val>`
[void Parser::setVar(int i, double val)](#public-void-parser-setvar-int-i-double-val)
~Parser
Parser::~Parser()
References
How to cite in this doc:
:ref:`Parser::~Parser() <public-parser-dtor-parser>`
[Parser::~Parser()](#public-parser-dtor-parser)
eval
double Parser::eval(const PNodePod &node)
References
How to cite in this doc:
:ref:`double Parser::eval(const PNodePod &node) <protected-double-parser-eval-const-pnodepod-ref-node>`
[double Parser::eval(const PNodePod &node)](#protected-double-parser-eval-const-pnodepod-ref-node)
evalFunc
KOKKOS_INLINE_FUNCTION double Parser::evalFunc(const PNodePod &node, double x)
References
Referenced By
How to cite in this doc:
:ref:`KOKKOS_INLINE_FUNCTION double Parser::evalFunc(const PNodePod &node, double x) <protected-kokkos-inline-function-double-parser-evalfunc-const-pnodepod-ref-node-double-x>`
[KOKKOS_INLINE_FUNCTION double Parser::evalFunc(const PNodePod &node, double x)](#protected-kokkos-inline-function-double-parser-evalfunc-const-pnodepod-ref-node-double-x)
evalOp
KOKKOS_INLINE_FUNCTION double Parser::evalOp(const PNodePod &node, double x, double y)
References
Referenced By
How to cite in this doc:
:ref:`KOKKOS_INLINE_FUNCTION double Parser::evalOp(const PNodePod &node, double x, double y) <protected-kokkos-inline-function-double-parser-evalop-const-pnodepod-ref-node-double-x-double-y>`
[KOKKOS_INLINE_FUNCTION double Parser::evalOp(const PNodePod &node, double x, double y)](#protected-kokkos-inline-function-double-parser-evalop-const-pnodepod-ref-node-double-x-double-y)
parserState0
void Parser::parserState0(StringTokenizer *, pstackPNode *, stackint *)
References
Referenced By
How to cite in this doc:
:ref:`void Parser::parserState0(StringTokenizer *, pstackPNode *, stackint *) <protected-void-parser-parserstate0-stringtokenizer-ptr-pstackpnode-ptr-stackint-ptr>`
[void Parser::parserState0(StringTokenizer *, pstackPNode *, stackint *)](#protected-void-parser-parserstate0-stringtokenizer-ptr-pstackpnode-ptr-stackint-ptr)
parserState1
void Parser::parserState1(StringTokenizer *, pstackPNode *, stackint *)
References
Referenced By
How to cite in this doc:
:ref:`void Parser::parserState1(StringTokenizer *, pstackPNode *, stackint *) <protected-void-parser-parserstate1-stringtokenizer-ptr-pstackpnode-ptr-stackint-ptr>`
[void Parser::parserState1(StringTokenizer *, pstackPNode *, stackint *)](#protected-void-parser-parserstate1-stringtokenizer-ptr-pstackpnode-ptr-stackint-ptr)
parserState2
void Parser::parserState2(StringTokenizer *, pstackPNode *, stackint *)
References
Referenced By
How to cite in this doc:
:ref:`void Parser::parserState2(StringTokenizer *, pstackPNode *, stackint *) <protected-void-parser-parserstate2-stringtokenizer-ptr-pstackpnode-ptr-stackint-ptr>`
[void Parser::parserState2(StringTokenizer *, pstackPNode *, stackint *)](#protected-void-parser-parserstate2-stringtokenizer-ptr-pstackpnode-ptr-stackint-ptr)
searchCst
int Parser::searchCst(const std::string &v)
References
Referenced By
How to cite in this doc:
:ref:`int Parser::searchCst(const std::string &v) <protected-int-parser-searchcst-const-std-string-ref-v>`
[int Parser::searchCst(const std::string &v)](#protected-int-parser-searchcst-const-std-string-ref-v)
searchFunc
int Parser::searchFunc(const std::string &v)
References
Referenced By
How to cite in this doc:
:ref:`int Parser::searchFunc(const std::string &v) <protected-int-parser-searchfunc-const-std-string-ref-v>`
[int Parser::searchFunc(const std::string &v)](#protected-int-parser-searchfunc-const-std-string-ref-v)
searchVar
int Parser::searchVar(const char *)
References
How to cite in this doc:
:ref:`int Parser::searchVar(const char *) <protected-int-parser-searchvar-const-char-ptr>`
[int Parser::searchVar(const char *)](#protected-int-parser-searchvar-const-char-ptr)
searchVar
int Parser::searchVar(const std::string &s)
References
Referenced By
How to cite in this doc:
:ref:`int Parser::searchVar(const std::string &s) <protected-int-parser-searchvar-const-std-string-ref-s>`
[int Parser::searchVar(const std::string &s)](#protected-int-parser-searchvar-const-std-string-ref-s)
test_op_binaire
int Parser::test_op_binaire(int type)
References
Referenced By
How to cite in this doc:
:ref:`int Parser::test_op_binaire(int type) <protected-int-parser-test-op-binaire-int-type>`
[int Parser::test_op_binaire(int type)](#protected-int-parser-test-op-binaire-int-type)
precedence
int Parser::precedence(int)
References
Referenced By
How to cite in this doc:
:ref:`int Parser::precedence(int) <protected-static-int-parser-precedence-int>`
[int Parser::precedence(int)](#protected-static-int-parser-precedence-int)

Attributes Documentation#

c_pi (protected)
Constante Parser::c_pi
impuls_T (protected)
double Parser::impuls_T
impuls_t0 (protected)
double Parser::impuls_t0
impuls_tempo (protected)
double Parser::impuls_tempo
impuls_tn (protected)
double Parser::impuls_tn
ivar (protected)
int Parser::ivar
les_cst (protected)
TRUST_List<Constante> Parser::les_cst
les_var (protected)
ArrOfDouble Parser::les_var
les_var_names (protected)
Noms Parser::les_var_names
map_function_ (protected)
std::map<std::string, int> Parser::map_function_
maxvar (protected)
int Parser::maxvar
PNodes (protected)
std::vector<PNodePod> Parser::PNodes
root (protected)
PNode* Parser::root
state (protected)
int Parser::state
str (protected)
std::string* Parser::str