Parsec Installation

version 1.7.0


The .zip should include: First, extract all of the files in the zip to the directory that you want to store Parsec in.

Now right-click Parsec and select Properties. Then click the Program tab. You should see where to enter a CMD line and Working path. Windows should already have Parsec's path as the CMD line, but you will need to manually enter Parsec's directory for the Working directory. Without the Working dir, Parsec will not be able to find its data file.

The preferred way to open cogscripts with Parsec is to add a link to Parsec in the right-click menu of .cog files. But you can use any method that sends the DOS path of the cog to Parsec on the command line. General instructions for all Windows operating systems are given below.

Go to the Control Panel and open Folder Options. In the dialogue box that appears, select the File Types tab. Find the file type for .cog files. If it's not there, create it. In whatever way is provided, view the Advanced settings for the file type. You should see a box listing the actions that can be performed on cog files (such as open).

Create a new action called Parsec and give the path for the Parsec exe in the text box for the Application's path. Directly after Parsec's path, add %1 - without quotation marks (Windows may add the %1 automatically when you accept the settings). That's all you have to enter for the action settings. Now, when you right click on a cogscript file, you should see a link to Parsec in the menu.

All right, Parsec should now be configured. Enjoy using it. If you find an error with Parsec or something that needs to be improved, email me. Feedback is appreciated.

- SaberMaster.


What's New

Parsec 1.7.0
Parsec 1.7.0 has an updated data file with new parameter information from version 0.5.0 of the DataMaster. This new version of Parsec also has many minor parsing and error-reporting improvements over previous versions as well as support for the complete for loop syntax:
for([statement1[, statement1]]; [condition]; statement2[, statement2]) // optional code

This version will likely be the final release of Parsec. Almost all of its bugs have been fixed, but aside from that, I want to rewrite the parser. Parsec was originally written with no model and then I had no experience with writing text parsers. But now that Parsec has matured, I will rewrite it in a more advanced language.

Parsec 1.6
Two new options, strict_parse and sim_array_names, have been added. strict_parse tells Parsec whether or not to allow statements to span multiple lines. sim_array_names tells Parsec that you intend to use similar array names - such as red0 and red1. Knowing this, Parsec can search for unused variables. If you don't use similar array names and arrays are used in your cog, then Parsec will not check for unused variables.

Parsec now recognizes which variables have been assigned, and which variables have been used in the code section. If a variable was assigned but not used, if it was used but never assigned, or if it was not used at all, Parsec will give an appropriate error message explaining the problem.

Parsec 1.5
Earlier versions of Parsec needed to load an entire cogscript into memory to parse it. In version 1.5, Parsec reads one line at a time from the cog file, parses it, and then reads the next line. Before 1.5, Parsec could only load a cog less than 700 lines or it would run out of string memory. Parsec 1.5 has no size limitations. Version 1.5 also features various minor improvements.
Parsec 1.3
In Version 1.3, Parsec is allocated more stack memory. Earlier versions would be limited to less complex code block structures because of this shortage of stack space. Also, Parsec 1.3 includes an updated data file.

Parsec Settings

The data.dat file that Parsec uses contains all of the data that Parsec needs to parse a cogscript. The first data category in this file, settings:, is the important one for the user. Open the file and read the comments to understand how to use the settings.

The Source Code

Parsec was written with QuickBasic 7.1 - AKA PDS Basic and QuickBasic Extended. Parsec's source code is included in the .zip should anyone want to see how Parsec works or even update it. Suggestions are welcome.