Multi-Tech Systems MTASR1-100 manual Appendix B Script Language, Script Language Grammar

Page 58

RouteFinder MTASR1-100 User Guide

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

58

MTASR1-100

Image 58
Contents User Guide Revision Description User GuideRecord of Revisions PatentsContents Glossary of Terms Index Introduction and Description Introduction Preview of this GuideRelated Documentation Remote Configuration and ManagementService, Warranty and Tech Support Introduction and DescriptionFront Panel WAN LinkBack Panel Shunts Shunt PositionsEthernet Port SpecificationsCommand Port WAN LinkMTASR1-100 Installation Unpacking UnpackingInstallation Changing Shunt PositionCabling your RouteFinder Back Panel ConnectionsSoftware Loading and Configuration Loading your Software Software Loading and Configuration Do you want to download default setup? dialog is displayedNovell IPX Protocol Default Setup dialog box is displayed Software Loading and Configuration RouteFinder MTASR1-100 User Guide Setting Up Your Remote User Database Call Back Delay User PasswordCall Back Security Enabled Call BackRouteFinder Software Download Default Setup Before You BeginUninstall Configuration Port SetupWAN Device Configuration Download FirmwareRouter Configuration IP Port SetupRouteFinder Software MTASR1-100 Open Shortest Path First Ospf IPX Setup RouteFinder Software Spanning Tree Setup WAN Port Setup Point-to-Point Setup Frame Relay Setup Frame Relay Dlci Applications Setup DiagnosticsScripting Remote Configuration and Management Modem-Based Remote Configuration Procedure Remote Configuration and Management LAN-Based Remote Configuration Windows Sockets Compliant TCP/IP StackRemote Configuration and Management Remote Management TelnetRouter Management WEB Browser Management Service, Warranty and Tech Support Limited Warranty On-line Warranty RegistrationTech Support Service, Warranty and Tech SupportRecording RouteFinder Information Service To Download a file Multi-Tech BBSTo log on to the Multi-Tech BBS If you know the file nameAbout the Multi-Tech Fax-Back Service About the InternetAppendixes LAN Cables 10BASE-T RJ-45 10BASE 2 BNCRS232C/V.24 * Link Cable WAN CablesAppendixes Link CableAppendix B Script Language Script Language GrammarThere are two types of iterative constructs Two basic types of variables are supportedThere are two types of conditional constructs Operator PrecedenceExample Script FCC Part EMC and Safety Directive ComplianceAppendix C Regulatory Information Class a Statement Industry CanadaAppendix D TCP/IP TCP/IPAppendixes Internet Protocol IP Glossary of Terms MTASR1-100 Glossary MTASR1-100 Glossary MTASR1-100 Glossary MTASR1-100 Glossary MTASR1-100 Glossary Subscriber Loop See Local loop Glossary MTASR1-100 Index IndexSoftware