Functions |
template<typename S , typename T > |
Element< S, T > | transpose (const algebra::SeriesBase< S > &s, const T &t) |
| returns a fresh series that is the transposed of the argument.
|
template<typename S , typename T > |
bool | is_support_in_alphabet (const Element< S, T > &s) |
| Returns true if the support of the series is only composed of letters.
|
template<typename S1 , typename S2 , typename T1 , typename T2 > |
void | extract_support (Element< S1, T1 > &, Element< S2, T2 > &) |
| Make the first series be the support of the second.
|
template<class S , class T > |
Element< S, T > | hadamard (const Element< S, T > &lhs, const Element< S, T > &rhs) |
| Return the hadamard product of lhs and rhs.
|
template<class S , class T > |
std::pair< bool, std::string > | parse (const std::string &from, Element< S, T > &exp, bool lex_trace=false, bool parse_trace=false) |
| Parse a rational expression.
|
std::pair< bool, std::string > parse |
( |
const std::string & |
from, |
|
|
Element< S, T > & |
exp, |
|
|
bool |
lex_trace = false , |
|
|
bool |
parse_trace = false |
|
) |
| |
Parse a rational expression.
This fonction parses any kind of rational expression using the bison generated parser.
The grammar is :
%start rexp
rexp ::= OPAR exp CPAR
| rexp PLUS rexp
| rexp TIMES rexp
| rexp rexp
| rexp STAR
| WEIGHT rexp
| rexp WEIGHT
| ONE
| ZERO
| WORD
This function returns a pair which first element is a Boolean indicating whether an error occured or not. The second element is an error message when a parse error have been ecountered.
- Parameters:
-
from | The rational expression, as a string. |
exp | The element to store the result in. Be sure its set is correct before calling parse. |
lex_trace | Enable lexer trace (for debuging purposes). |
parse_trace | Enable parser trace (for debuging purposes). |
- Author:
- Yann Régis-Gianas yann@.nosp@m.lrde.nosp@m..epit.nosp@m.a.fr, Thomas Claveirole thoma.nosp@m.s@lr.nosp@m.de.ep.nosp@m.ita..nosp@m.fr Vivien Delmon vivie.nosp@m.n@lr.nosp@m.de.ep.nosp@m.ita..nosp@m.fr
Definition at line 222 of file krat_exp_parser.hxx.