class to parse a StarMath string More...
Public Member Functions | |
Parser () | |
constructor More... | |
bool | parse (librevenge::RVNGString const &formula, librevenge::RVNGString &res) |
try to parse a StarMath string More... | |
Protected Member Functions | |
bool | convert (librevenge::RVNGString const &starMath, std::vector< LexerData > &lexList) const |
convert a StarMath string in a list of lexer data. More... | |
bool | convertInMML (Node const &node, bool inRow=false) |
try to convert a node in a starMML More... | |
bool | convertPositionOverbraceInMML (Node const &node) |
try to convert a position node in a starMML More... | |
bool | convertPositionUnderbraceInMML (Node const &node) |
try to convert a position node in a starMML More... | |
bool | convertPositionInMML (Node const &node) |
try to convert a position node in a starMML More... | |
void | findAndAddAlignment (Node &node, bool &colFound, bool &rowFound) |
try to add the alignment More... | |
bool | sendMathVariant () |
try to send the font style More... | |
std::shared_ptr< Node > | expr () const |
try to parse an expr: {newline|sequenceExpr}* More... | |
std::shared_ptr< Node > | sequenceExpr (size_t &pos, bool newLineIsBad=false, int stackOrMatrixType=0) const |
try to parse a sequence of expr More... | |
std::shared_ptr< Node > | relationExpr (size_t &pos) const |
try to parse an relation expr: additionExpr{[=,==,...]additionExpr} More... | |
std::shared_ptr< Node > | additionExpr (size_t &pos) const |
try to parse an addition expr: multiplyExpr{[+,-,in,or,...]multiplyExpr} More... | |
std::shared_ptr< Node > | multiplicationExpr (size_t &pos) const |
try to parse an multiplication expr: positionExpr{[*,/,over,...]positionExpr} More... | |
std::shared_ptr< Node > | positionExpr (size_t &pos) const |
try to parse a position expr: functionExpr{[^,_,sub,sup]functionExpr} first child is sub, second child is sup More... | |
std::shared_ptr< Node > | unaryOperatorExpr (size_t &pos, bool inPosition=false) const |
try to parse a unary operator expr: More... | |
std::shared_ptr< Node > | functionExpr (size_t &pos, bool inPosition=false) const |
try to parse a function expr: blockExpr | unaryOpExpr More... | |
std::shared_ptr< Node > | parenthesisExpr (size_t &pos) const |
try to parse a parenthesis expr: More... | |
std::shared_ptr< Node > | rightParenthesisExpr (size_t &pos, std::shared_ptr< Node > term) const |
look for alone right parenthesis More... | |
std::shared_ptr< Node > | leftParenthesisExpr (size_t &pos, std::function< std::shared_ptr< Node >(size_t &)> function) const |
look for alone left parenthesis More... | |
std::shared_ptr< Node > | elementExpr (size_t &pos) const |
try to parse a element expr: More... | |
void | ignoreSpaces (size_t &pos) const |
ignore the following space More... | |
void | ignoreSpaces (size_t &pos, std::string &spaces) const |
ignore the following space More... | |
Static Protected Member Functions | |
static std::string | getEscapedString (std::string const &str) |
html escape a string More... | |
Protected Attributes | |
std::vector< LexerData > | m_dataList |
the star math data More... | |
std::stringstream | m_output |
the output stream More... | |
double | m_fontSize |
the current font size More... | |
bool | m_bold |
a flag to know if we are in bold or not More... | |
bool | m_italic |
a flag to know if we are in italic or not More... | |
std::string | m_fontName |
the font name More... | |
std::set< std::string > | m_colorSet |
the set of potential color More... | |
std::map< std::string, std::string > | m_fontMap |
the font convert map More... | |
std::map< std::string, std::string > | m_greekMap |
the greek convert map More... | |
std::map< std::string, std::string > | m_specialPercentMap |
the special percent convert map More... | |
std::map< std::string, std::string > | m_otherSpecialMap |
the remaining special key word More... | |
std::map< std::string, std::string > | m_parenthesisMap |
the parenthesis left/right map More... | |
std::set< std::string > | m_parenthesisRightSet |
the parenthesis right map More... | |
std::map< std::string, std::string > | m_parenthesisToStringMap |
the parenthesis unicode map More... | |
std::map< std::string, std::string > | m_unaryOperatorMap |
the unary operator More... | |
std::set< std::string > | m_function1Set |
the function which have one argument More... | |
std::set< std::string > | m_function2Set |
the function which have two argument More... | |
std::map< std::string, std::string > | m_integralMap |
the function which have one to three argument (from to optional) More... | |
std::map< std::string, std::string > | m_accent1Map |
the accent which have one argument More... | |
std::set< std::string > | m_accent1Set |
the accent which have one argument More... | |
std::map< std::string, int > | m_positionMap |
position symbol map More... | |
std::map< std::string, std::string > | m_multiplicationMap |
multiplication symbol operator More... | |
std::map< std::string, std::string > | m_multiplicationStringMap |
multiplication symbol string operator More... | |
std::set< std::string > | m_additionSet |
addition symbol operator More... | |
std::map< std::string, std::string > | m_additionStringMap |
addition symbol string operator More... | |
std::map< std::string, std::string > | m_relationMap |
relation symbol operator More... | |
std::map< std::string, std::string > | m_relationStringMap |
relation symbol string operator More... | |
class to parse a StarMath string
|
inline |
constructor
|
protected |
try to parse an addition expr: multiplyExpr{[+,-,in,or,...]multiplyExpr}
Referenced by relationExpr().
|
protected |
convert a StarMath string in a list of lexer data.
try to merge together the number zone, the placeholder <?>, the "XXX" string zone and some double symbols +-, -+, ##, <=, ...
Referenced by parse().
|
protected |
try to convert a node in a starMML
Referenced by convertPositionInMML(), convertPositionOverbraceInMML(), convertPositionUnderbraceInMML(), and parse().
|
protected |
try to convert a position node in a starMML
Referenced by convertPositionUnderbraceInMML().
|
protected |
try to convert a position node in a starMML
Referenced by convertInMML().
|
protected |
try to convert a position node in a starMML
Referenced by convertPositionOverbraceInMML().
|
protected |
try to parse a element expr:
Referenced by parenthesisExpr().
|
protected |
try to parse an expr: {newline|sequenceExpr}*
Referenced by parse().
|
protected |
try to add the alignment
Referenced by convertInMML().
|
protected |
try to parse a function expr: blockExpr | unaryOpExpr
Referenced by unaryOperatorExpr().
|
inlinestaticprotected |
html escape a string
Referenced by convertInMML(), and parse().
|
inlineprotected |
ignore the following space
Referenced by additionExpr(), elementExpr(), expr(), functionExpr(), leftParenthesisExpr(), multiplicationExpr(), parenthesisExpr(), positionExpr(), relationExpr(), rightParenthesisExpr(), sequenceExpr(), and unaryOperatorExpr().
|
inlineprotected |
ignore the following space
|
protected |
look for alone left parenthesis
Referenced by multiplicationExpr(), and parenthesisExpr().
|
protected |
try to parse an multiplication expr: positionExpr{[*,/,over,...]positionExpr}
Referenced by additionExpr().
|
protected |
try to parse a parenthesis expr:
Referenced by functionExpr().
bool STOFFStarMathToMMLConverterInternal::Parser::parse | ( | librevenge::RVNGString const & | formula, |
librevenge::RVNGString & | res | ||
) |
try to parse a StarMath string
Referenced by STOFFStarMathToMMLConverter::convertStarMath().
|
protected |
try to parse a position expr: functionExpr{[^,_,sub,sup]functionExpr} first child is sub, second child is sup
Referenced by multiplicationExpr().
|
protected |
try to parse an relation expr: additionExpr{[=,==,...]additionExpr}
Referenced by functionExpr(), and sequenceExpr().
|
protected |
look for alone right parenthesis
Referenced by multiplicationExpr(), and parenthesisExpr().
|
protected |
try to send the font style
Referenced by convertInMML().
|
protected |
try to parse a sequence of expr
Referenced by expr(), functionExpr(), and parenthesisExpr().
|
protected |
try to parse a unary operator expr:
Referenced by functionExpr(), and positionExpr().
|
protected |
the accent which have one argument
Referenced by convertInMML(), functionExpr(), and Parser().
|
protected |
the accent which have one argument
Referenced by functionExpr(), and Parser().
|
protected |
addition symbol operator
Referenced by additionExpr(), and Parser().
|
protected |
addition symbol string operator
Referenced by additionExpr(), convertInMML(), and Parser().
|
protected |
a flag to know if we are in bold or not
Referenced by convertInMML(), and sendMathVariant().
|
protected |
the set of potential color
Referenced by convertInMML(), and Parser().
|
protected |
the star math data
Referenced by additionExpr(), elementExpr(), expr(), functionExpr(), ignoreSpaces(), leftParenthesisExpr(), multiplicationExpr(), parenthesisExpr(), parse(), positionExpr(), relationExpr(), rightParenthesisExpr(), sequenceExpr(), and unaryOperatorExpr().
|
protected |
the font convert map
Referenced by convertInMML(), and Parser().
|
protected |
the font name
Referenced by convertInMML(), and sendMathVariant().
|
protected |
the current font size
Referenced by convertInMML().
|
protected |
the function which have one argument
Referenced by convertInMML(), functionExpr(), and Parser().
|
protected |
the function which have two argument
Referenced by convertInMML(), functionExpr(), and Parser().
|
protected |
the greek convert map
Referenced by convert(), convertInMML(), elementExpr(), and Parser().
|
protected |
the function which have one to three argument (from to optional)
Referenced by convertInMML(), functionExpr(), and Parser().
|
protected |
a flag to know if we are in italic or not
Referenced by convertInMML(), and sendMathVariant().
|
protected |
multiplication symbol operator
Referenced by convertInMML(), multiplicationExpr(), and Parser().
|
protected |
multiplication symbol string operator
Referenced by convertInMML(), multiplicationExpr(), and Parser().
|
protected |
the remaining special key word
Referenced by convertInMML(), elementExpr(), and Parser().
|
protected |
the output stream
Referenced by convertInMML(), convertPositionInMML(), convertPositionOverbraceInMML(), convertPositionUnderbraceInMML(), findAndAddAlignment(), parse(), and sendMathVariant().
|
protected |
the parenthesis left/right map
Referenced by convert(), leftParenthesisExpr(), parenthesisExpr(), and Parser().
|
protected |
the parenthesis right map
Referenced by convert(), leftParenthesisExpr(), Parser(), and rightParenthesisExpr().
|
protected |
the parenthesis unicode map
Referenced by convertInMML(), and Parser().
|
protected |
position symbol map
Referenced by Parser(), and positionExpr().
|
protected |
relation symbol operator
Referenced by convertInMML(), Parser(), and relationExpr().
|
protected |
relation symbol string operator
Referenced by convertInMML(), Parser(), and relationExpr().
|
protected |
the special percent convert map
Referenced by convert(), convertInMML(), elementExpr(), and Parser().
|
protected |
the unary operator
Referenced by convertInMML(), Parser(), and unaryOperatorExpr().