1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-11 08:26:02 +00:00
|
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
|
* \file MathParser.h
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
1999-09-27 18:44:28 +00:00
|
|
|
|
*
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
1999-09-27 18:44:28 +00:00
|
|
|
|
*
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
1999-09-27 18:44:28 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
#ifndef MATH_PARSER_H
|
|
|
|
|
#define MATH_PARSER_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
#include <string>
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
|
2001-10-12 12:02:49 +00:00
|
|
|
|
class MathAtom;
|
|
|
|
|
class MathArray;
|
2006-09-16 18:11:38 +00:00
|
|
|
|
class InsetMathGrid;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
class LyXLex;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
|
///
|
2005-01-19 15:03:31 +00:00
|
|
|
|
class latexkeys {
|
|
|
|
|
public:
|
2002-01-08 11:03:34 +00:00
|
|
|
|
/// name of the macro or primitive
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string name;
|
2002-05-30 07:09:54 +00:00
|
|
|
|
/// name of a inset that handles that macro
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string inset;
|
2002-05-30 07:09:54 +00:00
|
|
|
|
/// position of the ting in a font
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string draw;
|
2002-05-30 07:09:54 +00:00
|
|
|
|
/// operator/..., fontname e
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string extra;
|
2002-01-08 11:03:34 +00:00
|
|
|
|
/// how is this called as XML entity?
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string xmlname;
|
2005-06-07 17:21:51 +00:00
|
|
|
|
/// required LaTeXFeatures
|
|
|
|
|
std::string requires;
|
1999-12-13 21:59:26 +00:00
|
|
|
|
};
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
|
|
2002-01-08 11:03:34 +00:00
|
|
|
|
/// check whether this is a well-known (La)TeX macro or primitive
|
2003-10-06 15:43:21 +00:00
|
|
|
|
latexkeys const * in_word_set(std::string const & str);
|
2000-09-14 17:53:12 +00:00
|
|
|
|
|
2002-01-08 11:03:34 +00:00
|
|
|
|
/// parse formula from a string
|
2003-10-06 15:43:21 +00:00
|
|
|
|
bool mathed_parse_normal(MathAtom &, std::string const &);
|
2002-01-08 11:03:34 +00:00
|
|
|
|
/// ... a stream
|
2001-10-12 12:02:49 +00:00
|
|
|
|
bool mathed_parse_normal(MathAtom &, std::istream &);
|
2002-01-08 11:03:34 +00:00
|
|
|
|
/// ... the LyX lexxer
|
2001-10-12 12:02:49 +00:00
|
|
|
|
bool mathed_parse_normal(MathAtom &, LyXLex &);
|
2002-08-14 16:11:55 +00:00
|
|
|
|
/// ... the LyX lexxer
|
2006-09-16 18:11:38 +00:00
|
|
|
|
void mathed_parse_normal(InsetMathGrid &, std::string const &);
|
2001-08-03 09:54:48 +00:00
|
|
|
|
|
2002-01-08 11:03:34 +00:00
|
|
|
|
/// parse a single cell from a string
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void mathed_parse_cell(MathArray & ar, std::string const &);
|
2002-01-08 11:03:34 +00:00
|
|
|
|
/// ... a stream
|
|
|
|
|
void mathed_parse_cell(MathArray & ar, std::istream &);
|
2001-10-18 13:21:21 +00:00
|
|
|
|
|
2004-04-13 06:27:29 +00:00
|
|
|
|
void initParser();
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#endif
|