+// -*- C++ -*-
+/**
+ * \file texparser.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
#ifndef PARSER_H
#define PARSER_H
-#include "LString.h"
#include <vector>
+#include <string>
+
enum mode_type {UNDECIDED_MODE, TEXT_MODE, MATH_MODE, MATHTEXT_MODE, TABLE_MODE};
-mode_type asMode(mode_type oldmode, string const & str);
+mode_type asMode(mode_type oldmode, std::string const & str);
// These are TeX's catcodes
///
Token(char c, CatCode cat) : cs_(), char_(c), cat_(cat) {}
///
- Token(string const & cs) : cs_(cs), char_(0), cat_(catIgnore) {}
+ Token(std::string const & cs) : cs_(cs), char_(0), cat_(catIgnore) {}
///
- string const & cs() const { return cs_; }
+ std::string const & cs() const { return cs_; }
///
CatCode cat() const { return cat_; }
///
char character() const { return char_; }
///
- string asString() const;
+ std::string asString() const;
///
- string asInput() const;
+ std::string asInput() const;
private:
///
- string cs_;
+ std::string cs_;
///
char char_;
///
///
Parser(std::istream & is);
///
- Parser(string const & s);
+ Parser(std::string const & s);
///
int lineno() const { return lineno_; }
void dump() const;
///
- string getArg(char left, char right);
+ std::string getArg(char left, char right);
/// getArg('[', ']') including the brackets
- string getOpt();
+ std::string getOpt();
///
char getChar();
///
- void error(string const & msg);
+ void error(std::string const & msg);
///
void tokenize(std::istream & is);
///
///
Token const & get_token();
/// skips spaces if any
- void skipSpaces();
+ void skip_spaces();
///
- void lex(string const & s);
+ void lex(std::string const & s);
///
bool good() const;
///
- string verbatim_item();
+ std::string verbatim_item();
///
- string verbatimOption();
+ std::string verbatimOption();
///
void setCatCode(char c, CatCode cat);
unsigned pos_;
};
+
#endif