According to Orlando Llanes:
What I'm working on learning now is breaking down an Algabraic
Equation (did I get the right term?) and arranging it so that it's in an order ready to be translated into the byte codes. I think this step is called converting Postfix to Infix. I saw some code in Pascal that parses an equation and translates it by using loops and arrays rather than recursing. What it does is juggle variable names, I don't know how capable it is for processing real numbers or others. It only handles * / + and - but it can be modified to handle Boolean operations, etc. I got the code out of the Pascal SWAG. I'll upload the code where Peter moved Hans' upload.
Now the trouble begins: Is this program another candidate for that archive of tools? While it compiled straightforwardly with GPC, it is less general than a Pascal `lex' or `yacc', and it is in the SWAG.
What are the licensing conditions of that Program?
Peter -- Peter Gerwinski, Essen, Germany, free physicist and programmer Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - 1 Oct 1997 PGP key fingerprint: AC 6C 94 45 BE 28 A4 96 0E CC E9 12 47 25 82 75 Fight the SPAM! - http://maps.vix.com/
Now the trouble begins: Is this program another candidate for that archive of tools? While it compiled straightforwardly with GPC, it is less general than a Pascal `lex' or `yacc', and it is in the SWAG.
The main reason I posted it was so that everybody sees the technique. I don't have much experience with parsing expressions, but I believe the technique normally used is a Recursive Descent Parser? The author put a writeln to demonstrate how it works, but translating the numbers into their binary format is left to the programmer. I found it useful to include in the script engine, but I thought it also might be useful to someone writing a (for example) calculator.
What are the licensing conditions of that Program?
I was going to say that it's ok to assume that the author will allow commercial use of the routine, but I checked the SWAG's policy.txt just to be sure, and it says that the source provided in the SWAG cannot be used for commercial purposes without permission from the author. I'll see if I could track him down and ask him (I too adhere to the philosophy of "Better to be safe than sued" =B). Now that I think about it, there are a lot of them that post their code as copyrighted freeware, the ones that don't want it distributed commercially normally specify so at the top of their source.
See ya! Orlando Llanes
"Hey, we all did the drug thing, we all did the money thing, and eventually you find out that none of that stuff fixes anything, and we have nowhere else to go except to evolve spiritually and intellectually" -- Meredith Brooks
"Look out fo' flyeeng feet" O__/ a010111t@bc.seflin.org /|____. O <__. /> / \ ____________|_________ http://ourworld.compuserve.com/homepages/Monkey414