Appendix B - Script Language - Multitech RASFinder RF300E User Manual

Remote access server with v.90 modems or hybrid isdn ports
Table of Contents

Advertisement

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
<program>
<declarations>
<var_type>
<statement_list>
<statement>
<if_statement>
<for_statement>
<while_statement>
<switch_statement>
<elementary_statement>
<expression>
OPERATOR
<proc_declaration>
<proc_declaration>
<parameter_list>
<argument_list>
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:
proc a;
integer t;
/*Some more code here. */
t=b(x,y);
/*Some more code here. */
return(t);
endproc
proc b;
return(a(u,v);
endproc
RF300E/RF310E
=<declarations> <proc_declarations>
={<var_type> <identifier> {, <identifier> } ; }
=INTEGER I STRING
={<statement>}
=<elementary_statement> I <if_statement> I<for_statement> I
<while_statement> I <switch_statement>
=IF <expression> THEN <statement_list> {ELSE<statement_list> } ENDIF
=FOR <identifier>=<expression> TO IDOWNTO <expression} STEP
<expression> / DO <statement_list> ENDFOR
=WHILE <expression> DO <statement_list> ENDWHILE
=SWITCH <expression> {CASE <integer_const> <statement_list> I
CASE <string_const> <statement_list> I
DEFAULT <statement_list> }
ENDSWITCH
=<identifier> = <expression> ; I <identifier> / (<expression>
{,<expression> } ) /; I GOTO <identifier> ; I <identifier> : I ;
=<expression> OPERATOR <expression> I {<expression> } I /<expression>I
- <expression> I<identifier> / (<expression> {, <expression> } ) /
= < I <= I > I >= I == I != I && I II I + I - I * I / I !
=PROC <identifier>/(<parameter_list>)} { :<vartype> };FORWARD ;
=PROC <identifier>/(<parameter_list>)} / : <vartype> / ;
<declarations> <statement_list>ENDPROC
=<argument_list> { ; <argument_list>}
={VAR} <var_type> <identifier> {<identifier>}
Appendix B - Scripting
115

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rasfinder rf310e

Table of Contents