1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/*
|
|
|
|
* File: math_parser.h
|
|
|
|
* Purpose: Declaration of parsing utilities for mathed
|
2002-03-21 17:42:56 +00:00
|
|
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
1999-09-27 18:44:28 +00:00
|
|
|
* Created: January 1996
|
|
|
|
* Description: Parse LaTeX2e math mode code.
|
|
|
|
*
|
|
|
|
* Dependencies: Xlib, XForms
|
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright: 1996, Alejandro Aguilar Sierra
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* Version: 0.8beta.
|
|
|
|
*
|
|
|
|
* You are free to use and modify this code under the terms of
|
|
|
|
* the GNU General Public Licence version 2 or later.
|
|
|
|
*/
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
#ifndef MATH_PARSER_H
|
|
|
|
#define MATH_PARSER_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2000-09-14 17:53:12 +00:00
|
|
|
#include "LString.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-10-12 12:02:49 +00:00
|
|
|
class MathAtom;
|
|
|
|
class MathArray;
|
2002-08-14 16:11:55 +00:00
|
|
|
class MathGridInset;
|
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
|
|
|
///
|
1999-12-13 21:59:26 +00:00
|
|
|
struct latexkeys {
|
2002-01-08 11:03:34 +00:00
|
|
|
/// name of the macro or primitive
|
2001-08-30 22:42:26 +00:00
|
|
|
string name;
|
2002-05-30 07:09:54 +00:00
|
|
|
/// name of a inset that handles that macro
|
|
|
|
string inset;
|
|
|
|
/// position of the ting in a font
|
|
|
|
string draw;
|
|
|
|
/// operator/..., fontname e
|
|
|
|
string extra;
|
2002-01-08 11:03:34 +00:00
|
|
|
/// how is this called as XML entity?
|
2001-11-09 18:55:03 +00:00
|
|
|
string xmlname;
|
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
|
2001-02-16 09:25:43 +00:00
|
|
|
latexkeys const * in_word_set(string const & str);
|
2000-09-14 17:53:12 +00:00
|
|
|
|
2002-01-08 11:03:34 +00:00
|
|
|
/// parse formula from a string
|
2001-10-12 12:02:49 +00:00
|
|
|
bool mathed_parse_normal(MathAtom &, 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
|
|
|
|
void mathed_parse_normal(MathGridInset &, 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
|
|
|
|
void mathed_parse_cell(MathArray & ar, string const &);
|
|
|
|
/// ... a stream
|
|
|
|
void mathed_parse_cell(MathArray & ar, std::istream &);
|
2001-10-18 13:21:21 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
#endif
|