/*************************************************************************** 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 #include #include #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