]> git.lyx.org Git - lyx.git/blob - src/Lexer.cpp
simplify Lexer use a bit
[lyx.git] / src / Lexer.cpp
1 /**
2  * \file Lexer.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Alejandro Aguilar Sierra
7  * \author Lars Gullik Bjønnes
8  * \author Jean-Marc Lasgouttes
9  * \author John Levon
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #include <config.h>
15
16 #include "Lexer.h"
17
18 #include "support/convert.h"
19 #include "support/debug.h"
20 #include "support/FileName.h"
21 #include "support/filetools.h"
22 #include "support/gzstream.h"
23 #include "support/lstrings.h"
24 #include "support/lyxalgo.h"
25 #include "support/types.h"
26
27 #include <functional>
28 #include <istream>
29 #include <stack>
30 #include <vector>
31
32 using namespace std;
33 using namespace lyx::support;
34
35 namespace lyx {
36
37 //////////////////////////////////////////////////////////////////////
38 //
39 // Lexer::Pimpl
40 //
41 //////////////////////////////////////////////////////////////////////
42
43
44 ///
45 class Lexer::Pimpl {
46 public:
47         ///
48         Pimpl(LexerKeyword * tab, int num);
49         ///
50         string const getString() const;
51         ///
52         docstring const getDocString() const;
53         ///
54         void printError(string const & message) const;
55         ///
56         void printTable(ostream & os);
57         ///
58         void pushTable(LexerKeyword * tab, int num);
59         ///
60         void popTable();
61         ///
62         bool setFile(FileName const & filename);
63         ///
64         void setStream(istream & i);
65         ///
66         void setCommentChar(char c);
67         ///
68         bool next(bool esc = false);
69         ///
70         int search_kw(char const * const tag) const;
71         ///
72         int lex();
73         ///
74         bool eatLine();
75         ///
76         bool nextToken();
77         /// test if there is a pushed token or the stream is ok
78         bool inputAvailable();
79         ///
80         void pushToken(string const &);
81         /// fb_ is only used to open files, the stream is accessed through is.
82         filebuf fb_;
83
84         /// gz_ is only used to open files, the stream is accessed through is.
85         gz::gzstreambuf gz_;
86
87         /// the stream that we use.
88         istream is;
89         ///
90         string name;
91         ///
92         LexerKeyword * table;
93         ///
94         int no_items;
95         ///
96         string buff;
97         ///
98         int status;
99         ///
100         int lineno;
101         ///
102         string pushTok;
103         ///
104         char commentChar;
105 private:
106         /// non-copyable
107         Pimpl(Pimpl const &);
108         void operator=(Pimpl const &);
109
110         ///
111         void verifyTable();
112         ///
113         class PushedTable {
114         public:
115                 ///
116                 PushedTable()
117                         : table_elem(0), table_siz(0) {}
118                 ///
119                 PushedTable(LexerKeyword * ki, int siz)
120                         : table_elem(ki), table_siz(siz) {}
121                 ///
122                 LexerKeyword * table_elem;
123                 ///
124                 int table_siz;
125         };
126         ///
127         stack<PushedTable> pushed;
128 };
129
130
131
132 namespace {
133
134 class CompareTags
135         : public binary_function<LexerKeyword, LexerKeyword, bool> {
136 public:
137         // used by lower_bound, sort and sorted
138         bool operator()(LexerKeyword const & a, LexerKeyword const & b) const
139         {
140                 // we use the ascii version, because in turkish, 'i'
141                 // is not the lowercase version of 'I', and thus
142                 // turkish locale breaks parsing of tags.
143                 return compare_ascii_no_case(a.tag, b.tag) < 0;
144         }
145 };
146
147 } // end of anon namespace
148
149
150 Lexer::Pimpl::Pimpl(LexerKeyword * tab, int num)
151         : is(&fb_), table(tab), no_items(num),
152           status(0), lineno(0), commentChar('#')
153 {
154         verifyTable();
155 }
156
157
158 string const Lexer::Pimpl::getString() const
159 {
160         return buff;
161 }
162
163
164 docstring const Lexer::Pimpl::getDocString() const
165 {
166         return from_utf8(buff);
167 }
168
169
170 void Lexer::Pimpl::printError(string const & message) const
171 {
172         string const tmpmsg = subst(message, "$$Token", getString());
173         lyxerr << "LyX: " << tmpmsg << " [around line " << lineno
174                 << " of file " << to_utf8(makeDisplayPath(name)) << ']' << endl;
175 }
176
177
178 void Lexer::Pimpl::printTable(ostream & os)
179 {
180         os << "\nNumber of tags: " << no_items << endl;
181         for (int i= 0; i < no_items; ++i)
182                 os << "table[" << i
183                    << "]:  tag: `" << table[i].tag
184                    << "'  code:" << table[i].code << '\n';
185         os.flush();
186 }
187
188
189 void Lexer::Pimpl::verifyTable()
190 {
191         // Check if the table is sorted and if not, sort it.
192         if (table
193             && !lyx::sorted(table, table + no_items, CompareTags())) {
194                 lyxerr << "The table passed to Lexer is not sorted!\n"
195                        << "Tell the developers to fix it!" << endl;
196                 // We sort it anyway to avoid problems.
197                 lyxerr << "\nUnsorted:" << endl;
198                 printTable(lyxerr);
199
200                 sort(table, table + no_items, CompareTags());
201                 lyxerr << "\nSorted:" << endl;
202                 printTable(lyxerr);
203         }
204 }
205
206
207 void Lexer::Pimpl::pushTable(LexerKeyword * tab, int num)
208 {
209         PushedTable tmppu(table, no_items);
210         pushed.push(tmppu);
211
212         table = tab;
213         no_items = num;
214
215         verifyTable();
216 }
217
218
219 void Lexer::Pimpl::popTable()
220 {
221         if (pushed.empty()) {
222                 lyxerr << "Lexer error: nothing to pop!" << endl;
223                 return;
224         }
225
226         PushedTable tmp = pushed.top();
227         pushed.pop();
228         table = tmp.table_elem;
229         no_items = tmp.table_siz;
230 }
231
232
233 bool Lexer::Pimpl::setFile(FileName const & filename)
234 {
235         // Check the format of the file.
236         string const format = filename.guessFormatFromContents();
237
238         if (format == "gzip" || format == "zip" || format == "compress") {
239                 LYXERR(Debug::LYXLEX, "lyxlex: compressed");
240                 // The check only outputs a debug message, because it triggers
241                 // a bug in compaq cxx 6.2, where is_open() returns 'true' for
242                 // a fresh new filebuf.  (JMarc)
243                 if (gz_.is_open() || istream::off_type(is.tellg()) > -1)
244                         LYXERR(Debug::LYXLEX, "Error in LyXLex::setFile: "
245                                 "file or stream already set.");
246                 gz_.open(filename.toFilesystemEncoding().c_str(), ios::in);
247                 is.rdbuf(&gz_);
248                 name = filename.absFilename();
249                 lineno = 0;
250                 return gz_.is_open() && is.good();
251         } else {
252                 LYXERR(Debug::LYXLEX, "lyxlex: UNcompressed");
253
254                 // The check only outputs a debug message, because it triggers
255                 // a bug in compaq cxx 6.2, where is_open() returns 'true' for
256                 // a fresh new filebuf.  (JMarc)
257                 if (fb_.is_open() || istream::off_type(is.tellg()) > 0) {
258                         LYXERR(Debug::LYXLEX, "Error in Lexer::setFile: "
259                                 "file or stream already set.");
260                 }
261                 fb_.open(filename.toFilesystemEncoding().c_str(), ios::in);
262                 is.rdbuf(&fb_);
263                 name = filename.absFilename();
264                 lineno = 0;
265                 return fb_.is_open() && is.good();
266         }
267 }
268
269
270 void Lexer::Pimpl::setStream(istream & i)
271 {
272         if (fb_.is_open() || istream::off_type(is.tellg()) > 0) {
273                 LYXERR(Debug::LYXLEX, "Error in Lexer::setStream: "
274                         "file or stream already set.");
275         }
276         is.rdbuf(i.rdbuf());
277         lineno = 0;
278 }
279
280
281 void Lexer::Pimpl::setCommentChar(char c)
282 {
283         commentChar = c;
284 }
285
286
287 bool Lexer::Pimpl::next(bool esc /* = false */)
288 {
289         if (!pushTok.empty()) {
290                 // There can have been a whole line pushed so
291                 // we extract the first word and leaves the rest
292                 // in pushTok. (Lgb)
293                 if (pushTok[0] == '\\' && pushTok.find(' ') != string::npos) {
294                         buff.clear();
295                         pushTok = split(pushTok, buff, ' ');
296                 } else {
297                         buff = pushTok;
298                         pushTok.clear();
299                 }
300                 status = LEX_TOKEN;
301                 return true;
302         }
303         if (!esc) {
304                 unsigned char c = 0; // getc() returns an int
305                 char cc = 0;
306                 status = 0;
307                 while (is && !status) {
308                         is.get(cc);
309                         c = cc;
310                         if (c == commentChar) {
311                                 // Read rest of line (fast :-)
312 #if 1
313                                 // That is not fast... (Lgb)
314                                 string dummy;
315                                 getline(is, dummy);
316
317                                 LYXERR(Debug::LYXLEX, "Comment read: `" << c << dummy << '\'');
318 #else
319                                 // unfortunately ignore is buggy (Lgb)
320                                 is.ignore(100, '\n');
321 #endif
322                                 ++lineno;
323                                 continue;
324                         }
325
326                         if (c == '\"') {
327                                 buff.clear();
328
329                                 do {
330                                         is.get(cc);
331                                         c = cc;
332                                         if (c != '\r')
333                                                 buff.push_back(c);
334                                 } while (c != '\"' && c != '\n' && is);
335
336                                 if (c != '\"') {
337                                         printError("Missing quote");
338                                         if (c == '\n')
339                                                 ++lineno;
340                                 }
341
342                                 buff.resize(buff.size()-1);
343                                 status = LEX_DATA;
344                                 break;
345                         }
346
347                         if (c == ',')
348                                 continue;              /* Skip ','s */
349
350                                 // using relational operators with chars other
351                                 // than == and != is not safe. And if it is done
352                                 // the type _have_ to be unsigned. It usually a
353                                 // lot better to use the functions from cctype
354                         if (c > ' ' && is)  {
355                                 buff.clear();
356
357                                 do {
358                                         buff.push_back(c);
359                                         is.get(cc);
360                                         c = cc;
361                                 } while (c > ' ' && c != ',' && is);
362
363                                 status = LEX_TOKEN;
364                         }
365
366                         if (c == '\r' && is) {
367                                 // The Windows support has lead to the
368                                 // possibility of "\r\n" at the end of
369                                 // a line.  This will stop LyX choking
370                                 // when it expected to find a '\n'
371                                 is.get(cc);
372                                 c = cc;
373                         }
374
375                         if (c == '\n')
376                                 ++lineno;
377
378                 }
379                 if (status)
380                         return true;
381
382                 status = is.eof() ? LEX_FEOF: LEX_UNDEF;
383                 buff.clear();
384                 return false;
385         } else {
386                 unsigned char c = 0; // getc() returns an int
387                 char cc = 0;
388
389                 status = 0;
390                 while (is && !status) {
391                         is.get(cc);
392                         c = cc;
393
394                         // skip ','s
395                         if (c == ',')
396                                 continue;
397
398                         if (c == commentChar) {
399                                 // Read rest of line (fast :-)
400 #if 1
401                                 // That is still not fast... (Lgb)
402                                 string dummy;
403                                 getline(is, dummy);
404
405                                 LYXERR(Debug::LYXLEX, "Comment read: `" << c << dummy << '\'');
406 #else
407                                 // but ignore is also still buggy (Lgb)
408                                 // This is fast (Lgb)
409                                 is.ignore(100, '\n');
410 #endif
411                                 ++lineno;
412                                 continue;
413                         }
414
415                         // string
416                         if (c == '\"') {
417                                 buff.clear();
418
419                                 bool escaped = false;
420                                 do {
421                                         escaped = false;
422                                         is.get(cc);
423                                         c = cc;
424                                         if (c == '\r') continue;
425                                         if (c == '\\') {
426                                                 // escape the next char
427                                                 is.get(cc);
428                                                 c = cc;
429                                                 if (c == '\"' || c == '\\')
430                                                         escaped = true;
431                                                 else
432                                                         buff.push_back('\\');
433                                         }
434                                         buff.push_back(c);
435
436                                         if (!escaped && c == '\"')
437                                                 break;
438                                 } while (c != '\n' && is);
439
440                                 if (c != '\"') {
441                                         printError("Missing quote");
442                                         if (c == '\n')
443                                                 ++lineno;
444                                 }
445
446                                 buff.resize(buff.size() -1);
447                                 status = LEX_DATA;
448                                 break;
449                         }
450
451                         if (c > ' ' && is) {
452                                 buff.clear();
453
454                                 do {
455                                         if (c == '\\') {
456                                                 // escape the next char
457                                                 is.get(cc);
458                                                 c = cc;
459                                                 //escaped = true;
460                                         }
461                                         buff.push_back(c);
462                                         is.get(cc);
463                                         c = cc;
464                                 } while (c > ' ' && c != ',' && is);
465
466                                 status = LEX_TOKEN;
467                         }
468                         // new line
469                         if (c == '\n')
470                                 ++lineno;
471                 }
472
473                 if (status)
474                         return true;
475
476                 status = is.eof() ? LEX_FEOF : LEX_UNDEF;
477                 buff.clear();
478                 return false;
479         }
480 }
481
482
483 int Lexer::Pimpl::search_kw(char const * const tag) const
484 {
485         LexerKeyword search_tag = { tag, 0 };
486         LexerKeyword * res =
487                 lower_bound(table, table + no_items,
488                             search_tag, CompareTags());
489         // use the compare_ascii_no_case instead of compare_no_case,
490         // because in turkish, 'i' is not the lowercase version of 'I',
491         // and thus turkish locale breaks parsing of tags.
492         if (res != table + no_items
493             && !compare_ascii_no_case(res->tag, tag))
494                 return res->code;
495         return LEX_UNDEF;
496 }
497
498
499 int Lexer::Pimpl::lex()
500 {
501         //NOTE: possible bug.
502         if (next() && status == LEX_TOKEN)
503                 return search_kw(getString().c_str());
504         return status;
505 }
506
507
508 bool Lexer::Pimpl::eatLine()
509 {
510         buff.clear();
511
512         unsigned char c = '\0';
513         char cc = 0;
514         while (is && c != '\n') {
515                 is.get(cc);
516                 c = cc;
517                 //LYXERR(Debug::LYXLEX, "Lexer::EatLine read char: `" << c << '\'');
518                 if (c != '\r')
519                         buff.push_back(c);
520         }
521
522         if (c == '\n') {
523                 ++lineno;
524                 buff.resize(buff.size() - 1);
525                 status = LEX_DATA;
526                 return true;
527         } else if (buff.length() > 0) { // last line
528                 status = LEX_DATA;
529                 return true;
530         } else {
531                 return false;
532         }
533 }
534
535
536 bool Lexer::Pimpl::nextToken()
537 {
538         if (!pushTok.empty()) {
539                 // There can have been a whole line pushed so
540                 // we extract the first word and leaves the rest
541                 // in pushTok. (Lgb)
542                 if (pushTok[0] == '\\' && pushTok.find(' ') != string::npos) {
543                         buff.clear();
544                         pushTok = split(pushTok, buff, ' ');
545                 } else {
546                         buff = pushTok;
547                         pushTok.clear();
548                 }
549                 status = LEX_TOKEN;
550                 return true;
551         }
552
553         status = 0;
554         while (is && !status) {
555                 unsigned char c = 0;
556                 char cc = 0;
557                 is.get(cc);
558                 c = cc;
559                 if (c >= ' ' && is) {
560                         buff.clear();
561
562                         if (c == '\\') { // first char == '\\'
563                                 do {
564                                         buff.push_back(c);
565                                         is.get(cc);
566                                         c = cc;
567                                 } while (c > ' ' && c != '\\' && is);
568                         } else {
569                                 do {
570                                         buff.push_back(c);
571                                         is.get(cc);
572                                         c = cc;
573                                 } while (c >= ' ' && c != '\\' && is);
574                         }
575
576                         if (c == '\\')
577                                 is.putback(c); // put it back
578                         status = LEX_TOKEN;
579                 }
580
581                 if (c == '\n')
582                         ++lineno;
583
584         }
585         if (status)
586                 return true;
587
588         status = is.eof() ? LEX_FEOF: LEX_UNDEF;
589         buff.clear();
590         return false;
591 }
592
593
594 bool Lexer::Pimpl::inputAvailable()
595 {
596         return is.good();
597 }
598
599
600 void Lexer::Pimpl::pushToken(string const & pt)
601 {
602         pushTok = pt;
603 }
604
605
606
607
608 //////////////////////////////////////////////////////////////////////
609 //
610 // Lexer
611 //
612 //////////////////////////////////////////////////////////////////////
613
614 Lexer::Lexer()
615         : pimpl_(new Pimpl(0, 0))
616 {}
617
618
619 void Lexer::init(LexerKeyword * tab, int num)
620 {
621          pimpl_ = new Pimpl(tab, num);
622 }
623
624
625 Lexer::~Lexer()
626 {
627         delete pimpl_;
628 }
629
630
631 bool Lexer::isOK() const
632 {
633         return pimpl_->inputAvailable();
634 }
635
636
637 void Lexer::setLineNumber(int l)
638 {
639         pimpl_->lineno = l;
640 }
641
642
643 int Lexer::lineNumber() const
644 {
645         return pimpl_->lineno;
646 }
647
648
649 istream & Lexer::getStream()
650 {
651         return pimpl_->is;
652 }
653
654
655 void Lexer::pushTable(LexerKeyword * tab, int num)
656 {
657         pimpl_->pushTable(tab, num);
658 }
659
660
661 void Lexer::popTable()
662 {
663         pimpl_->popTable();
664 }
665
666
667 void Lexer::printTable(ostream & os)
668 {
669         pimpl_->printTable(os);
670 }
671
672
673 void Lexer::printError(string const & message) const
674 {
675         pimpl_->printError(message);
676 }
677
678
679 bool Lexer::setFile(FileName const & filename)
680 {
681         return pimpl_->setFile(filename);
682 }
683
684
685 void Lexer::setStream(istream & i)
686 {
687         pimpl_->setStream(i);
688 }
689
690
691 void Lexer::setCommentChar(char c)
692 {
693         pimpl_->setCommentChar(c);
694 }
695
696 int Lexer::lex()
697 {
698         return pimpl_->lex();
699 }
700
701
702 int Lexer::getInteger() const
703 {
704         lastReadOk_ = pimpl_->status == LEX_DATA || pimpl_->status == LEX_TOKEN;
705         if (!lastReadOk_) {
706                 pimpl_->printError("integer token missing");
707                 return -1;
708         }
709
710         if (isStrInt(pimpl_->getString()))
711                 return convert<int>(pimpl_->getString());
712
713         lastReadOk_ = false;
714         pimpl_->printError("Bad integer `$$Token'");
715         return -1;
716 }
717
718
719 double Lexer::getFloat() const
720 {
721         // replace comma with dot in case the file was written with
722         // the wrong locale (should be rare, but is easy enough to
723         // avoid).
724         lastReadOk_ = pimpl_->status == LEX_DATA || pimpl_->status == LEX_TOKEN;
725         if (!lastReadOk_) {
726                 pimpl_->printError("float token missing");
727                 return -1;
728         }
729
730         string const str = subst(pimpl_->getString(), ",", ".");
731         if (isStrDbl(str))
732                 return convert<double>(str);
733
734         lastReadOk_ = false;
735         pimpl_->printError("Bad float `$$Token'");
736         return -1;
737 }
738
739
740 string const Lexer::getString() const
741 {
742         lastReadOk_ = pimpl_->status == LEX_DATA || pimpl_->status == LEX_TOKEN;
743
744         if (lastReadOk_)
745         return pimpl_->getString();
746
747         return string();
748 }
749
750
751 docstring const Lexer::getDocString() const
752 {
753         lastReadOk_ = pimpl_->status == LEX_DATA || pimpl_->status == LEX_TOKEN;
754
755         if (lastReadOk_)
756                 return pimpl_->getDocString();
757
758         return docstring();
759 }
760
761
762 // I would prefer to give a tag number instead of an explicit token
763 // here, but it is not possible because Buffer::readDocument uses
764 // explicit tokens (JMarc)
765 string const Lexer::getLongString(string const & endtoken)
766 {
767         string str;
768         string prefix;
769         bool firstline = true;
770
771         while (pimpl_->is) { //< eatLine only reads from is, not from pushTok
772                 if (!eatLine())
773                         // blank line in the file being read
774                         continue;
775
776                 string const token = trim(getString(), " \t");
777
778                 LYXERR(Debug::PARSER, "LongString: `" << getString() << '\'');
779
780                 // We do a case independent comparison, like search_kw does.
781                 if (compare_ascii_no_case(token, endtoken) == 0)
782                         break;
783
784                 string tmpstr = getString();
785                 if (firstline) {
786                         size_t i = tmpstr.find_first_not_of(' ');
787                         if (i != string::npos)
788                                 prefix = tmpstr.substr(0, i);
789                         firstline = false;
790                         LYXERR(Debug::PARSER, "Prefix = `" << prefix << "\'");
791                 }
792
793                 // further lines in long strings may have the same
794                 // whitespace prefix as the first line. Remove it.
795                 if (prefix.length() && prefixIs(tmpstr, prefix))
796                         tmpstr.erase(0, prefix.length() - 1);
797
798                 str += ltrim(tmpstr, "\t") + '\n';
799         }
800
801         if (!pimpl_->is)
802                 printError("Long string not ended by `" + endtoken + '\'');
803
804         return str;
805 }
806
807
808 bool Lexer::getBool() const
809 {
810         if (pimpl_->getString() == "true") {
811                 lastReadOk_ = true;
812                 return true;
813         } else if (pimpl_->getString() != "false") {
814                 pimpl_->printError("Bad boolean `$$Token'. "
815                                    "Use \"false\" or \"true\"");
816                 lastReadOk_ = false;
817         }
818         lastReadOk_ = true;
819         return false;
820 }
821
822
823 bool Lexer::eatLine()
824 {
825         return pimpl_->eatLine();
826 }
827
828
829 bool Lexer::next(bool esc)
830 {
831         return pimpl_->next(esc);
832 }
833
834
835 bool Lexer::nextToken()
836 {
837         return pimpl_->nextToken();
838 }
839
840
841 void Lexer::pushToken(string const & pt)
842 {
843         pimpl_->pushToken(pt);
844 }
845
846
847 Lexer::operator void const *() const
848 {
849         // This behaviour is NOT the same as the streams which would
850         // use fail() here. However, our implementation of getString() et al.
851         // can cause the eof() and fail() bits to be set, even though we
852         // haven't tried to read 'em.
853         return lastReadOk_? this : 0;
854 }
855
856
857 bool Lexer::operator!() const
858 {
859         return !lastReadOk_;
860 }
861
862
863 Lexer & Lexer::operator>>(string & s)
864 {
865         if (isOK()) {
866                 next();
867                 s = getString();
868         } else {
869                 lastReadOk_ = false;
870         }
871         return *this;
872 }
873
874
875 Lexer & Lexer::operator>>(docstring & s)
876 {
877         if (isOK()) {
878                 next();
879                 s = getDocString();
880         } else {
881                 lastReadOk_ = false;
882         }
883         return *this;
884 }
885
886
887 Lexer & Lexer::operator>>(double & s)
888 {
889         if (isOK()) {
890                 next();
891                 s = getFloat();
892         } else {
893                 lastReadOk_ = false;
894         }
895         return *this;
896 }
897
898
899 Lexer & Lexer::operator>>(int & s)
900 {
901         if (isOK()) {
902                 next();
903                 s = getInteger();
904         } else {
905                 lastReadOk_ = false;
906         }
907         return *this;
908 }
909
910
911 Lexer & Lexer::operator>>(unsigned int & s)
912 {
913         if (isOK()) {
914                 next();
915                 s = getInteger();
916         } else {
917                 lastReadOk_ = false;
918         }
919         return *this;
920 }
921
922
923 Lexer & Lexer::operator>>(bool & s)
924 {
925         if (isOK()) {
926                 next();
927                 s = getBool();
928         } else {
929                 lastReadOk_ = false;
930         }
931         return *this;
932 }
933
934
935 // quotes a string, e.g. for use in preferences files or as an argument
936 // of the "log" dialog
937 string const Lexer::quoteString(string const & arg)
938 {
939         string res;
940         res += '"';
941         res += subst(subst(arg, "\\", "\\\\"), "\"", "\\\"");
942         res += '"';
943         return res;
944 }
945
946
947 } // namespace lyx