宿題用に、Excel に似た C++ コンソール アプリを作成しています。私のアプリは、セルの数式を受け入れることができる必要があります。たとえば、次のように評価する必要があります。
Sum(tablename\fieldname[recordnumber], fieldname[recordnumber], ...)
tablename\fieldname[recordnumber] points to a cell in another table,
fieldname[recordnumber] points to a cell in current table
また
Sin(fieldname[recordnumber])
また
anotherfieldname[recordnumber]
また
"10" // (simply a number)
そんな感じ。関数は、Sum、Ave、Sin、Cos、Tan、Cot、Mul、Div、Pow、Log (10)、Ln、Mod です。
それは哀れです、私は知っていますが、それは私の宿題です:'(
では、このようなものを評価するためのトリックを知っている人はいますか?