X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Finput_parser.yy;h=9eab1a594cb85a0e28eebece3c7cab9339eebfe5;hp=af46af0a04751e134d18c525b5d2df4349e2708a;hb=f5536efa098703ce4e857aa079db6d29d06f3ac6;hpb=d88dacba01d8d42d43823de5147d0118a5cfa7e6 diff --git a/ginac/input_parser.yy b/ginac/input_parser.yy index af46af0a..9eab1a59 100644 --- a/ginac/input_parser.yy +++ b/ginac/input_parser.yy @@ -39,9 +39,7 @@ #include "matrix.h" #include "inifcns.h" -#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_NAMESPACE_GINAC #define YYERROR_VERBOSE 1 @@ -91,12 +89,12 @@ exp : T_NUMBER {$$ = $1;} if (is_lexer_symbol_predefined($1)) $$ = $1.eval(); else - throw (std::runtime_error("unknown symbol '" + ex_to_symbol($1).getname() + "'")); + throw (std::runtime_error("unknown symbol '" + ex_to_symbol($1).get_name() + "'")); } | T_LITERAL {$$ = $1;} | T_DIGITS {$$ = $1;} | T_SYMBOL '(' exprseq ')' { - unsigned i = function::find_function(ex_to_symbol($1).getname(), $3.nops()); + unsigned i = function::find_function(ex_to_symbol($1).get_name(), $3.nops()); $$ = function(i, static_cast(*($3.bp))).eval(1); } | exp T_EQUAL exp {$$ = $1 == $3;} @@ -109,14 +107,13 @@ exp : T_NUMBER {$$ = $1;} | exp '-' exp {$$ = $1 - $3;} | exp '*' exp {$$ = $1 * $3;} | exp '/' exp {$$ = $1 / $3;} - | exp '%' exp {$$ = $1 % $3;} | '-' exp %prec NEG {$$ = -$2;} | '+' exp %prec NEG {$$ = $2;} | exp '^' exp {$$ = pow($1, $3);} | exp '!' {$$ = factorial($1);} | '(' exp ')' {$$ = $2;} | '[' list_or_empty ']' {$$ = $2;} - | T_MATRIX_BEGIN matrix T_MATRIX_END {$$ = lst_to_matrix($2);} + | T_MATRIX_BEGIN matrix T_MATRIX_END {$$ = lst_to_matrix(ex_to_lst($2));} ; exprseq : exp {$$ = exprseq($1);} @@ -151,15 +148,11 @@ std::string get_parser_error(void) return parser_error; } -#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -using GiNaC::parser_error; -#endif // ndef NO_NAMESPACE_GINAC - // Error print routine (store error string in parser_error) int ginac_yyerror(char *s) { - parser_error = std::string(s) + " at " + std::string(ginac_yytext); + GiNaC::parser_error = std::string(s) + " at " + std::string(ginac_yytext); return 0; }