* This file must be processed with flex. */
/*
- * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
*
* 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
ex sym;
bool predefined; // true = user supplied symbol, false = lexer generated symbol
};
-typedef map<string, sym_def> sym_tab;
+typedef std::map<std::string, sym_def> sym_tab;
static sym_tab syms;
// lex input function
/* numbers */
{D}+ |
+"#"{D}+"R"{AN}+ |
+"#b"([01])+ |
+"#o"[0-7]+ |
+"#x"[0-9a-fA-F]+ |
{D}+"."{D}*({E})? |
{D}*"."{D}+({E})? |
{D}+{E} ginac_yylval = numeric(yytext); return T_NUMBER;
if (i == syms.end()) {
syms[yytext] = sym_def(ginac_yylval = *(new symbol(yytext)), false);
} else
- ginac_yylval = i->second.sym;
+ ginac_yylval = (*i).second.sym;
return T_SYMBOL;
}
*/
// The string from which we will read
-static string lexer_string;
+static std::string lexer_string;
// The current position within the string
static int curr_pos = 0;
#endif // ndef NO_NAMESPACE_GINAC
// Set the input string
-void set_lexer_string(const string &s)
+void set_lexer_string(const std::string &s)
{
lexer_string = s;
curr_pos = 0;
return;
for (int i=0; i<l.nops(); i++) {
if (is_ex_exactly_of_type(l.op(i), symbol))
- syms[ex_to_symbol(l.op(i)).getname()] = sym_def(l.op(i), true);
+ syms[ex_to_symbol(l.op(i)).get_name()] = sym_def(l.op(i), true);
}
}
// Check whether symbol was predefined
bool is_lexer_symbol_predefined(const ex &s)
{
- sym_tab::const_iterator i = syms.find(ex_to_symbol(s).getname());
+ sym_tab::const_iterator i = syms.find(ex_to_symbol(s).get_name());
if (i == syms.end())
return false;
else
- return i->second.predefined;
+ return (*i).second.predefined;
}
#ifndef NO_NAMESPACE_GINAC