1 /** @file input_lexer.h
3 * Lexical analyzer definition for reading expressions.
4 * This file must be processed with flex. */
7 * GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef __GINAC_INPUT_LEXER_H__
25 #define __GINAC_INPUT_LEXER_H__
36 // lex functions/variables
37 extern int ginac_yyerror(char *s);
38 extern int ginac_yylex(void);
39 extern void ginac_yyrestart(FILE *f);
40 extern char *ginac_yytext;
46 /** Set the input string to be parsed by ginac_yyparse() (used internally). */
47 extern void set_lexer_string(const std::string &s);
49 /** Get name of symbol/index (used internally). */
50 extern std::string get_symbol_name(const ex & s);
52 /** Set the list of predefined symbols for the lexer (used internally). */
53 extern void set_lexer_symbols(ex l);
55 /** Check whether lexer symbol was predefined (vs. created by the lexer, e.g. function names). */
56 extern bool is_lexer_symbol_predefined(const ex &s);
58 /** The expression parser function (used internally). */
59 extern int ginac_yyparse(void);
61 /** The expression returned by the parser (used internally). */
64 /** Get error message from the parser. */
65 extern std::string get_parser_error(void);
69 #endif // ndef __GINAC_INPUT_LEXER_H__