Home

|

TYRO - Language

|

Flowcharts

|

Screen Shots

|

 Downloads

|

About Us

 

             

TYRO language's syntax is one of a kind.

The basic format and basic syntaxes in explained below.

BASIC SYNTAX

Any valid program of Tyro should start with a begin statement and it ends with end statement.

begin
       ....................
       ...................
       ...................
       ...................
end

INPUT AND OUTPUT COMMANDS

Show

Syntax
Show <expN> [{, expN}]

Expressions (expN) can either a variable or a constant or any valid arithmetic or concatenation operation.

Accept

Syntax
Accept <variable name> [{, <variable name>}]

VARIABLE TYPES

Every variable should start with a specified character.

• NUMERICAL

   Range: -32,768 to +32,768
Should start with “N”

• CHARACTER

    Range: No limit
Should start with “C”

• REAL
 
  Range: -32,768 to +32,768 with ‘n’ decimal places
Should start with “R”

All the variables which are used in the program should be declared using “var” statement. The name of the variables should not exceed 10 characters including the special character mentioned above.

CONSTANTS

Any valid number or string value. String value should be enclosed within double codes. The value of the variables should not exceed 50 characters.


OPERATORS

Arithmetic
• + - Addition
• - - Subtraction (Also can be used as unary -)
• * - Multiplication
• / - Division
• = - Assignment

Conditional
• .eq. - Equal to
• .gt. - Greater than
• .lt. - Less than
• .ge. - Greater than or equal to
• .le. - Less than or equal to

Logical
• .not. - Not
• .and. - And
• .or. - Or
 

CONTROL STRUCTURES

Conditional Structures

• IF CONSTRUCT

Syntax

If (<condition>)
  ...
  ...
else
 ...
 ...
iend

The if construct is one of the most important construct of many languages, TYRO included. It allows for conditional execution of code fragments. TYRO features an if structure that is similar to that of BASIC and C. The IF keyword in TYRO should be followed by a logical condition, which when becomes true continues execution and when false transfers the control to the else statement.

As of for the latest version, TYRO supports only numerical logical expressions.

• FOR CONSTRUCT

Syntax
For <variable name> = <initial value>..<final value> [step <value>]
……
……
Fend

For looping is one of the primitive looping constructs around. The index variable name of a for looping should be accompanied by the initial value and the final value, separate by two dots(..). The step key word is optional which specifies the incrementing quantity. The step value can only be an integer


• WHILE CONSTRUCT

Syntax
While (<condition>)
……
……
Wend

While loops are the simplest type of loop in TYRO. While looping is similar to for looping with the only difference being, the variable should be incremented or decremented manually by the user. The while keyword is followed by a logical condition.

FUNCTIONS

The function name should start with the letter “F”. The length of the function name should not exceed 10 characters.

Declaration
Function <function name> [<parameter>]


Definition
Function <function name> [<formal parameters>]
...
...
hang

Calling

Ring <function name> [<parameters>]

Returning the Value

Reply <return value>

Each function in a tyro program should be declared initially. The function is called using the keyword ‘Ring’, with parameters if any. The function is defined outside the main scope (begin…end) with the same way as it is declared. Its scope is terminated using the ‘Hang’ keyword. To return a value from a function ‘Reply <value>’ should be used.


BUILTIN FUNCTIONS

TYRO has very rich library of inbuilt functions. They are automatically included in the programs while compiling and executing. Every inbuilt function starts with a letter ‘T’. The inbuilt functions of TYRO can be classified into

• Arithmetic Functions
• Conversion Functions
• String Functions
• Trigonometrical Functions

For information about the functions look at the manual.

 

 

© Copyrighted under GNU/GPL license

 

 

 Project Hosted in

SourceForge.net Logo

Site best viewed in any browser @ 800 X 600 resolution