Appendix b - script language, Script language, Grammar – Multi-Tech Systems MTASR1-100 User Manual
Page 200: Script language grammar

MTASR1-100 Owner’s Manual
200
Appendix B - Script Language
The script file can be used to antomate certain operation. The script file is a text file containing a sequence of
commands. The structure of a script file in succinctly expressed by the following grammar.
Script Language Grammar
=
={
=INTEGER I STRING
=
=IF
ELSE
ENDIF
IDOWNTO
ENDFOR
=WHILE
ENDWHILE
CASE
CASE
DEFAULT
ENDSWITCH
GOTO
{
OPERATOR
= < I <= I > I >= I == I != I && I II I + I - I * I / I !
=PROC
{ :
FORWARD ;
=PROC
/ :
ENDPROC
Execution starts at the PROC main. PROC main cannot have any arguments. All the variables have to be
declared before use. All procedures must be declared before calling. Recursion is allowed in procedures.
To define mutually recursive procedures, use the FORWARD directive to indicate that the procedure body is
defined later in the source file. Procedures defined with the FORWARD directive should have all the
parameters and return value (if any) specified, the actual definition of the procedure body should not contain
the formal parameter list or the return value. An example of forward defined procedures is given below:
proc a(integer x,y) : integer,forward:
proc b(integer u,v) : integer,forward: