]> www.ginac.de Git - ginac.git/commit
parser: allow read/write access to symbol table and strictness.
authorAlexei Sheplyakov <varg@theor.jinr.ru>
Sat, 13 Sep 2008 00:40:12 +0000 (04:40 +0400)
committerAlexei Sheplyakov <varg@theor.jinr.ru>
Fri, 19 Sep 2008 09:15:49 +0000 (13:15 +0400)
commitef06261c6354bea6d35e8bcdb89806056d4cccb9
treebe4c78fbc1c16affaa7d9ddc799bfffb34e29546
parent58a84c0adac7cbaa63a50c06815aed9c7a0bcdcc
parser: allow read/write access to symbol table and strictness.

Intended usage:

parser reader;
ifstream input_file1, input_file2;
// read the first file...
ex e1 = reader(input_file1);
// ... add extra entry into the symbol table used by parser
symbol x;
parser.get_syms()["x"] = x;
// Disable the parser to introduce new symbols, e.g. to ensure the expression
// in input_file2 contains the same symbols as e1 (read from input_file1).
parser.strict = true;
ex e2;
try {
e2 = reader(input_file2);
} catch (...) {
abort();
}
ginac/parser/parser.hpp