[go: up one dir, main page]

Menu

[r52]: / src / ltxfilelex.h  Maximize  Restore  History

Download this file

63 lines (54 with data), 2.9 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/***************************************************************************
ltxfilelex.h - rules for reading EQC statements from a Latex file
scanner generation file for flex
-------------------
begin : Sun Oct 21 2001
copyright : (C) 2001 by Jan Rheinlaender
email : jrheinlaender@users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef __LTXFILELEX_H__
#define __LTXFILELEX_H__
#include <string>
#include <fstream>
#include <ginac/ginac.h>
#include "equation.h"
using namespace GiNaC;
// lex functions/variables
extern int yyerror(std::string* inputfile, const char *s);
extern int yylex(void); // *** changed to yylex in 1.0
extern char *yytext;
// declarations for interfacing with the parser
extern int linenumber;
extern std::string argument; // *** added in 1.4.4
extern bool noraw; // *** added in 1.4.4
// helper functions for controlling input buffers from the parser
extern bool new_input_buffer (const std::string &fname);
extern bool pop_input_buffer();
// Make the output file available to the scanner (necessary for ECHO when scanning verbatim environments)
extern std::ofstream output; // *** added in 0.4
// Declarations for scanning arguments *** added in 0.6
enum scanmode {
keyword, // process EQC keywords and their parameters *** added in 0.8
verb, // scan up to the closing \verb token
verbatim, // scan up to \end{verbatim}
scan_ex, // scan an expression or one equation of a list of equations, up to a ';' or a closing bracket '}'
scan_str, // scan an arbitrary string up to a closing bracket '}'
scan_stm, // scan anything up to a backslash '\', ignoring brackets (!)
scan_qstr // scan a string constant up to the closing " *** added in 0.8, changed to qstr in 1.2
};
extern void enter_state(const scanmode m); // *** changed name in 0.8
extern void exit_state(); // *** added in 0.8
extern void clear_state(); // *** added in 0.8
extern const scanmode get_state(); // *** added in 0.8
extern void set_implicit_mul(const bool how); // *** added in 0.8
extern void set_asterisk_statement(const bool how); // *** added in 1.4.3
extern const bool get_asterisk_statement();
#endif