![]() |
|
Another Recursive Descent Parser - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Utilities (https://qb64phoenix.com/forum/forumdisplay.php?fid=8) +---- Thread: Another Recursive Descent Parser (/showthread.php?tid=3592) |
Another Recursive Descent Parser - eoredson - 04-07-2025 Find attached is a file with Whatis.bas which is a Recursive Descent Parser.. Wat is a recursive descent parser you ask? Well, basically the parser reads tokens in a stream such as: +-*/^ then the descent is from highest precedence to lowest where when the parser detects an opening ( it calls the parser recursively until a closing ) is detected. Therefore a stream such as: 8*(10-1) can be parsed.. This parser I am releasing also parses more tokens such as ++ and -- and others. Erik. Ok, so the parser starts at the > prompt where equations can be entered which also support simple variables like: X=10 and then X+10 could be calculated. Parser also calculates string variables A$ to Z$ and arrays A(n) to Z(n). Additional multi-character variables can be specified as: X0 to X9, and A0(n) to A9(n), and A0$ to A9$. What64X6.zip is v1.4a of the parser. LOC: 3,994 Code: (Select All) update v1.1a: 04/08/2025: |