X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Finput_parser.yy;h=1685c796fec666086f8d44cf8687c91092cd43de;hb=fdade42bf337fa1650bb9d69ee06e3bd1562c951;hp=3fa82c1235fa945158b778e607a4a7a64ef508a5;hpb=9e2d60e206395fc9908e1f9025e50c76b3d7c182;p=ginac.git diff --git a/ginac/input_parser.yy b/ginac/input_parser.yy index 3fa82c12..1685c796 100644 --- a/ginac/input_parser.yy +++ b/ginac/input_parser.yy @@ -4,7 +4,7 @@ * This file must be processed with yacc/bison. */ /* - * 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 @@ -91,12 +91,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 +109,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);} @@ -161,4 +160,5 @@ using GiNaC::parser_error; int ginac_yyerror(char *s) { parser_error = std::string(s) + " at " + std::string(ginac_yytext); + return 0; }