Files
Upsilon/apps/reader/tex_parser.h
2021-10-22 21:23:35 +02:00

32 lines
618 B
C++

#ifndef __TEX_PARSER_H__
#define __TEX_PARSER_H__
#include <poincare_layouts.h>
#include <poincare/layout_helper.h>
#include <string.h>
using namespace Poincare;
namespace Reader
{
/// @brief Class used in the WordWrapTextView class to parse a Tex expression
class TexParser {
public:
TexParser(const char * text, const char * endOfText);
Layout getLayout();
private:
Layout popBlock();
Layout popText(char stop);
Layout popCommand();
Layout popFracCommand();
const char * m_text;
const char * m_endOfText;
bool m_hasError;
static constexpr char const * k_fracCommand = "frac";
};
}
#endif