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