Parameters

Overview

The Parameters Block can be used to embed different fields about the grammar into the skeleton program. All the "Parameters" that are stored in the Compiled Grammar Table file, are assessable. The block also contains a number of variables about the generated file. Unlike the other blocks, this block is not a loop.

This block was added in Version 2.5 of the Builder.

Structure

##PARAMETERS
...
##END-PARAMETERS

Variables

Grammar Parameters

Name Description
%About% This variable contains the content of the "About" parameter. This is a general-purpose field the designer can use to specify some notes about the grammar.
%About.XML% This variable contains the XML encoding of %About%.
%Author% This variable contains the author of the programming language and/or grammar.
%Author.XML% This variable contains the XML encoding of %Author%.
%CaseSensitive% This variable contains either True or False - depending on whether the grammar is case sensitive. The field is merely informative and has no effect on the grammar.
%Name% This variable contains the name of the grammar.
%Name.XML% This variable contains the XML encoding of %Name%.
%StartSymbol% The variable contains index of the grammar's start symbol.
%Version% This field contains the version of the grammar. Note that this field is a string, not an integer.
%Version.XML% This variable contains the XML encoding of %Version%.

Generated File Information

Name Description
%OutputFile% The value of the %Output-File% variable contains the name of the generated file. The value also contains the file's extension.
%OutputFileBase% This variable contains the name of the generated file without the extension.
%OutputFilePath% This variable contains the both name and path of the generated file.
%OutputPath% This variable contains the folder of the generated file.

Example

The following displays a template that will output the parameter and file information for the grammar.

##PARAMETERS
Name            : %Name%
Version         : %Version%
Author          : %Author%
About           : %About%
Case Sensitive  : %CaseSensitive%
Start Symbol    : %StartSymbol%

Output File Path : %OutputFilePath%
Output Path      : %OutputPath%
Output File      : %OutputFile%
Output File Base : %OutputFileBase%
##END-PARAMETERS

 

If the "Simple" example grammar is used, the program template will create the following text:

Name           : Simple
Version        : 2.1
Author         : Devin Cook
About          : This is a very simple grammar designed for use in examples
Case Sensitive : False
Start Symbol   : 37

Output File Path : C:\Grammars\Simple.txt
Output Path      : C:\Grammars\
Output File      : Simple.txt
Output File Base : Simple