BNF For Tool Interface Files in GS Soft BASIC The complete BNF for tool interface files is shown below. The individual statements are listed in alphabetical order. The grammar starts at tool-interface. Comments start with the semicolon character and extend to the end of the physical line. The semicolon was used instead of the exclamation point because the exclamation point is also used as the type character for SINGLE values. array-subscript ::= ‘(‘ integer ‘)’ as-type ::= [ POINTER TO ] type-name const-declaration ::= CONST identifier ‘=’ [ ‘-’ ] integer decimal-integer ::= [ ‘0’..’9’ ]+ field-declaration ::= identifier [ array-subscript ] AS as-type gsos-declaration ::= GSOS tool-number sub-or-function hexadecimal-integer ::= ‘$’ [ ‘A’..’F’ | ‘a’..’f’ | ‘0’..’9’ ]+ identifier ::= letter [ letter | ‘0’..’9’ ]* integer ::= hexadecimal-integer | decimal-integer letter ::= ‘a’..’z’ | ‘A’..’Z’ | ‘_’ record_type ::= TYPE identifier [ record-variant | field-declaration ]* END TYPE parameter ::= ‘(’ as-type ‘)’ | as-type parameter-list ::= ‘(‘ parameter [ ‘.’ parameter ]* ‘)’ record-variant ::= CASE ( identifier | integer ) simple-type ::= TYPE identifier [ array-subscript ] AS as-type sub-or-function ::= SUB identifier parameter-list | FUNCTION identifier parameter-list AS as-type tool-declaration ::= TOOL tool-number sub-or-function tool-interface ::= [ type-declaration | const-declaration | tool-declaration | usertool-declaration | gsos-declaration ]* tool-number ::= integer ‘.’ integer type-character ::= ‘~’ | ‘%’ | ‘&’ | ‘!’ | ‘#’ | ‘$’ | ‘?’ type-declaration ::= simple-type | record-type type-name ::= BYTE | INTEGER | LONG | SINGLE | DOUBLE | STRING | UNIV | identifier | type-character usertool-declaration ::= USERTOOL tool-number sub-or-function