Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Series
[Algebra]


Namespaces

namespace  vcsn::algebra::krat_exp_lexing
 Misc. declarations used for rational expression lexing.


Compounds

struct  vcsn::algebra::SeriesBase
 Structural element of series K<A*> from a free monoid A* to a semiring K. More...

struct  vcsn::algebra::series_traits
 Meta information about series. More...

class  vcsn::MetaElement< algebra::SeriesBase< Self >, T >
 Services of every serie. More...

class  vcsn::algebra::KRatExpToken
 Schrödinger's token for rational expression lexing. More...

struct  vcsn::algebra::Lexer
 Lexer class for the rational expression parser. More...

struct  vcsn::algebra::Parser
 Parser class used in the parse() function. More...


Functions

template<typename S, typename T> Element< S, T > transpose (const algebra::SeriesBase< S > &s, const T &t)
 returns a fresh serie that is the transposed of the argument.

template<typename S, typename T> bool is_letter_support (const Element< S, T > &s)
 returns true if the support of the serie 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 serie 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. More...


Function Documentation

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 functions parses any numerical rational expression.

The grammar is:

 exp ::= '(' exp ')'
     |   exp '+' exp
     |   exp '.' exp
     |   exp exp
     |   exp '*'
     |   weight ' ' exp
     |   exp ' ' weight
     |   0
     |   1
     |   word
 

Priority for operators is: '*' > ' ' > '.' > '+'.

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@lrde.epita.fr>, Thomas Claveirole <thomas@lrde.epita.fr>


Generated on Wed Jul 2 19:09:10 2003 for Vaucanson by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002