Appendix b - script language, Script language grammar – Multi-Tech Systems MTASR3-200 User Manual
Page 55

Appendices
MTASR3-200
55
Appendix B - Script Language
The script file can be used to automate certain operations. The script file is a text file containing a
sequence of commands. The structure of a script file is succinctly expressed by the following
grammar.
Script Language Grammar
=
={
=INTEGER I STRING
={
=
=IF
=FOR =WHILE =SWITCH CASE = {, = - OPERATOR = < I <= I > I >= I == I != I && I II I + I - I * I / I ! =PROC =PROC = ={VAR} Execution starts at the PROC main. PROC main cannot have any arguments. All the variables have To define mutually recursive procedures, use the FORWARD directive to indicate that the procedure proc a(integer x,y) : integer,forward: integer t; t=b(x,y); endproc proc b; return(a(u,v); endproc
DEFAULT
ENDSWITCH
to be declared before use. All procedures must be declared before calling. Recursion is allowed in
procedures.
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 b(integer u,v) : integer,forward:
proc a;
/*Some more code here. */
/*Some more code here. */
return(t);