]> www.ginac.de Git - ginac.git/blobdiff - ginac/input_lexer.ll
- minor ISO cleanup.
[ginac.git] / ginac / input_lexer.ll
index f8fc4e20be34372d7179fc62ac96171dd24bb1dd..e4757b9d8181584e48f6f91de150e5b889fb74dd 100644 (file)
 #include "fail.h"
 #include "numeric.h"
 #include "symbol.h"
+#include "lst.h"
 
-#ifndef NO_NAMESPACE_GINAC
 using namespace GiNaC;
 namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
 
 #include "input_parser.h"
 
-#ifndef NO_NAMESPACE_GINAC
 } // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC
 
 // Table of all used symbols
 struct sym_def {
@@ -105,10 +102,6 @@ Digits                     ginac_yylval = (long)Digits; return T_DIGITS;
 "<="                   return T_LESSEQ;
 ">="                   return T_GREATEREQ;
 
-                       /* matrix delimiters */
-\[\[                   return T_MATRIX_BEGIN;
-\]\]                   return T_MATRIX_END;
-
                        /* numbers */
 {D}+                   |
 "#"{D}+"R"{AN}+                |
@@ -164,9 +157,7 @@ int ginac_yywrap()
        return 1;
 }
 
-#ifndef NO_NAMESPACE_GINAC
 namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
 
 // Set the input string
 void set_lexer_string(const std::string &s)
@@ -179,24 +170,22 @@ void set_lexer_string(const std::string &s)
 void set_lexer_symbols(ex l)
 {
        syms.clear();
-       if (!is_ex_exactly_of_type(l, lst))
+       if (!is_exactly_a<lst>(l))
                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);
+       for (unsigned i=0; i<l.nops(); i++) {
+               if (is_exactly_a<symbol>(l.op(i)))
+                       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;
 }
 
-#ifndef NO_NAMESPACE_GINAC
 } // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC