Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another Recursive Descent Parser
#1
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).

What64X2.zip is v1.1a of the parser.
What64X3.zip is v1.2a of the parser.

LOC: 3,640

Code: (Select All)
update v1.1a: 04/08/2025:
   adds custom getCommand$ function.
   modifies true/false constants.
   extends array subscript for A(n) to any value.
update v1.2a: 05/05/2025:
   fixes shell to DOS.


Attached Files
.zip   WHAT64X2.ZIP (Size: 19.56 KB / Downloads: 13)
.zip   WHAT64X3.ZIP (Size: 20.19 KB / Downloads: 4)
Reply




Users browsing this thread: 1 Guest(s)