CAS command question
|
01-11-2017, 02:18 PM
(This post was last modified: 01-11-2017 02:44 PM by DrD.)
Post: #75
|
|||
|
|||
RE: CAS command question
(01-11-2017 06:46 AM)parisse Wrote: I'm really not an expert in the process of parsing. I'm using flex and bison to do that, you can refer to their documentation for much better explanation. In short, the C++ code output from flex reads the strings and cut it into words with a token value according to the rules in the file input_lexer.ll from giac source code (for example "(" has token value T_BEGIN_PAR). Then the C++ code output from bison translate the string into a giac::gen expression by grouping tokens according to the grammar in the file input_parser.yy. During that step, nothing is evaluated. The quote describes the point I have been driving at: -If- you can get at the content from the input_lexer.ll, and before hitting the input_parser.yy (before any evaluation step), it seems like new lhs and rhs commands could be implemented using that content, without reordering the expressions. This would leave existing CAS left() and right() commands to remain in legacy status, (evaluated first). ARGUMENT FOR new lhs and rhs commands: Other commands require an Expression, and conditionally reversing the expressions conflicts programs that directly flow from the existing left(), right(), commands, as result might become reversed. (Examples: coeff(), symb2poly(), LNAME(); etc.) ARGUMENT AGAINST: Legacy, "always done it that way," means that CAS requires evaluation, resulting in "<" reversing expression order, and the user expectations might be affected. Is it at the input_parser.yy where content gets evaluated? If not, then perhaps the content could be obtained there, etc.; and this is why I have remained so determined on this issue. [Regarding reversing of expressions]: I haven't found any authoritative citation that makes reordering expressions containing "<," anything close to a "natural order." (I understand the process and equivalence of the reordered result). I'm not an expert in this field, but most references I have found, have more to do with programming languages, than actual algebraic lexicon. For example, x<4, places the "subject" before the "predicate" which seems more natural to me, than 4>x. However, programming languages might be a little clearer with a constant on the left side, mainly to clarify that nothing is being "assigned" to the constant 4; perhaps, as used in an IF THEN ELSE type of construct. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)