
RouteFinder-T1 User Guide
MTASR2-203
62
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> <proc_declarations>
<declarations>
={<var_type> <identifier> {, <identifier> } ; }
<var_type>
=INTEGER I STRING
<statement_list>
={<statement>}
<statement>
=<elementary_statement> I <if_statement> I<for_statement> I
<while_statement> I <switch_statement>
<if_statement>
=IF <expression> THEN <statement_list> {ELSE<statement_list> } ENDIF
<for_statement>
=FOR <identifier>=<expression> TO IDOWNTO <expression} STEP
<expression> / DO <statement_list> ENDFOR
<while_statement>
=WHILE <expression> DO <statement_list> ENDWHILE
<switch_statement>
=SWITCH <expression> {CASE <integer_const> <statement_list> I
CASE <string_const> <statement_list> I
DEFAULT <statement_list> }
ENDSWITCH
<elementary_statement>
=<identifier> = <expression> ; I <identifier> / (<expression>
{,<expression> } ) /; I GOTO <identifier> ; I <identifier> : I ;
<expression>
=<expression> OPERATOR <expression> I {<expression> } I /<expression>I
- <expression> I<identifier> / (<expression> {, <expression> } ) /
OPERATOR
= < I <= I > I >= I == I != I && I II I + I - I * I / I !
<proc_declaration>
=PROC <identifier>/(<parameter_list>)} { :<vartype> };FORWARD ;
<proc_declaration>
=PROC <identifier>/(<parameter_list>)} / : <vartype> / ;
<declarations> <statement_list>ENDPROC
<parameter_list>
=<argument_list> { ; <argument_list>}
<argument_list>={VAR} <var_type> <identifier> {<identifier>}
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
Argument to procedures can be passed by value or address. To pass an argument by address, prefix
Summary of Contents for RouteFinder MTASR2-203
Page 5: ...Multi Protocol Router with T1 DSU Chapter 1 Introduction and Description...
Page 12: ...RouteFinder T1 User Guide MTASR2 203 12...
Page 13: ...Multi Protocol Router with T1 DSU Chapter 2 Installation...
Page 16: ...RouteFinder T1 User Guide MTASR2 203 16...
Page 17: ...Multi Protocol Router with T1 DSU Chapter 3 Software Loading and Configuration...
Page 25: ...Multi Protocol Router with T1 DSU Chapter 4 RouteFinder Software...
Page 43: ...Multi Protocol Router with T1 DSU Chapter 5 Remote Configuration and Management...
Page 52: ...RouteFinder T1 User Guide MTASR2 203 52...
Page 53: ...Multi Protocol Router with T1 DSU Chapter 6 Service Warranty and Tech Support...
Page 59: ...Multi Protocol Router with T1 DSU Appendixes...
Page 74: ...RouteFinder T1 User Guide MTASR2 203 74...
Page 75: ...Multi Protocol Router with T1 DSU Glossary of Terms...