diff --git a/src/Buffer.cpp b/src/Buffer.cpp index c9d6818df6..f4a02ca4e5 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -41,7 +41,6 @@ #include "LaTeXFeatures.h" #include "LaTeX.h" #include "Layout.h" -#include "Lexer.h" #include "LyXAction.h" #include "LyX.h" #include "LyXRC.h" @@ -95,6 +94,7 @@ #include "support/filetools.h" #include "support/gettext.h" #include "support/gzstream.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/mutex.h" #include "support/os.h" diff --git a/src/Buffer.h b/src/Buffer.h index ee37098055..d9e7e325d4 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -39,7 +39,6 @@ class FuncRequest; class FuncStatus; class Inset; class InsetLabel; -class Lexer; class Text; class LyXVC; class LaTeXFeatures; @@ -67,6 +66,7 @@ namespace support { class DocFileName; class FileName; class FileNameList; +class Lexer; } // namespace support namespace graphics { @@ -226,7 +226,7 @@ public: //FIXME: The following function should be private //private: /// read the header, returns number of unknown tokens - int readHeader(Lexer & lex); + int readHeader(support::Lexer & lex); double fontScalingFactor() const; /// check for active synctex support: @@ -247,14 +247,14 @@ private: /// Reads a file without header. /// \param par if != 0 insert the file. /// \return \c true if file is not completely read. - bool readDocument(Lexer &); + bool readDocument(support::Lexer &); /// Try to extract the file from a version control container /// before reading if the file cannot be found. /// \sa LyXVC::file_not_found_hook ReadStatus extractFromVC(); /// Reads the first tag of a LyX File and /// returns the file format number. - ReadStatus parseLyXFormat(Lexer & lex, support::FileName const & fn, + ReadStatus parseLyXFormat(support::Lexer & lex, support::FileName const & fn, int & file_format) const; /// Convert the LyX file to the LYX_FORMAT using /// the lyx2lyx script and returns the filename diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 0d1600c5cf..1324aaac9e 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -33,7 +33,6 @@ #include "LaTeXFeatures.h" #include "LaTeXFonts.h" #include "Font.h" -#include "Lexer.h" #include "LyXRC.h" #include "OutputParams.h" #include "Spacing.h" @@ -53,6 +52,7 @@ #include "support/filetools.h" #include "support/gettext.h" #include "support/Length.h" +#include "support/Lexer.h" #include "support/Messages.h" #include "support/mutex.h" #include "support/Package.h" diff --git a/src/BufferParams.h b/src/BufferParams.h index 489e053686..92c1418da1 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -31,7 +31,10 @@ namespace lyx { -namespace support { class FileName; } +namespace support { +class FileName; +class Lexer; +} class Author; class AuthorList; @@ -48,7 +51,6 @@ class LaTeXFeatures; class LayoutFile; class LayoutFileIndex; class Length; -class Lexer; class OutputParams; class otexstream; class PDFOptions; @@ -79,7 +81,7 @@ public: docstring B_(std::string const & l10n) const; /// read a header token, if unrecognised, return it or an unknown class name - std::string readToken(Lexer & lex, + std::string readToken(support::Lexer & lex, std::string const & token, ///< token to read. support::FileName const & filename); @@ -629,25 +631,25 @@ public: private: /// - void readPreamble(Lexer &); + void readPreamble(support::Lexer &); /// - void readDocumentMetadata(Lexer &); + void readDocumentMetadata(support::Lexer &); /// - void readLocalLayout(Lexer &, bool); + void readLocalLayout(support::Lexer &, bool); /// - void readLanguage(Lexer &); + void readLanguage(support::Lexer &); /// - void readGraphicsDriver(Lexer &); + void readGraphicsDriver(support::Lexer &); /// - void readBullets(Lexer &); + void readBullets(support::Lexer &); /// - void readBulletsLaTeX(Lexer &); + void readBulletsLaTeX(support::Lexer &); /// - void readModules(Lexer &); + void readModules(support::Lexer &); /// - void readRemovedModules(Lexer &); + void readRemovedModules(support::Lexer &); /// - void readIncludeonly(Lexer &); + void readIncludeonly(support::Lexer &); /// A cache for the default flavors typedef std::map DefaultFlavorCache; /// diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 006211c15a..292b0f6a01 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -31,7 +31,6 @@ #include "Intl.h" #include "Language.h" #include "LayoutFile.h" -#include "Lexer.h" #include "LyX.h" #include "LyXAction.h" #include "lyxfind.h" @@ -75,6 +74,7 @@ #include "support/gettext.h" #include "support/lassert.h" #include "support/Length.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/lyxlib.h" #include "support/types.h" diff --git a/src/CiteEnginesList.cpp b/src/CiteEnginesList.cpp index 6a1cef1a11..b12fa75edf 100644 --- a/src/CiteEnginesList.cpp +++ b/src/CiteEnginesList.cpp @@ -15,12 +15,12 @@ #include "CiteEnginesList.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "support/debug.h" #include "support/FileName.h" #include "support/gettext.h" #include "support/filetools.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Translator.h" diff --git a/src/CmdDef.cpp b/src/CmdDef.cpp index 08cd7dd6a9..d813eba8e0 100644 --- a/src/CmdDef.cpp +++ b/src/CmdDef.cpp @@ -14,11 +14,11 @@ #include "FuncRequest.h" #include "LyXAction.h" -#include "Lexer.h" #include "support/debug.h" #include "support/FileName.h" #include "support/filetools.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/ConverterCache.cpp b/src/ConverterCache.cpp index 0f4d03efb9..86c5764801 100644 --- a/src/ConverterCache.cpp +++ b/src/ConverterCache.cpp @@ -15,13 +15,13 @@ #include "ConverterCache.h" #include "Format.h" -#include "Lexer.h" #include "LyXRC.h" #include "Mover.h" #include "support/convert.h" #include "support/debug.h" #include "support/filetools.h" +#include "support/Lexer.h" #include "support/lyxtime.h" #include "support/Package.h" diff --git a/src/Counters.cpp b/src/Counters.cpp index 114b18020b..703125f537 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -15,7 +15,6 @@ #include "Counters.h" #include "Layout.h" -#include "Lexer.h" #include "support/convert.h" #include "support/counter_reps.h" @@ -23,6 +22,7 @@ #include "support/docstring.h" #include "support/gettext.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/Counters.h b/src/Counters.h index 5be4aca197..67a790fc0c 100644 --- a/src/Counters.h +++ b/src/Counters.h @@ -26,7 +26,8 @@ namespace lyx { class Layout; -class Lexer; + +namespace support { class Lexer; } /// This represents a single counter. class Counter { @@ -38,7 +39,7 @@ public: docstring const & lsa, docstring const & prettyformat, docstring const & guiname); /// \return true on success - bool read(Lexer & lex); + bool read(support::Lexer & lex); /// void set(int v); /// @@ -142,7 +143,7 @@ public: /// \param makeNew whether to make a new counter if one /// doesn't already exist /// \return true on success - bool read(Lexer & lex, docstring const & name, bool makenew); + bool read(support::Lexer & lex, docstring const & name, bool makenew); /// void set(docstring const & ctr, int val); /// diff --git a/src/Encoding.cpp b/src/Encoding.cpp index dab24b72dd..2dd3c9de8f 100644 --- a/src/Encoding.cpp +++ b/src/Encoding.cpp @@ -14,11 +14,10 @@ #include "Encoding.h" -#include "Lexer.h" - #include "support/debug.h" #include "support/docstring.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/mutex.h" #include "support/textutils.h" diff --git a/src/Font.cpp b/src/Font.cpp index 7e0798d8ac..a4ae35727f 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -21,7 +21,6 @@ #include "Encoding.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "LyXRC.h" #include "output_latex.h" #include "OutputParams.h" @@ -31,6 +30,7 @@ #include "support/convert.h" #include "support/debug.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/FontInfo.cpp b/src/FontInfo.cpp index 9f21bcc3d3..b6f45f88b5 100644 --- a/src/FontInfo.cpp +++ b/src/FontInfo.cpp @@ -17,13 +17,13 @@ #include "FontInfo.h" #include "ColorSet.h" -#include "Lexer.h" #include "LyXRC.h" #include "support/convert.h" #include "support/debug.h" #include "support/docstring.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/FontInfo.h b/src/FontInfo.h index 3feefca662..bd0f125a7a 100644 --- a/src/FontInfo.h +++ b/src/FontInfo.h @@ -25,7 +25,7 @@ namespace lyx { -class Lexer; +namespace support { class Lexer; } /// class FontInfo @@ -257,7 +257,7 @@ void setLyXColor(std::string const &, FontInfo &); FontState setLyXMisc(std::string const &); /// Read a font specification from Lexer. Used for layout files. -FontInfo lyxRead(Lexer &, FontInfo const & fi = sane_font); +FontInfo lyxRead(support::Lexer &, FontInfo const & fi = sane_font); /// Write a font specification. Used for layout files. void lyxWrite(std::ostream &, FontInfo const &, std::string const &, int); diff --git a/src/KeyMap.cpp b/src/KeyMap.cpp index c34fe7eefb..8552d7cd44 100644 --- a/src/KeyMap.cpp +++ b/src/KeyMap.cpp @@ -17,13 +17,13 @@ #include "KeySequence.h" #include "LyXAction.h" -#include "Lexer.h" #include "support/debug.h" #include "support/docstream.h" #include "support/FileName.h" #include "support/filetools.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/TempFile.h" diff --git a/src/LaTeXFonts.cpp b/src/LaTeXFonts.cpp index c9d030e8c3..655d4f17e1 100644 --- a/src/LaTeXFonts.cpp +++ b/src/LaTeXFonts.cpp @@ -13,7 +13,6 @@ #include "LaTeXFonts.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "frontends/alert.h" @@ -23,6 +22,7 @@ #include "support/FileName.h" #include "support/filetools.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" diff --git a/src/LaTeXFonts.h b/src/LaTeXFonts.h index 8aae4ae31c..ce59b01d74 100644 --- a/src/LaTeXFonts.h +++ b/src/LaTeXFonts.h @@ -20,7 +20,7 @@ namespace lyx { -class Lexer; +namespace support { class Lexer; } /// LaTeX Font definition class LaTeXFont { @@ -96,9 +96,9 @@ public: /// Return the actually used package docstring const getUsedPackage(bool ot1, bool complete, bool nomath) const; /// - bool read(Lexer & lex); + bool read(support::Lexer & lex); /// - bool readFont(Lexer & lex); + bool readFont(support::Lexer & lex); private: /// Return the preferred available package std::string const getAvailablePackage(bool dryrun) const; diff --git a/src/LaTeXPackages.cpp b/src/LaTeXPackages.cpp index 0f4129eabe..9e0ffe5024 100644 --- a/src/LaTeXPackages.cpp +++ b/src/LaTeXPackages.cpp @@ -16,13 +16,12 @@ #include "LaTeXPackages.h" -#include "Lexer.h" - #include "support/convert.h" #include "support/debug.h" #include "support/FileName.h" #include "support/filetools.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Package.h" diff --git a/src/Language.cpp b/src/Language.cpp index 884d1a039b..60b897c134 100644 --- a/src/Language.cpp +++ b/src/Language.cpp @@ -18,7 +18,6 @@ #include "BufferParams.h" #include "Encoding.h" #include "LaTeXFonts.h" -#include "Lexer.h" #include "LyXRC.h" #include "support/debug.h" @@ -26,6 +25,7 @@ #include "support/FileName.h" #include "support/filetools.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/qstring_helpers.h" #include "support/Messages.h" diff --git a/src/Language.h b/src/Language.h index ad8badffbc..d8ef03a125 100644 --- a/src/Language.h +++ b/src/Language.h @@ -25,11 +25,13 @@ namespace lyx { -namespace support { class FileName; } +namespace support { +class FileName; +class Lexer; +} class BufferParams; class Encoding; -class Lexer; /// class Language { @@ -99,9 +101,9 @@ public: /// This language corresponds to a translation of the GUI bool hasGuiSupport() const { return has_gui_support_; } /// - bool read(Lexer & lex); + bool read(support::Lexer & lex); /// - bool readLanguage(Lexer & lex); + bool readLanguage(support::Lexer & lex); /// typedef std::map TranslationMap; /// diff --git a/src/Layout.cpp b/src/Layout.cpp index 8e54891fb9..50a4d05ac6 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -13,13 +13,13 @@ #include #include "Layout.h" -#include "Lexer.h" #include "output_xhtml.h" #include "TextClass.h" #include "support/debug.h" #include "support/docstream.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/textutils.h" diff --git a/src/Layout.h b/src/Layout.h index 6581155007..0c0b4ae0ef 100644 --- a/src/Layout.h +++ b/src/Layout.h @@ -26,7 +26,8 @@ namespace lyx { -class Lexer; +namespace support { class Lexer; } + class TextClass; /* Fixed labels are printed flushright, manual labels flushleft. @@ -58,23 +59,23 @@ public: void setUnknown(bool unknown) { unknown_ = unknown; } /// Reads a layout definition from file /// \return true on success. - bool read(Lexer &, TextClass const &, bool validating = false); + bool read(support::Lexer &, TextClass const &, bool validating = false); /// - void readAlign(Lexer &); + void readAlign(support::Lexer &); /// - void readAlignPossible(Lexer &); + void readAlignPossible(support::Lexer &); /// - void readLabelType(Lexer &); + void readLabelType(support::Lexer &); /// - void readEndLabelType(Lexer &); + void readEndLabelType(support::Lexer &); /// - void readMargin(Lexer &); + void readMargin(support::Lexer &); /// - void readLatexType(Lexer &); + void readLatexType(support::Lexer &); /// - void readSpacing(Lexer &); + void readSpacing(support::Lexer &); /// - void readArgument(Lexer &, bool); + void readArgument(support::Lexer &, bool); /// Write a layout definition in utf8 encoding void write(std::ostream &) const; /// @@ -439,7 +440,7 @@ public: private: /// Reads a layout definition from file /// \return true on success. - bool readIgnoreForcelocal(Lexer &, TextClass const &, bool validating); + bool readIgnoreForcelocal(support::Lexer &, TextClass const &, bool validating); /// generates the default CSS for this layout void makeDefaultCSS() const; /// diff --git a/src/LayoutFile.cpp b/src/LayoutFile.cpp index 7944ad73a2..3ed3676129 100644 --- a/src/LayoutFile.cpp +++ b/src/LayoutFile.cpp @@ -12,13 +12,13 @@ #include #include "LayoutFile.h" -#include "Lexer.h" #include "TextClass.h" #include "support/debug.h" #include "support/FileName.h" #include "support/filetools.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/TempFile.h" #include diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index 73aec189f3..9c8decab43 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -25,7 +25,6 @@ #include "Format.h" #include "FuncCode.h" #include "FuncRequest.h" -#include "Lexer.h" #include "LyX.h" #include "Mover.h" #include "SpellChecker.h" @@ -36,6 +35,7 @@ #include "support/environment.h" #include "support/FileName.h" #include "support/filetools.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/os.h" #include "support/Package.h" diff --git a/src/LyXRC.h b/src/LyXRC.h index 039cf5658c..c437021c06 100644 --- a/src/LyXRC.h +++ b/src/LyXRC.h @@ -31,9 +31,10 @@ namespace lyx { -namespace support { class FileName; } - +namespace support { +class FileName; class Lexer; +} /// This contains the runtime configuration of LyX class LyXRC @@ -212,7 +213,7 @@ private: FormatMismatch }; /// - ReturnValues read(Lexer &, bool check_format); + ReturnValues read(support::Lexer &, bool check_format); public: /// typedef std::set CommandSet; diff --git a/src/Makefile.am b/src/Makefile.am index 86a90bb2bb..47a8e1ead5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -147,7 +147,6 @@ SOURCEFILESCORE = \ LaTeXPackages.cpp \ LayoutFile.cpp \ LayoutModuleList.cpp \ - Lexer.cpp \ LyX.cpp \ LyXAction.cpp \ lyxfind.cpp \ @@ -247,7 +246,6 @@ HEADERFILESCORE = \ LayoutEnums.h \ LayoutFile.h \ LayoutModuleList.h \ - Lexer.h \ LyXAction.h \ lyxfind.h \ LyX.h \ diff --git a/src/ModuleList.cpp b/src/ModuleList.cpp index d8fd34cc72..83f5a75940 100644 --- a/src/ModuleList.cpp +++ b/src/ModuleList.cpp @@ -14,12 +14,12 @@ #include "ModuleList.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "support/debug.h" #include "support/FileName.h" #include "support/gettext.h" #include "support/filetools.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/PDFOptions.cpp b/src/PDFOptions.cpp index dc638f544d..c3d057eba8 100644 --- a/src/PDFOptions.cpp +++ b/src/PDFOptions.cpp @@ -15,7 +15,6 @@ #include "Encoding.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "OutputParams.h" #include "texstream.h" @@ -23,6 +22,7 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/docstring.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/PDFOptions.h b/src/PDFOptions.h index 4ab0d9e3ad..e013566c14 100644 --- a/src/PDFOptions.h +++ b/src/PDFOptions.h @@ -16,10 +16,11 @@ namespace lyx { -class Lexer; class OutputParams; class otexstream; +namespace support { class Lexer; } + // FIXME UNICODE // Write functions need to use odostream instead of ostream before // we can use docstring instead of string. @@ -37,7 +38,7 @@ public: void writeLaTeX(OutputParams &, otexstream &, bool hyperref_already_provided) const; /// read tokens from lyx header - std::string readToken(Lexer &lex, std::string const & token); + std::string readToken(support::Lexer &lex, std::string const & token); /// set implicit settings for hyperref void clear(); diff --git a/src/ParagraphParameters.cpp b/src/ParagraphParameters.cpp index 72b2286b12..32dc44900b 100644 --- a/src/ParagraphParameters.cpp +++ b/src/ParagraphParameters.cpp @@ -17,11 +17,11 @@ #include "ParagraphParameters.h" #include "Layout.h" -#include "Lexer.h" #include "Paragraph.h" #include "support/debug.h" #include "support/docstring.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/ParagraphParameters.h b/src/ParagraphParameters.h index 07601e9e33..6f5b4f1b3f 100644 --- a/src/ParagraphParameters.h +++ b/src/ParagraphParameters.h @@ -25,9 +25,10 @@ namespace lyx { class Layout; -class Lexer; class Paragraph; +namespace support { class Lexer; } + /// class ParagraphParameters { @@ -79,7 +80,7 @@ public: void read (std::string const & str, bool merge = true); /// read the parameters from a lex - void read(Lexer & lex, bool merge = true); + void read(support::Lexer & lex, bool merge = true); /// void apply(ParagraphParameters const & params, Layout const & layout); diff --git a/src/Text.cpp b/src/Text.cpp index 1f9696de0d..55e150d6ac 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -45,7 +45,6 @@ #include "Intl.h" #include "Language.h" #include "Layout.h" -#include "Lexer.h" #include "LyX.h" #include "LyXAction.h" #include "lyxfind.h" @@ -95,6 +94,7 @@ #include "support/filetools.h" #include "support/gettext.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/limited_stack.h" #include "support/lstrings.h" #include "support/lyxtime.h" diff --git a/src/Text.h b/src/Text.h index 8dc066a161..9ef9c96260 100644 --- a/src/Text.h +++ b/src/Text.h @@ -33,10 +33,11 @@ class FuncRequest; class FuncStatus; class Inset; class InsetText; -class Lexer; class Paragraph; class ParagraphParameters; +namespace support { class Lexer; } + /// This class encapsulates the main text data and operations in LyX. /// This is more or less the private implementation of InsetText. class Text { @@ -299,7 +300,7 @@ public: void write(std::ostream & os) const; /// returns true if \end_document has not been read /// insetPtr is the containing Inset - bool read(Lexer & lex, ErrorList & errorList, + bool read(support::Lexer & lex, ErrorList & errorList, InsetText * insetPtr); /// delete double spaces, leading spaces, and empty paragraphs around old cursor. @@ -381,10 +382,10 @@ private: void pasteString(Cursor & cur, docstring const & str, bool asParagraphs); /// - void readParToken(Paragraph & par, Lexer & lex, std::string const & token, + void readParToken(Paragraph & par, support::Lexer & lex, std::string const & token, Font & font, Change & change, ErrorList & errorList); /// - void readParagraph(Paragraph & par, Lexer & lex, ErrorList & errorList); + void readParagraph(Paragraph & par, support::Lexer & lex, ErrorList & errorList); /// Set Label Width string to all paragraphs of the same layout /// and depth in a sequence. void setLabelWidthStringToSequence(Cursor const & cur, docstring const & s); diff --git a/src/TextClass.cpp b/src/TextClass.cpp index f6ec875167..339d8c90cf 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -22,7 +22,6 @@ #include "FloatList.h" #include "Layout.h" #include "LayoutFile.h" -#include "Lexer.h" #include "ModuleList.h" #include "frontends/alert.h" @@ -32,6 +31,7 @@ #include "support/FileName.h" #include "support/filetools.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/os.h" #include "support/TempFile.h" diff --git a/src/TextClass.h b/src/TextClass.h index a4c758f339..2f42133491 100644 --- a/src/TextClass.h +++ b/src/TextClass.h @@ -35,12 +35,14 @@ namespace lyx { -namespace support { class FileName; } +namespace support { +class FileName; +class Lexer; +} class FloatList; class Layout; class LayoutFile; -class Lexer; /// Based upon ideas in boost::noncopyable, inheriting from this /// class effectively makes the copy constructor protected but the @@ -167,7 +169,7 @@ public: /// ReturnValues read(std::string const & str, ReadType rt = MODULE); /// - ReturnValues read(Lexer & lex, ReadType rt = BASECLASS); + ReturnValues read(support::Lexer & lex, ReadType rt = BASECLASS); /// validates the layout information passed in str static ReturnValues validate(std::string const & str); /// \return the conversion of \param str to the latest layout format @@ -387,29 +389,29 @@ private: /// Reads the layout file without running layout2layout. ReturnValues readWithoutConv(support::FileName const & filename, ReadType rt); /// \return true for success. - bool readStyle(Lexer &, Layout &, ReadType) const; + bool readStyle(support::Lexer &, Layout &, ReadType) const; /// - void readOutputType(Lexer &); + void readOutputType(support::Lexer &); /// - void readTitleType(Lexer &); + void readTitleType(support::Lexer &); /// - void readMaxCounter(Lexer &); + void readMaxCounter(support::Lexer &); /// - void readClassOptions(Lexer &); + void readClassOptions(support::Lexer &); /// - void readCharStyle(Lexer &, std::string const &); + void readCharStyle(support::Lexer &, std::string const &); /// - bool readFloat(Lexer &); + bool readFloat(support::Lexer &); /// std::vector const & getCiteStyles(CiteEngineType const &) const; /// - bool readCiteEngine(Lexer &, ReadType, bool const add = false); + bool readCiteEngine(support::Lexer &, ReadType, bool const add = false); /// - int readCiteEngineType(Lexer &) const; + int readCiteEngineType(support::Lexer &) const; /// - bool readCiteFormat(Lexer &, ReadType); + bool readCiteFormat(support::Lexer &, ReadType); /// - bool readOutlinerName(Lexer &); + bool readOutlinerName(support::Lexer &); }; diff --git a/src/Trans.cpp b/src/Trans.cpp index 5a03665684..28a05f05f9 100644 --- a/src/Trans.cpp +++ b/src/Trans.cpp @@ -13,13 +13,13 @@ #include "Trans.h" -#include "Lexer.h" #include "Text.h" #include "support/debug.h" #include "support/docstream.h" #include "support/FileName.h" #include "support/filetools.h" +#include "support/Lexer.h" #include "support/lstrings.h" using namespace std; diff --git a/src/Trans.h b/src/Trans.h index c200bb9544..61a57b8e1e 100644 --- a/src/Trans.h +++ b/src/Trans.h @@ -26,9 +26,10 @@ namespace lyx { class Cursor; class Text; -class Lexer; class TransManager; +namespace support { class Lexer; } + /// enum tex_accent { /// @@ -149,7 +150,7 @@ private: /// void freeKeymap(); /// - int load(Lexer &); + int load(support::Lexer &); /// docstring const & match(char_type c); /// diff --git a/src/factory.cpp b/src/factory.cpp index a465a55e86..0bea07b813 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -13,7 +13,6 @@ #include "factory.h" #include "FuncRequest.h" -#include "Lexer.h" #include "LyX.h" #include "insets/InsetBibitem.h" @@ -65,6 +64,7 @@ #include "support/debug.h" #include "support/ExceptionMessage.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/unique_ptr.h" diff --git a/src/factory.h b/src/factory.h index ae2265e674..4ee9fb60f0 100644 --- a/src/factory.h +++ b/src/factory.h @@ -17,14 +17,14 @@ namespace lyx { class Buffer; class FuncRequest; class Inset; -class Lexer; +namespace support { class Lexer; } /// creates inset according to 'cmd' Inset * createInset(Buffer * buf, FuncRequest const & cmd); /// read inset from a file -Inset * readInset(Lexer & lex, Buffer * buf); +Inset * readInset(support::Lexer & lex, Buffer * buf); } // namespace lyx diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp index a70ed358c5..516c970e71 100644 --- a/src/frontends/qt/GuiApplication.cpp +++ b/src/frontends/qt/GuiApplication.cpp @@ -46,7 +46,6 @@ #include "KeyMap.h" #include "Language.h" #include "LaTeXPackages.h" -#include "Lexer.h" #include "LyX.h" #include "LyXAction.h" #include "LyXRC.h" @@ -69,6 +68,7 @@ #include "support/ForkedCalls.h" #include "support/gettext.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/lyxalgo.h" // sorted #include "support/mute_warning.h" diff --git a/src/frontends/qt/GuiLog.cpp b/src/frontends/qt/GuiLog.cpp index 9ad1673de3..273dc25c95 100644 --- a/src/frontends/qt/GuiLog.cpp +++ b/src/frontends/qt/GuiLog.cpp @@ -16,12 +16,12 @@ #include "GuiApplication.h" #include "qt_helpers.h" -#include "Lexer.h" #include "frontends/Clipboard.h" #include "support/docstring.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/frontends/qt/GuiParagraph.cpp b/src/frontends/qt/GuiParagraph.cpp index b3c7349d20..d2fbd484f5 100644 --- a/src/frontends/qt/GuiParagraph.cpp +++ b/src/frontends/qt/GuiParagraph.cpp @@ -24,13 +24,12 @@ #include "FuncRequest.h" #include "GuiView.h" #include "Layout.h" -#include "Lexer.h" #include "Paragraph.h" #include "ParagraphParameters.h" #include "Spacing.h" #include "support/debug.h" -#include "support/gettext.h" +#include "support/Lexer.h" #include #include diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index c44fbb3ed1..94a0a84be2 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -34,7 +34,6 @@ #include "TocModel.h" #include "qt_helpers.h" -#include "support/filetools.h" #include "frontends/alert.h" #include "frontends/KeySymbol.h" @@ -56,7 +55,6 @@ #include "KeySymbol.h" #include "Language.h" #include "LayoutFile.h" -#include "Lexer.h" #include "LyXAction.h" #include "LyX.h" #include "LyXRC.h" @@ -75,9 +73,11 @@ #include "support/debug.h" #include "support/ExceptionMessage.h" #include "support/FileName.h" -#include "support/gettext.h" +#include "support/filetools.h" #include "support/ForkedCalls.h" +#include "support/gettext.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/os.h" #include "support/Package.h" diff --git a/src/frontends/qt/Menus.cpp b/src/frontends/qt/Menus.cpp index 193e2478fa..a191073935 100644 --- a/src/frontends/qt/Menus.cpp +++ b/src/frontends/qt/Menus.cpp @@ -42,7 +42,6 @@ #include "KeyMap.h" #include "Language.h" #include "Layout.h" -#include "Lexer.h" #include "LyXAction.h" #include "LyX.h" #include "LyXRC.h" @@ -64,12 +63,13 @@ #include "insets/InsetInfo.h" #include "insets/InsetQuotes.h" -#include "support/lassert.h" #include "support/convert.h" #include "support/debug.h" #include "support/docstring_list.h" #include "support/filetools.h" #include "support/gettext.h" +#include "support/lassert.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/frontends/qt/Menus.h b/src/frontends/qt/Menus.h index 8166b45178..56875fb5cb 100644 --- a/src/frontends/qt/Menus.h +++ b/src/frontends/qt/Menus.h @@ -22,9 +22,10 @@ namespace lyx { class BufferView; class docstring_list; -class Lexer; class FuncRequest; +namespace support { class Lexer; } + namespace frontend { class GuiView; @@ -79,7 +80,7 @@ public: Menu * menu(QString const & name, GuiView & view, bool keyboard = false); /// - void read(Lexer &); + void read(support::Lexer &); /// void updateMenu(Menu * qmenu); diff --git a/src/frontends/qt/Toolbars.cpp b/src/frontends/qt/Toolbars.cpp index cf184ae9e2..a22c5aa589 100644 --- a/src/frontends/qt/Toolbars.cpp +++ b/src/frontends/qt/Toolbars.cpp @@ -15,12 +15,12 @@ #include "Converter.h" #include "Format.h" #include "FuncRequest.h" -#include "Lexer.h" #include "LyXAction.h" #include "qt_helpers.h" #include "support/debug.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/frontends/qt/Toolbars.h b/src/frontends/qt/Toolbars.h index be621c9db8..e6989b183d 100644 --- a/src/frontends/qt/Toolbars.h +++ b/src/frontends/qt/Toolbars.h @@ -23,7 +23,8 @@ namespace lyx { class FuncRequest; -class Lexer; + +namespace support { class Lexer; } namespace frontend { @@ -92,7 +93,7 @@ public: Items items; /// read a toolbar from the file - ToolbarInfo & read(Lexer &); + ToolbarInfo & read(support::Lexer &); private: /// add toolbar item @@ -140,10 +141,10 @@ public: Infos::iterator end() { return toolbar_info_.end(); } /// read toolbars from the file - void readToolbars(Lexer &); + void readToolbars(support::Lexer &); /// read ui toolbar settings - void readToolbarSettings(Lexer &); + void readToolbarSettings(support::Lexer &); /// ToolbarInfo const * info(std::string const & name) const; diff --git a/src/insets/ExternalTemplate.cpp b/src/insets/ExternalTemplate.cpp index e7eca8b274..67ea027ccb 100644 --- a/src/insets/ExternalTemplate.cpp +++ b/src/insets/ExternalTemplate.cpp @@ -13,10 +13,10 @@ #include "ExternalTemplate.h" -#include "Lexer.h" #include "support/debug.h" #include "support/filetools.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Package.h" #include "support/PathChanger.h" diff --git a/src/insets/ExternalTemplate.h b/src/insets/ExternalTemplate.h index e5b6755059..889dd563ce 100644 --- a/src/insets/ExternalTemplate.h +++ b/src/insets/ExternalTemplate.h @@ -19,9 +19,10 @@ namespace lyx { -namespace support { class FileName; } - +namespace support { +class FileName; class Lexer; +} enum PreviewMode { PREVIEW_OFF = 0, @@ -36,7 +37,7 @@ public: /// We have to have default commands for safety reasons! Template(); /// - void readTemplate(Lexer &); + void readTemplate(support::Lexer &); /// void dumpFormats(std::ostream &) const; @@ -72,7 +73,7 @@ public: public: Format(); /// - void readFormat(Lexer &); + void readFormat(support::Lexer &); /// The text that should be inserted into the exported file std::string product; diff --git a/src/insets/Inset.h b/src/insets/Inset.h index 2fa3e26234..04eb42ce73 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -56,7 +56,6 @@ class InsetTabular; class InsetText; class Language; class LaTeXFeatures; -class Lexer; class MathAtom; class MetricsInfo; class PainterInfo; @@ -68,7 +67,10 @@ class otexstream; namespace graphics { class PreviewLoader; } -namespace support {class FileNameList; } +namespace support { +class FileNameList; +class Lexer; +} /// returns the InsetCode corresponding to the \c name. /// Eg, insetCode("branch") == BRANCH_CODE @@ -501,7 +503,7 @@ public: /// write inset in .lyx format virtual void write(std::ostream &) const {} /// read inset in .lyx format - virtual void read(Lexer &) {} + virtual void read(support::Lexer &) {} /** Export the inset to LaTeX. * Don't use a temporary stringstream if the final output is * supposed to go to a file. diff --git a/src/insets/InsetArgument.cpp b/src/insets/InsetArgument.cpp index 89ed730b83..c4708c8d42 100644 --- a/src/insets/InsetArgument.cpp +++ b/src/insets/InsetArgument.cpp @@ -22,7 +22,6 @@ #include "InsetList.h" #include "Language.h" #include "Layout.h" -#include "Lexer.h" #include "ParIterator.h" #include "TexRow.h" #include "texstream.h" @@ -33,12 +32,14 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" using namespace std; namespace lyx { +using support::Lexer; InsetArgument::InsetArgument(Buffer * buf, string const & name) : InsetCollapsible(buf), name_(name), labelstring_(docstring()), diff --git a/src/insets/InsetArgument.h b/src/insets/InsetArgument.h index 34f4309cb0..a3dd7d05bf 100644 --- a/src/insets/InsetArgument.h +++ b/src/insets/InsetArgument.h @@ -68,7 +68,7 @@ public: /// void write(std::ostream & os) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// bool neverIndent() const override { return true; } /// diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp index 6336da32d4..343770e14d 100644 --- a/src/insets/InsetBibitem.cpp +++ b/src/insets/InsetBibitem.cpp @@ -26,7 +26,6 @@ #include "InsetIterator.h" #include "InsetList.h" #include "Language.h" -#include "Lexer.h" #include "output_xhtml.h" #include "Paragraph.h" #include "ParagraphList.h" @@ -40,6 +39,7 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/mutex.h" diff --git a/src/insets/InsetBibitem.h b/src/insets/InsetBibitem.h index 2a210e8c90..b9ce1aef81 100644 --- a/src/insets/InsetBibitem.h +++ b/src/insets/InsetBibitem.h @@ -51,7 +51,7 @@ public: /// bool isLabeled() const override { return true; } /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// int plaintext(odocstringstream &, OutputParams const &, size_t max_length = INT_MAX) const override; diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index edfa6a569c..972ca20572 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -24,7 +24,6 @@ #include "FuncStatus.h" #include "FuncRequest.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "output_docbook.h" #include "output_xhtml.h" @@ -36,6 +35,7 @@ #include "support/docstream.h" #include "support/FileName.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Translator.h" diff --git a/src/insets/InsetBox.h b/src/insets/InsetBox.h index f4a743667b..a5b71e5cda 100644 --- a/src/insets/InsetBox.h +++ b/src/insets/InsetBox.h @@ -29,7 +29,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// std::string type; @@ -108,7 +108,7 @@ public: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void metrics(MetricsInfo &, Dimension &) const override; /// diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 229e1bc37e..a86b934826 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -23,7 +23,6 @@ #include "FuncStatus.h" #include "Inset.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "LyX.h" #include "output_docbook.h" #include "output_xhtml.h" @@ -33,6 +32,7 @@ #include "support/convert.h" #include "support/debug.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "frontends/alert.h" @@ -45,6 +45,8 @@ using namespace std; namespace lyx { +using support::Lexer; + InsetBranch::InsetBranch(Buffer * buf, InsetBranchParams const & params) : InsetCollapsible(buf, InsetText::DefaultLayout), params_(params) {} diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h index 5098e70afb..58154701e3 100644 --- a/src/insets/InsetBranch.h +++ b/src/insets/InsetBranch.h @@ -26,7 +26,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// docstring branch; /// @@ -65,7 +65,7 @@ private: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// docstring const buttonLabel(BufferView const &) const override; /// diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp index 519033e24a..d6c0461543 100644 --- a/src/insets/InsetCollapsible.cpp +++ b/src/insets/InsetCollapsible.cpp @@ -24,7 +24,6 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "InsetLayout.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "TextClass.h" #include "TocBackend.h" @@ -37,6 +36,7 @@ #include "support/FileName.h" #include "support/gettext.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Changer.h" #include "support/TempFile.h" @@ -46,6 +46,8 @@ using namespace std; namespace lyx { +using support::Lexer; + InsetCollapsible::InsetCollapsible(Buffer * buf, InsetText::UsePlain ltype) : InsetText(buf, ltype), status_(Open) { diff --git a/src/insets/InsetCollapsible.h b/src/insets/InsetCollapsible.h index 0f2711afba..22f846b89a 100644 --- a/src/insets/InsetCollapsible.h +++ b/src/insets/InsetCollapsible.h @@ -53,7 +53,7 @@ public: /// docstring layoutName() const override { return from_ascii("Collapsible"); } /// - void read(Lexer &) override; + void read(support::Lexer &) override; /// void write(std::ostream &) const override; diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 50db6ddcdb..226d6193c9 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -21,7 +21,6 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "InsetIterator.h" -#include "Lexer.h" #include "LyX.h" #include "MetricsInfo.h" #include "texstream.h" @@ -41,6 +40,7 @@ #include "insets/InsetWrap.h" #include "support/debug.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "frontends/Application.h" diff --git a/src/insets/InsetCommand.h b/src/insets/InsetCommand.h index 1605764450..d9ff9f8322 100644 --- a/src/insets/InsetCommand.h +++ b/src/insets/InsetCommand.h @@ -72,7 +72,7 @@ public: /// void write(std::ostream & os) const override { p_.write(os); } /// - void read(Lexer & lex) override { p_.Read(lex, &buffer()); } + void read(support::Lexer & lex) override { p_.Read(lex, &buffer()); } /// void doDispatch(Cursor & cur, FuncRequest & cmd) override; /// diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 9c3552a4b7..523a4c81dc 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -30,7 +30,6 @@ #include "Buffer.h" #include "Encoding.h" -#include "Lexer.h" #include "frontends/alert.h" @@ -38,9 +37,9 @@ #include "support/docstream.h" #include "support/ExceptionMessage.h" #include "support/gettext.h" -#include "support/lstrings.h" - #include "support/lassert.h" +#include "support/Lexer.h" +#include "support/lstrings.h" #include #include diff --git a/src/insets/InsetCommandParams.h b/src/insets/InsetCommandParams.h index f05fb61ddc..a7cdd841b6 100644 --- a/src/insets/InsetCommandParams.h +++ b/src/insets/InsetCommandParams.h @@ -26,9 +26,10 @@ namespace lyx { class Buffer; -class Lexer; class OutputParams; +namespace support { class Lexer; } + class ParamInfo { public: /// @@ -128,9 +129,9 @@ public: /// InsetCode code() const { return insetCode_; } /// Parse the command - void read(Lexer &); + void read(support::Lexer &); /// - void Read(Lexer &, Buffer const *); + void Read(support::Lexer &, Buffer const *); /// void write(std::ostream &) const; /// diff --git a/src/insets/InsetERT.cpp b/src/insets/InsetERT.cpp index 00f497f031..e4b0e88022 100644 --- a/src/insets/InsetERT.cpp +++ b/src/insets/InsetERT.cpp @@ -18,7 +18,6 @@ #include "FuncStatus.h" #include "InsetLayout.h" #include "Language.h" -#include "Lexer.h" #include "xml.h" #include "ParagraphParameters.h" #include "Paragraph.h" @@ -26,6 +25,7 @@ #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/TempFile.h" #include "Encoding.h" diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index 0581d2e6fc..04c4c0de94 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -25,8 +25,6 @@ #include "FuncStatus.h" #include "FuncRequest.h" #include "LaTeXFeatures.h" -#include "Lexer.h" -#include "LyX.h" // use_gui #include "LyXRC.h" #include "MetricsInfo.h" #include "output_latex.h" @@ -46,6 +44,7 @@ #include "support/filetools.h" #include "support/gettext.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/lyxlib.h" #include "support/TempFile.h" diff --git a/src/insets/InsetExternal.h b/src/insets/InsetExternal.h index ce71c94df3..28316d3be1 100644 --- a/src/insets/InsetExternal.h +++ b/src/insets/InsetExternal.h @@ -51,7 +51,7 @@ public: InsetExternalParams(); void write(Buffer const &, std::ostream &) const; - bool read(Buffer const &, Lexer &); + bool read(Buffer const &, support::Lexer &); /// The name of the tempfile used for manipulations. support::FileName tempname() const { return tempname_(); } @@ -141,7 +141,7 @@ public: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// int plaintext(odocstringstream & ods, OutputParams const & op, size_t max_length = INT_MAX) const override; diff --git a/src/insets/InsetFlex.cpp b/src/insets/InsetFlex.cpp index 91c0b8cea1..2a8af67fae 100644 --- a/src/insets/InsetFlex.cpp +++ b/src/insets/InsetFlex.cpp @@ -20,12 +20,12 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "Language.h" -#include "Lexer.h" #include "ParIterator.h" #include "TextClass.h" #include "support/debug.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index 9bef3ab258..8e024205e7 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -30,7 +30,6 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "xml.h" #include "output_docbook.h" #include "output_xhtml.h" @@ -43,6 +42,7 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "frontends/Application.h" diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index 50c698a43e..ada6add04a 100644 --- a/src/insets/InsetFloat.h +++ b/src/insets/InsetFloat.h @@ -30,7 +30,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// std::string type; /// @@ -88,7 +88,7 @@ private: /// void write(std::ostream & os) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void validate(LaTeXFeatures & features) const override; /// diff --git a/src/insets/InsetFloatList.cpp b/src/insets/InsetFloatList.cpp index 3315d3b896..7075538f82 100644 --- a/src/insets/InsetFloatList.cpp +++ b/src/insets/InsetFloatList.cpp @@ -23,7 +23,6 @@ #include "FuncRequest.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "Paragraph.h" #include "output_xhtml.h" #include "texstream.h" @@ -32,6 +31,7 @@ #include "support/debug.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include diff --git a/src/insets/InsetFloatList.h b/src/insets/InsetFloatList.h index ce6caa5770..21477f520d 100644 --- a/src/insets/InsetFloatList.h +++ b/src/insets/InsetFloatList.h @@ -36,7 +36,7 @@ public: /// void write(std::ostream &) const override; /// - void read(Lexer &) override; + void read(support::Lexer &) override; /// void latex(otexstream &, OutputParams const &) const override; /// diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 62577f07db..b092ff44ff 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -63,7 +63,6 @@ TODO #include "InsetIterator.h" #include "LaTeX.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "Mover.h" #include "output_docbook.h" @@ -86,6 +85,7 @@ TODO #include "support/filetools.h" #include "support/gettext.h" #include "support/Length.h" +#include "support/Lexer.h" #include "support/lyxlib.h" #include "support/lstrings.h" #include "support/os.h" diff --git a/src/insets/InsetGraphics.h b/src/insets/InsetGraphics.h index df2abc4b01..73b5625b11 100644 --- a/src/insets/InsetGraphics.h +++ b/src/insets/InsetGraphics.h @@ -68,7 +68,7 @@ public: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /** returns the number of rows (\n's) of generated tex code. #fragile == true# means, that the inset should take care about fragile commands by adding a #\protect# before. diff --git a/src/insets/InsetGraphicsParams.cpp b/src/insets/InsetGraphicsParams.cpp index 9f6ffbb901..ab2c9ff29c 100644 --- a/src/insets/InsetGraphicsParams.cpp +++ b/src/insets/InsetGraphicsParams.cpp @@ -15,7 +15,6 @@ #include "Buffer.h" #include "LyX.h" // for use_gui -#include "Lexer.h" #include "LyXRC.h" #include "graphics/epstools.h" @@ -24,6 +23,7 @@ #include "support/convert.h" #include "support/debug.h" #include "support/lyxlib.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Translator.h" diff --git a/src/insets/InsetGraphicsParams.h b/src/insets/InsetGraphicsParams.h index 1aa0b23d5b..dc6fde7a66 100644 --- a/src/insets/InsetGraphicsParams.h +++ b/src/insets/InsetGraphicsParams.h @@ -23,8 +23,8 @@ namespace lyx { namespace graphics { class Params; } +namespace support { class Lexer; } -class Lexer; class Buffer; @@ -77,7 +77,7 @@ public: /// Buffer is needed to figure out if a figure is embedded. void Write(std::ostream & os, Buffer const & buf) const; /// If the token belongs to our parameters, read it. - bool Read(Lexer & lex, std::string const & token, Buffer const & buf, + bool Read(support::Lexer & lex, std::string const & token, Buffer const & buf, bool allowOrigin); /// convert // Only a subset of InsetGraphicsParams is needed for display purposes. diff --git a/src/insets/InsetIPA.cpp b/src/insets/InsetIPA.cpp index 7745b8d946..a6ee44032c 100644 --- a/src/insets/InsetIPA.cpp +++ b/src/insets/InsetIPA.cpp @@ -19,7 +19,6 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "RenderPreview.h" #include "texstream.h" @@ -28,6 +27,8 @@ #include "graphics/PreviewImage.h" +#include "support/Lexer.h" + #include using namespace std; diff --git a/src/insets/InsetIPAMacro.cpp b/src/insets/InsetIPAMacro.cpp index 2d4b1fb13c..4c72e9b702 100644 --- a/src/insets/InsetIPAMacro.cpp +++ b/src/insets/InsetIPAMacro.cpp @@ -21,7 +21,6 @@ #include "FuncStatus.h" #include "InsetLayout.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "xml.h" #include "texstream.h" @@ -32,12 +31,15 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/Translator.h" using namespace std; namespace lyx { +using support::Lexer; + namespace { typedef Translator IPADecoTranslator; diff --git a/src/insets/InsetIPAMacro.h b/src/insets/InsetIPAMacro.h index dc1977f977..f871729c94 100644 --- a/src/insets/InsetIPAMacro.h +++ b/src/insets/InsetIPAMacro.h @@ -33,7 +33,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// Type type; }; @@ -70,7 +70,7 @@ private: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// bool neverIndent() const override { return true; } /// @@ -143,7 +143,7 @@ public: /// void write(std::ostream &) const override; /// Will not be used when lyxf3 - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void latex(otexstream &, OutputParams const &) const override; /// diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index 64bb398099..eb16a543ce 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -30,7 +30,6 @@ #include "Paragraph.h" #include "LaTeX.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "LyX.h" #include "output_latex.h" #include "output_xhtml.h" @@ -43,6 +42,7 @@ #include "support/docstream.h" #include "support/FileName.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Translator.h" diff --git a/src/insets/InsetIndex.h b/src/insets/InsetIndex.h index 860281b970..a1b7507a27 100644 --- a/src/insets/InsetIndex.h +++ b/src/insets/InsetIndex.h @@ -34,7 +34,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// docstring index; /// @@ -72,7 +72,7 @@ private: /// void write(std::ostream & os) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void docbook(XMLStream &, OutputParams const &) const override; /// diff --git a/src/insets/InsetIndexMacro.cpp b/src/insets/InsetIndexMacro.cpp index 80ba766b53..cbd17a17e1 100644 --- a/src/insets/InsetIndexMacro.cpp +++ b/src/insets/InsetIndexMacro.cpp @@ -25,7 +25,6 @@ #include "InsetList.h" #include "LaTeX.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "xml.h" #include "texstream.h" @@ -35,6 +34,7 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Translator.h" diff --git a/src/insets/InsetIndexMacro.h b/src/insets/InsetIndexMacro.h index 07109f8faf..b7ceed3fba 100644 --- a/src/insets/InsetIndexMacro.h +++ b/src/insets/InsetIndexMacro.h @@ -35,7 +35,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// Type type; }; @@ -76,7 +76,7 @@ private: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// bool neverIndent() const override { return true; } /// We do not output anything directly to the stream diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index df83f96b98..cfb5b7eafc 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -30,7 +30,6 @@ #include "LyXAction.h" #include "LyXRC.h" #include "LyXVC.h" -#include "Lexer.h" #include "output_docbook.h" #include "Paragraph.h" #include "ParIterator.h" @@ -49,6 +48,7 @@ #include "support/filetools.h" #include "support/gettext.h" #include "support/Length.h" +#include "support/Lexer.h" #include "support/Messages.h" #include "support/lstrings.h" #include "support/qstring_helpers.h" diff --git a/src/insets/InsetInfo.h b/src/insets/InsetInfo.h index 9af4d2fe4d..e0cf7585b3 100644 --- a/src/insets/InsetInfo.h +++ b/src/insets/InsetInfo.h @@ -178,7 +178,7 @@ public: /// bool hasSettings() const override { return true; } /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void write(std::ostream & os) const override; /// diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp index 8e5ed651cf..7a0c61211e 100644 --- a/src/insets/InsetLayout.cpp +++ b/src/insets/InsetLayout.cpp @@ -15,10 +15,10 @@ #include "InsetLayout.h" #include "ColorSet.h" -#include "Lexer.h" #include "TextClass.h" #include "support/debug.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/textutils.h" diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h index 6700100252..1d25dea046 100644 --- a/src/insets/InsetLayout.h +++ b/src/insets/InsetLayout.h @@ -24,9 +24,9 @@ namespace lyx { -class Lexer; class TextClass; +namespace support { class Lexer; } enum class InsetDecoration : int { CLASSIC, @@ -57,7 +57,7 @@ public: /// InsetLayout() { labelfont_.setColor(Color_insetlabel); } /// - bool read(Lexer & lexrc, TextClass const & tclass, + bool read(support::Lexer & lexrc, TextClass const & tclass, bool validating = false); /// docstring name() const { return name_; } @@ -266,7 +266,7 @@ private: /// std::string defaultCSSClass() const; /// - void readArgument(Lexer &); + void readArgument(support::Lexer &); /// docstring name_ = from_ascii("undefined"); /** diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index 8268cebd68..24c8a21a63 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -25,7 +25,6 @@ #include "InsetLayout.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "output_latex.h" #include "output_docbook.h" #include "output_xhtml.h" @@ -35,6 +34,7 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/lassert.h" diff --git a/src/insets/InsetListings.h b/src/insets/InsetListings.h index c72865cd90..df4d1e422e 100644 --- a/src/insets/InsetListings.h +++ b/src/insets/InsetListings.h @@ -52,7 +52,7 @@ private: /// void write(std::ostream & os) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void latex(otexstream &, OutputParams const &) const override; /// diff --git a/src/insets/InsetListingsParams.cpp b/src/insets/InsetListingsParams.cpp index e017d52352..2ce8f2719a 100644 --- a/src/insets/InsetListingsParams.cpp +++ b/src/insets/InsetListingsParams.cpp @@ -13,11 +13,10 @@ #include "InsetListingsParams.h" -#include "support/Length.h" -#include "Lexer.h" - #include "support/convert.h" #include "support/gettext.h" +#include "support/Length.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/textutils.h" diff --git a/src/insets/InsetListingsParams.h b/src/insets/InsetListingsParams.h index 90c5adb763..29240e8194 100644 --- a/src/insets/InsetListingsParams.h +++ b/src/insets/InsetListingsParams.h @@ -31,7 +31,7 @@ public: void write(std::ostream &) const; /// read parameters from an ostream - void read(Lexer &); + void read(support::Lexer &); /// valid parameter string std::string params(std::string const & sep=",") const; diff --git a/src/insets/InsetNewline.cpp b/src/insets/InsetNewline.cpp index ecfacf47ce..38898c8ecd 100644 --- a/src/insets/InsetNewline.cpp +++ b/src/insets/InsetNewline.cpp @@ -17,7 +17,6 @@ #include "Dimension.h" #include "FuncRequest.h" #include "FuncStatus.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "output_docbook.h" #include "output_xhtml.h" @@ -30,11 +29,14 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/docstring.h" +#include "support/Lexer.h" using namespace std; namespace lyx { +using support::Lexer; + InsetNewline::InsetNewline() : Inset(nullptr) {} diff --git a/src/insets/InsetNewline.h b/src/insets/InsetNewline.h index c85a97df66..36cfe7390a 100644 --- a/src/insets/InsetNewline.h +++ b/src/insets/InsetNewline.h @@ -32,7 +32,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// Kind kind; }; @@ -69,7 +69,7 @@ private: /// docstring xhtml(XMLStream &, OutputParams const &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void write(std::ostream & os) const override; /// is this equivalent to a space (which is BTW different from diff --git a/src/insets/InsetNewpage.cpp b/src/insets/InsetNewpage.cpp index da94452632..caac17e27c 100644 --- a/src/insets/InsetNewpage.cpp +++ b/src/insets/InsetNewpage.cpp @@ -16,7 +16,6 @@ #include "Cursor.h" #include "FuncRequest.h" #include "FuncStatus.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "xml.h" #include "texstream.h" @@ -30,13 +29,15 @@ #include "support/docstring.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" using namespace std; - namespace lyx { - InsetNewpage::InsetNewpage() : Inset(nullptr) +using support::Lexer; + +InsetNewpage::InsetNewpage() : Inset(nullptr) {} diff --git a/src/insets/InsetNewpage.h b/src/insets/InsetNewpage.h index d086276df2..80fee2ffc9 100644 --- a/src/insets/InsetNewpage.h +++ b/src/insets/InsetNewpage.h @@ -38,7 +38,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// Kind kind; }; @@ -72,7 +72,7 @@ private: /// docstring xhtml(XMLStream &, OutputParams const &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void write(std::ostream & os) const override; /// diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index b12b755fba..7eed0ed9cc 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -25,7 +25,6 @@ #include "FuncStatus.h" #include "InsetLayout.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "LyXRC.h" #include "output_docbook.h" #include "output_latex.h" @@ -33,6 +32,7 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Translator.h" @@ -45,6 +45,8 @@ using namespace std; namespace lyx { +using support::Lexer; + namespace { typedef Translator NoteTranslator; diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h index 94a07906e5..25e91f88eb 100644 --- a/src/insets/InsetNote.h +++ b/src/insets/InsetNote.h @@ -30,7 +30,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// Type type; }; @@ -71,7 +71,7 @@ private: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// show the note dialog bool showInsetDialog(BufferView * bv) const override; /// diff --git a/src/insets/InsetPhantom.cpp b/src/insets/InsetPhantom.cpp index d1a25f6a70..968d8f0337 100644 --- a/src/insets/InsetPhantom.cpp +++ b/src/insets/InsetPhantom.cpp @@ -22,7 +22,6 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "texstream.h" #include "TextClass.h" @@ -34,6 +33,7 @@ #include "frontends/Application.h" #include "frontends/FontMetrics.h" +#include "support/Lexer.h" #include "frontends/Painter.h" #include @@ -43,6 +43,8 @@ using namespace std; namespace lyx { +using support::Lexer; + namespace { typedef Translator PhantomTranslator; diff --git a/src/insets/InsetPhantom.h b/src/insets/InsetPhantom.h index 72281df2ae..57f08102ba 100644 --- a/src/insets/InsetPhantom.h +++ b/src/insets/InsetPhantom.h @@ -30,7 +30,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// Type type; }; @@ -66,7 +66,7 @@ private: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void setButtonLabel() override; /// show the phantom dialog diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp index 46b8ef11ae..8d6caf1e5e 100644 --- a/src/insets/InsetQuotes.cpp +++ b/src/insets/InsetQuotes.cpp @@ -24,7 +24,6 @@ #include "FuncRequest.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "LyXRC.h" #include "MetricsInfo.h" #include "Paragraph.h" @@ -39,6 +38,7 @@ #include "support/docstring.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/textutils.h" diff --git a/src/insets/InsetQuotes.h b/src/insets/InsetQuotes.h index 2eeb5fa866..13bd8ea124 100644 --- a/src/insets/InsetQuotes.h +++ b/src/insets/InsetQuotes.h @@ -143,7 +143,7 @@ public: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override; /// diff --git a/src/insets/InsetScript.cpp b/src/insets/InsetScript.cpp index c1f8da1e82..b588f4283e 100644 --- a/src/insets/InsetScript.cpp +++ b/src/insets/InsetScript.cpp @@ -22,7 +22,6 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "LyXAction.h" #include "MetricsInfo.h" #include "output_docbook.h" @@ -32,6 +31,7 @@ #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/Translator.h" @@ -45,6 +45,8 @@ using namespace std; namespace lyx { +using support::Lexer; + namespace { typedef Translator ScriptTranslator; diff --git a/src/insets/InsetScript.h b/src/insets/InsetScript.h index 1a008a9888..eab074b1e2 100644 --- a/src/insets/InsetScript.h +++ b/src/insets/InsetScript.h @@ -30,7 +30,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// int shift(FontInfo const & font) const; /// @@ -87,7 +87,7 @@ public: /// void write(std::ostream &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// bool forcePlainLayout(idx_type = 0) const override { return true; } /// diff --git a/src/insets/InsetSeparator.cpp b/src/insets/InsetSeparator.cpp index 218172c87a..765fa93933 100644 --- a/src/insets/InsetSeparator.cpp +++ b/src/insets/InsetSeparator.cpp @@ -16,7 +16,6 @@ #include "Dimension.h" #include "FuncRequest.h" #include "FuncStatus.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "output_docbook.h" #include "output_xhtml.h" @@ -29,12 +28,15 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/docstring.h" +#include "support/Lexer.h" using namespace std; using namespace lyx::frontend; namespace lyx { +using support::Lexer; + InsetSeparator::InsetSeparator() : Inset(nullptr) {} diff --git a/src/insets/InsetSeparator.h b/src/insets/InsetSeparator.h index b824214ae7..dba716c6aa 100644 --- a/src/insets/InsetSeparator.h +++ b/src/insets/InsetSeparator.h @@ -31,7 +31,7 @@ public: /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// Kind kind; }; @@ -85,7 +85,7 @@ private: /// docstring xhtml(XMLStream &, OutputParams const &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void write(std::ostream & os) const override; /// is this equivalent to a space (which is BTW different from diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index 8ad6f7f5e0..8991c1166f 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -22,7 +22,6 @@ #include "FuncStatus.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "texstream.h" #include "xml.h" @@ -37,12 +36,14 @@ #include "frontends/Application.h" #include "frontends/FontMetrics.h" +#include "support/Lexer.h" #include "frontends/Painter.h" using namespace std; namespace lyx { +using support::Lexer; InsetSpace::InsetSpace(InsetSpaceParams const & params) : Inset(nullptr), params_(params) diff --git a/src/insets/InsetSpace.h b/src/insets/InsetSpace.h index ceca1cfa06..719e09483d 100644 --- a/src/insets/InsetSpace.h +++ b/src/insets/InsetSpace.h @@ -79,7 +79,7 @@ struct InsetSpaceParams { /// void write(std::ostream & os) const; /// - void read(Lexer & lex); + void read(support::Lexer & lex); /// Kind kind; /// @@ -123,7 +123,7 @@ public: /// void write(std::ostream &) const override; /// Will not be used when lyxf3 - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void latex(otexstream &, OutputParams const &) const override; /// diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp index a1f7fec332..0e5337f51d 100644 --- a/src/insets/InsetSpecialChar.cpp +++ b/src/insets/InsetSpecialChar.cpp @@ -19,7 +19,6 @@ #include "Font.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "output_xhtml.h" #include "xml.h" @@ -31,11 +30,14 @@ #include "support/debug.h" #include "support/docstream.h" +#include "support/Lexer.h" using namespace std; namespace lyx { +using support::Lexer; + InsetSpecialChar::InsetSpecialChar(Kind k) : Inset(nullptr), kind_(k) diff --git a/src/insets/InsetSpecialChar.h b/src/insets/InsetSpecialChar.h index 5f7338b8dd..dab1bc3da1 100644 --- a/src/insets/InsetSpecialChar.h +++ b/src/insets/InsetSpecialChar.h @@ -71,7 +71,7 @@ public: /// void write(std::ostream &) const override; /// Will not be used when lyxf3 - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void latex(otexstream &, OutputParams const &) const override; /// diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 5242775e7f..46b54486de 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -38,7 +38,6 @@ #include "InsetList.h" #include "Language.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "LyX.h" #include "LyXRC.h" #include "MetricsInfo.h" @@ -64,6 +63,7 @@ #include "support/FileName.h" #include "support/gettext.h" #include "support/lassert.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include "support/unique_ptr.h" diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index c38fab0385..f6939c6eff 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -45,10 +45,10 @@ class CompletionList; class Cursor; class CursorSlice; class FuncStatus; -class Lexer; class OutputParams; class XMLStream; +namespace support { class Lexer; } /// class InsetTableCell : public InsetText @@ -603,7 +603,7 @@ public: /// void write(std::ostream &) const; /// - void read(Lexer &); + void read(support::Lexer &); /// void latex(otexstream &, OutputParams const &) const; /// serialise the table in DocBook, according to buffer parameters @@ -1021,7 +1021,7 @@ public: /// static std::string params2string(InsetTabular const &); /// - void read(Lexer &) override; + void read(support::Lexer &) override; /// void write(std::ostream &) const override; /// diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index b8e65709a1..084e418027 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -39,7 +39,7 @@ #include "Language.h" #include "Layout.h" #include "LaTeXFeatures.h" -#include "Lexer.h" +#include "support/Lexer.h" #include "lyxfind.h" #include "LyXRC.h" #include "MetricsInfo.h" diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h index bce125bcca..423735a032 100644 --- a/src/insets/InsetText.h +++ b/src/insets/InsetText.h @@ -51,7 +51,7 @@ public: /// empty inset to empty par void clear(); /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void write(std::ostream & os) const override; /// Let the inset compute and store its reference font from \c outer. diff --git a/src/insets/InsetVSpace.cpp b/src/insets/InsetVSpace.cpp index 80fba4dd1d..d3c6012b3f 100644 --- a/src/insets/InsetVSpace.cpp +++ b/src/insets/InsetVSpace.cpp @@ -20,7 +20,6 @@ #include "DispatchResult.h" #include "FuncRequest.h" #include "FuncStatus.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "xml.h" #include "texstream.h" @@ -29,6 +28,7 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "support/lassert.h" #include "frontends/Application.h" @@ -41,6 +41,8 @@ using namespace std; namespace lyx { +using support::Lexer; + namespace { int const ADD_TO_VSPACE_WIDTH = 5; diff --git a/src/insets/InsetVSpace.h b/src/insets/InsetVSpace.h index 51c2b5b885..e43dc306aa 100644 --- a/src/insets/InsetVSpace.h +++ b/src/insets/InsetVSpace.h @@ -58,7 +58,7 @@ private: /// in fact, appear at all. docstring xhtml(XMLStream &, OutputParams const &) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void write(std::ostream & os) const override; /// diff --git a/src/insets/InsetWrap.cpp b/src/insets/InsetWrap.cpp index 69e5b259e5..85d7ea229a 100644 --- a/src/insets/InsetWrap.cpp +++ b/src/insets/InsetWrap.cpp @@ -25,7 +25,6 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "xml.h" #include "texstream.h" #include "TextClass.h" @@ -33,6 +32,7 @@ #include "support/debug.h" #include "support/docstream.h" #include "support/gettext.h" +#include "support/Lexer.h" #include "frontends/Application.h" @@ -43,6 +43,8 @@ using namespace std; namespace lyx { +using support::Lexer; + InsetWrap::InsetWrap(Buffer * buf, string const & type) : InsetCaptionable(buf) { diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h index a44821e428..01541fdabf 100644 --- a/src/insets/InsetWrap.h +++ b/src/insets/InsetWrap.h @@ -25,7 +25,7 @@ public: /// void write(std::ostream &) const; /// - void read(Lexer &); + void read(support::Lexer &); /// std::string type; @@ -60,7 +60,7 @@ private: /// void write(std::ostream & os) const override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void validate(LaTeXFeatures & features) const override; /// diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h index 8e527c4d52..1875417d5d 100644 --- a/src/mathed/InsetMathHull.h +++ b/src/mathed/InsetMathHull.h @@ -137,9 +137,9 @@ public: /// void footer_write(TeXMathStream &) const; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// - bool readQuiet(Lexer & lex); + bool readQuiet(support::Lexer & lex); /// int plaintext(odocstringstream &, OutputParams const &, size_t max_length = INT_MAX) const override; diff --git a/src/mathed/InsetMathMacroTemplate.cpp b/src/mathed/InsetMathMacroTemplate.cpp index 2a2a87eb57..9b2fd19dab 100644 --- a/src/mathed/InsetMathMacroTemplate.cpp +++ b/src/mathed/InsetMathMacroTemplate.cpp @@ -32,7 +32,6 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "LaTeXFeatures.h" -#include "Lexer.h" #include "MetricsInfo.h" #include "TocBackend.h" @@ -45,6 +44,7 @@ #include "support/debug.h" #include "support/gettext.h" #include "support/docstream.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include @@ -55,6 +55,7 @@ using namespace std; namespace lyx { using support::bformat; +using support::Lexer; ////////////////////////////////////////////////////////////////////// diff --git a/src/mathed/InsetMathMacroTemplate.h b/src/mathed/InsetMathMacroTemplate.h index 1fa6d00989..785385a7db 100644 --- a/src/mathed/InsetMathMacroTemplate.h +++ b/src/mathed/InsetMathMacroTemplate.h @@ -45,7 +45,7 @@ public: /// bool notifyCursorLeaves(Cursor const & old, Cursor & cur) override; /// - void read(Lexer & lex) override; + void read(support::Lexer & lex) override; /// void write(std::ostream & os) const override; /// diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 79e0ec003d..eb4339c8ea 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -72,11 +72,11 @@ following hack as starting point to write some macros: #include "Buffer.h" #include "BufferParams.h" #include "Encoding.h" -#include "Lexer.h" #include "support/convert.h" #include "support/debug.h" #include "support/docstream.h" +#include "support/Lexer.h" #include @@ -86,6 +86,8 @@ using namespace std; namespace lyx { +using support::Lexer; + namespace { InsetMath::mode_type asMode(InsetMath::mode_type oldmode, docstring const & str) diff --git a/src/mathed/MathParser.h b/src/mathed/MathParser.h index d69c78a11a..734a92f2f9 100644 --- a/src/mathed/MathParser.h +++ b/src/mathed/MathParser.h @@ -24,8 +24,8 @@ class Buffer; class MathAtom; class MathData; class InsetMathGrid; -class Lexer; +namespace support { class Lexer; } /// class latexkeys { @@ -75,7 +75,7 @@ bool mathed_parse_normal(Buffer * buf, MathAtom &, docstring const &, Parse::flags f = Parse::NORMAL); /// parse formula from the LyX lexxer -bool mathed_parse_normal(Buffer * buf, MathAtom &, Lexer &, +bool mathed_parse_normal(Buffer * buf, MathAtom &, support::Lexer &, Parse::flags f = Parse::NORMAL); /// parse formula from a string into a grid diff --git a/src/Lexer.cpp b/src/support/Lexer.cpp similarity index 99% rename from src/Lexer.cpp rename to src/support/Lexer.cpp index b964eab2c4..fd8840d1a3 100644 --- a/src/Lexer.cpp +++ b/src/support/Lexer.cpp @@ -13,7 +13,7 @@ #include -#include "Lexer.h" +#include "support/Lexer.h" #include "support/convert.h" #include "support/debug.h" @@ -32,10 +32,11 @@ #include using namespace std; -using namespace lyx::support; namespace lyx { +namespace support { + ////////////////////////////////////////////////////////////////////// // // Lexer::Pimpl @@ -923,5 +924,6 @@ void Lexer::setContext(std::string const & functionName) pimpl_->context = functionName; } +} // namespace support } // namespace lyx diff --git a/src/Lexer.h b/src/support/Lexer.h similarity index 98% rename from src/Lexer.h rename to src/support/Lexer.h index 02ec7470e1..96ac205aba 100644 --- a/src/Lexer.h +++ b/src/support/Lexer.h @@ -22,7 +22,9 @@ namespace lyx { -namespace support { class FileName; } +namespace support { + +class FileName; /** A helper structure to describe a keyword for the Lexer. Usually used bundled in C style arrays and passed to the @@ -37,7 +39,7 @@ struct LexerKeyword }; -/** Generalized simple lexical analizer. +/** Generalized simple lexical analyzer. Use the method isOK() to check if there is still data available for lexing. Use one of the the operators void* or ! to test if the last reading operation was successful. @@ -255,6 +257,7 @@ public: #define PushPopHelper(x, y, z) unnamed_PushPopHelper; // Tip gotten from Bobby Schmidt's column in C/C++ Users Journal +} // namespace support } // namespace lyx diff --git a/src/support/Makefile.am b/src/support/Makefile.am index 2c2fce5f46..5c181d6852 100644 --- a/src/support/Makefile.am +++ b/src/support/Makefile.am @@ -77,6 +77,8 @@ liblyxsupport_a_SOURCES = \ Length.cpp \ Length.h \ lengthcommon.cpp \ + Lexer.cpp \ + Lexer.h \ limited_stack.h \ lstrings.cpp \ lstrings.h \ diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 3226b0f0a5..33885556b5 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -19,13 +19,13 @@ #include "Encoding.h" #include "LaTeXPackages.h" #include "LayoutFile.h" -#include "Lexer.h" #include "TextClass.h" #include "version.h" #include "support/convert.h" #include "support/FileName.h" #include "support/filetools.h" +#include "support/Lexer.h" #include "support/lstrings.h" #include