Introduction
Previous Topic  Next Topic 

Now that a couple of “Hello World” applications have been given inorder to provide a feel for the language,  a more formal definition of the language and program structure is given below. 


There are a few things that should be noted before we start:


a)  The language is case sensitive.    This means that and identifier AbC is different to identifier aBc.   Also all language keywords are in lower-case, and use of upper-case characters would result in the compiler reporting a syntax error.


b) The compiler makes no distinction between tabs, space and newline characters.    These white space characters are all equivalent and statements can span multiple lines so long as they conform to the rules of syntax provided (E.g. terminated with a semi-colon).      


The exceptions to the above rule are:  


      i)  Comments only apply until the end of the current line

      ii) Constants strings (stings of characters between double quotes) cannot span across multiple lines.


c)  Similarly multiple statements may be included in a single line, although this is discouraged because it generally makes the source code harder to read.    


d) Identifiers (variable names, constant names and function names) must begin with an alphabetic character (A-Z, a-z) or an underscore character ( _ ).    This may be followed by zero or more alphabetic character  (A-Z, a-z), numbers (0-9) or underscores ( _ ).    Indentifiers may be up to 127 characters long.   


e) The scope of constants and variables is as follows:


        - Variables and constants defined before the main statement are global in scope.

        - Variables defined between the main…endmain statement block or between a func…endfunc block only have scope from the line they are declared on to the following endmain or endfunc statement.

        - Variables defined outside of a func...endfunc statements only have scope from the point from where they are declared to the end of the source file the were declared in.

       

f) Variable of type int are similar to having a var type of length 21.       This provides enough space for a 64 bit integer value and sign to be stored as a null terminated string (i.e 22 bytes are set aside, 21 for the numeric string and sign and one for the null terminator).    Note however that in the current version of the TE all integer arithmetic is signed 32 bit.