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).

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:
   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.
update v1.3a: 07/25/2025:
   adds multichar variables.
update v1.4a: 12/05/2025:
   adds constant function.


Attached Files
.zip   WHAT64X6.ZIP (Size: 22.34 KB / Downloads: 6)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)