INCLAN: syntax: Difference between revisions

From CYANA Wiki
Jump to navigation Jump to search
Line 30: Line 30:
''name''; parameters following "*" or "**" must always be given with their
''name''; parameters following "*" or "**" must always be given with their
name.
name.
A ''type'' can be one of the following:
A ''type'' can be one of the following:


  *                            anything
;*: anything
  [''limit''''[=]]@i[''[=]''limit''] integer expression in given range
;[''limit''''[=]]@i[''[=]''limit'']: integer expression in given range
  [''limit''''[=]]@r[''[=]''limit''] real expression in given range
;[''limit''''[=]]@r[''[=]''limit'']: real expression in given range
  ''name''{|''name''}               list of mutually exclusive literals
;''name''{|''name''}: list of mutually exclusive literals
  @f''extension''                 a filename that will be extended with
;@f''extension'': a filename that will be extended with the given ''extension'', if necessary (extension can also be $''name'' to denote the value of a preceding parameter)
                                the given ''extension'', if necessary
                                (extension can also be $''name'' to  
                                denote the value of a preceding  
                                parameter)

Revision as of 10:44, 30 January 2009

Synopsis

syntax {format}

Description

The statement "syntax" analyzes the command line parameters of the current macro. This statement can only be called within a macro. Command line parameters that match with one of the format specifi- cations are removed from the list of command line parameters and assigned to a new local variable.

Possible format items are:

name=[=]type[=default]
named parameter with the given name, type, and, optionally, default
name{|name}
literal option with the name, or one out of a mutually exclusive list of names
**
allows for additional parameters that do not match with one of the formats
*
same as "**" except that additional parameters must not contain an "=" sign

A format must not contain blanks. A name may contain a "*" to indicate how much it can be abbreviated. By default, all unambiguous abbreviations are allowed. The optional second "=" sign after a name indicates that a parameter that matches name but doesnt contain an "=" sign is not recognized, otherwise (with one "=" sign after name, an error occurs in this situation). Parameters that appear before "*" or "**" can be specified as positional parameters without giving their name; parameters following "*" or "**" must always be given with their name.

A type can be one of the following:

*
anything
[limit'[=]]@i[[=]limit]: integer expression in given range
[limit'[=]]@r[[=]limit]: real expression in given range
name{|name}
list of mutually exclusive literals
@fextension
a filename that will be extended with the given extension, if necessary (extension can also be $name to denote the value of a preceding parameter)