The Regnus Parser For QB4.5
About
The Regnus Parser for QB4.5 is a set of functions to allow you to generate text from Regnus scripts from within applications written in QB4.5.
To discuss this parser, or to make feature requests or bug reports, please visit its forum.
Note: the Regnus Parser for QB4.5 expects scripts to be encoded for the legacy CP437 code page, and does not currently support UTF-8 character sets, so scripts including extended unicode characters may not display correctly in this parser.
Information & Download
- Parser Version
- v1.3.2
- Regnus Specification
- v5.5
- Download
Using The Regnus Parser For QB4.5
To use the Regnus Parser For QB4.5 in your programs, you will need to first download and unzip the source file which contains the functions.
You can include the functions in your project by copying and pasting from the source file, or using the File | Merge command.
Once your project contains all of the Regnus functions, producing text from a Regnus script is very simple. The main parser is the function RegnusGenerate, which returns a string containing the generated text. For example, to generate text from a Regnus script and store it in YourString$:
YourString$ = RegnusGenerate(YourScript, YourLabel, Information)
YourScript should be the full relative path and file name of the script from which you would like to generate text, and YourLabel should be the label from which you would like to generate text. For example, to generate text from the "RANDOM PICK" label of the script Something Completely Different, in the working directory of the program:
YourString$ = RegnusGenerate("Someth~1.rsf", "RANDOM PICK", "")
Note: as in the example, remember that DOS filenames should generally be abbreviated using the above format if they exceed eight characters in length!
The optional Information argument causes the parser to instead output meta-information about the script, such as the script's Title or Blurb. For example, to get the script's Title:
YourString$ = RegnusGenerate("", "", "title")
And to return the script's blurb, of course:
YourString$ = RegnusGenerate("", "", "blurb")
Version History
v1.3.2
- Removed redundant code to improved parser efficiency.
- Improved behaviour of automatic pluralisation function.
v1.3.1
- Fixed bug causing aliases not to function correctly.
v1.3.0
- Fixed bugs causing labels in "RATIO" and "COUNT" entries not to function correctly.
- Improved and corrected several bodies of code relating to labels.
- Implemented support for the Regnus 5.5 "START" qualifier.
- Implemented support for Regnus 5.5 fractional ratios.
- Implemented support for Regnus 5.5 dice notation.
- Improved and corrected code for detail and accuracy of error reporting during script parsing.
- Implemented support for Rgenus 5.5 inline entry selection.
- Improved code for accuracy and efficiency.
- Fixed bug causing "COUNT" qualifier not to work correctly.
v1.2.5
- Fixed bug causing numeric values not to be parsed correctly for nested references.
v1.2.4
- Fixed bug causing pluralisation not to work correctly when combined with capitalisation.
- Minor code tidying.
v1.2.3
- Fixed two bugs causing errors due to erroneous case-sensitivity when using REFER and COUNT qualifiers.
v1.2.2
- Added workaround for unexpected QB4.5 behaviour in order to fix serious bug affecting groups with names beginning with certain letters.
v1.2.1
- Parser now correctly returns an empty result when seeking an alias for an empty expression.
- Fixed bug causing missing characters when using auto-pluralisation function.
- Parser now gives priority to longer phrases when using MULTI qualifiers, in order to generate more intuitive output.
v1.2.0
- Updated parser for compliancy with Regnus specification 5.4.
- Nested hidden text brackets now function correctly.
- Multiple MULTI qualifiers no longer erroneously cause multiple plurals to be returned.
v1.1.0
- Parser updated to support Regnus specification 5.3.
- Parser now reports correct error upon encountering invalid characters within references.
v1.0.0
- First release.