Welcome!          Run-Time Systems

 

Language Start-RTS+ & Compiler Start-RTS+

ROSPATENT  N 2004610440  on main


Common part


 

   Part presented primary constructions of  language Start-RTS+:

  •    types of data
  •    types of constants
  •    operations with variables and constants
  •    statements
  •    format of comments
  •    separators
  •    in-built functions

    Global variables into language absence.

    Scope of variables limited by function, in which variables defined.

    Global scope have:

  •     names of  functions
  •     names of classes
  •     names of objects
  •     data of objects whereby specificator   id_class . id_object . id_data

  

Types of data

Size(bytes)

Range of values

char

1

  0 - 255

chau

2

  0 - 65535

oint

2

  -32768 - 32767

dint

4

  -2147483648 - 2147483647

qint

8

  -2147483648*4294967296 - 2147483648*4294967296-1

oflt

4

  -3.4Е-38  - 3.4Е+38         7 цифр

dflt

8

  -1.7Е-308 - 1.7Е+308    15 цифр

curr

8

  -9.000.000.000.000,00 - 9.000.000.000.000,00

date

4

  -01/01/9999 - 31/12/9999

time

4

  00:00:00 - 23:59:59

blob

16

  0 - 4294967296 bytes

otbl

16

  table

Types of constants

  Constants this is concrete digital or string values.

decimal  

  Decimal constants defined of two types:

  - integer, consist from digital in range 0-9;

  - float, consist from digital in range 0-9 and point,

    divided integer part of number from decimal part.

hexadecimal

  Hexadecimal integer constants consist from digital in range 0-9 and

  letters in range A-F ( a-f ) and beginning 0X ( 0x ).

literal

  Literal constants is strings of symbols into double quotationmarks. Permit   using of all printing symbols.

Operations

  Operations means for change (compararison )of values variables.

=

  assignment

+

  addition

-

  subtraction

*

  multiply

/

  divide

 %

  remainder

 +=

  assign sum

  -=

  assign difference

 *=

  assign product

 /=

  assign quotient

 %=

  assign remainder ( modulus )

++

  prefix: preincrement; postfix: postincrement

--

  prefix: predecrement; postfix; postdecrement

&

  bitwise AND

|

  bitwise inclusive OR

^

  bitwise XOR ( exclusive OR )

~

  bitwise complement

&=

  assign bitwise AND

|=

  assign bitwise OR

^=

  assign bitwise XOR

&&

  logical AND

||

  logical OR

!

  logical negation

>

  greater than

<

  less than

!=

  not equal to

==

  equal to

<=

  less than or equal to

>=

  greater than or equal to

<<

  shift left

>>

  shift right

<<=

  assign left shift

>>=

  assign right shift

?

  conditional

Statements

  Statements define stream manage of execution code function.

  При отсутствии заданных операторов перехода и выбора, операторы

  выполняются последовательно, в порядке их следования в исходном

  коде функции.  Оператору можно присвоить метку, в которую при

  необходимости  можно передать управление оператором

  безусловного перехода goto.

      metka:

      statement

  Любое выражение, за которым следует точка с запятой ( ; )

  образует  оператор-выражение  expression;

do

  do

      statement

   while ( condition_expr );

   Пока condition_expr не равно 0 будет выполняться statement.

for

   for ( [ initialize_expr ];  [ condition_expr ];  [ iteration_expr ] )

      statement

   Пока condition_expr не равно 0 будет выполняться statement.  

if...else

   if ( condition_expr )

      statement1

   else                              \  optional

      statement2               /

   Если condition_expr не равно 0 будет выполняться statement1,

   в противном случае ничего, или statement2 при наличии else.

while

  while ( condition_expr )

       statement

  Пока condition_expr не равно 0 будет выполняться statement.

switch    

  switch ( expression )

  {

      case value1:  statement1; break;

      ...........

      case valueN:  statementN; break;      |

      ...........                                                      | optional

      default:  statementD                             |

  }

  Позволяет передавать управление одному из нескольких операторов

  с меткой варианта в зависимости от значения ( expression ).

case

  Используется для указания метки варианта в switch

default

  Используется для указания метки варианта по умолчанию в switch

break

  break;

  Используется только в операторах цикла ( do, while, for ) и

  с оператором ( switch ). Он прекращает выполнение оператора.

continue

  continue;

  Используется только в операторах цикла ( do, while, for ).

  Передает управление на проверку условия циклов ( do, while ),

   либо на выражение инкремента цикла ( for ).

goto

  goto metka;

  Передает управление оператору, имеющему указанную метку,

  которая  должна находиться в пределах той же функции.

return

  return;

  return expr;

  Прекращает выполнение функции и выполняет возврат в

  вызвавшую функцию,  возвращая, если задано expr.

include

  include "id_file";

  Подключает файл кода для компиляции.

Комментарии

  Комментарии ограничивают фрагменты текста в коде,

  исключаемые из анализа компилятором.

 // 

  Действует с момента появления до конца текущей строки.

 /*    */

  /* - начало комментария

         текст внутри комментария компилятором не анализируется

  */ - конец комментария

Разделители

Типы разделителей

 blank

  Пробелы, символы горизонтальной  и вертикальной табуляции,

  символы  начала строки ( LF ) и возврата каретки ( CR ).

 [ ]

  Используется при работе с массивами и их элементами.

 (  )

  Используется в выражениях и функциях.

 { }

  Используется в составных операторах.

 .

  Точка используется в константах с плавающей точкой и

  спецификаторах  доступа к данным объектов.

 ,

  Используеся в объявлениях и функциях для разделения параметров.

 :

  Завершает имя метки.

 ;

  Завершает любую языковую конструкцию.

Встроенные функции

  Встроенные функции позволяют работать без обращения к

  функциям библиотек  и не требуют компиляции.

open

  dint fi ( "open", char file, oint flag [, oint mode ] );

  arguments:  file   - name of file ( variable | literal )

                        flag - 0x0000 read only

                                  0x0001 write only

                                  0x0002 read write

                                  0x0010 write in end file

                                  0x0020 create new file

                                  0x0040 truncate exist file

                                  0x0080 not inherid child process

                                  0x0100 text file

                                  0x0200 binary file

                                  0x0400 exclusive open or combination across |

                                               if create new file

                     mode - 0x0100 exec  permit

                                  0x0200 write permit

                                  0x0400 read  permit

                                  0x0700 exec write read permit

  return:   id_file -  file handle for opened file or -1 if error. 

close

  dint  fi ( "close", dint id_file );

  arguments:  id_file - file handle

  return:  0 or -1 if error.

unlink

  dint  fi ( "unlink", char file );

  arguments:  file - name of file ( variable | literal )

  return:  0 or -1 if error.

 tell

  dint  fi ( "tell", dint id_file );

  arguments:  id_file - file handle

  return:  current position from the beginning of the file in bytes.

seek

  dint  fi ( "seek", dint id_file, dint offset, oint mode );

  arguments:  id_file - file handle

                       offset - number bytes from position, indicated by the mode

                       mode - 0 beginning of the file

                                    1 current location

                                    2 end of file

  return:  offset in bytes of the new position from

                the beginning of the file in bytes or -1 if error.

read

  dint fi ( "read", dint id_file, char buffer, dint len );

  arguments:  id_file - file handle

                       buffer - receiver of data

                       len - number of bytes for read

  return:  number of bytes actually read or -1 if error.

write

  dint fi ( "write", dint id_file, char buffer, dint len );

  arguments:  id_file - file handle

                        buffer - source of data

                        len - number of bytes for write

  return:  number of bytes actually write or -1 if error.

lock

  dint fi ( "lock", dint id_file, dint offset, dint len );

  arguments:  id_file - file handle

                       offset - indicated offset from the beginning of the file

                        len - number of bytes for lock

  return:  0 or -1 if error.

unlock

  dint fi ( "unlock", dint id_file, dint offset, dint len );

  arguments:  id_file - file handle

                       offset - indicated offset from the beginning of the file

                        len - number of bytes for lock

  return:  0 or -1 if error.

execw

  dint fi ( "execw", char name );

  arguments:  name - name of exec program and parameter

  return:  0 or -1 if error.

exit

  dint fi ( "exit" );

  arguments:  no

  return:  result of exit.

list

  char fi ( "list", char  string, dint   number );

  arguments:  string    - list of strings

                        number - number of string from list

   return:  string - result string.

getdate

  dint  fi ( "getdate" );

  arguments:  no

  return:  current date from the computer.

gettime

  dint  fi ( "gettime" );

  arguments:  no

  return:  current time from the computer.

outstr

  dint  fi ( "outstr", char buffer, oflt format, value );

  arguments:  buffer  - receiver of value as string

                        format - [-] width.param

                                        -  only for float value

                        width  - width of field output

                        param - for float - number of digits after point

                               01 - output of decimal integer value

                               02 - output of hexadecimal integer value

                               03 - output of string

                               04 - output of time as hh:mm:ss

                               05 - output of date as dd/mm/yy

                         value - variable or constant

  return:  size of buffer or -1 if error.

inpstr

  dint  fi ( "inpstr", char buffer, dint format, value );

  arguments:  buffer - source of value as string

                        format - 0 - input float

                                 1 - input of decimal integer value

                                 2 - input of hexadecimal integer value

                                 3 - input of string

                                 4 - input of time as hh:mm:ss

                                 5 - input of date as dd/mm/yy

                         value - variable or constant

  return:  0 or -1 if error.

strcat

  char fi ( "strcat", char string1, char string2 );

  arguments:  string1 - original string

                        string2 - append string

  return:  string1 - concatent string.

strcmp

  dint  fi ( "strcmp", char string1, char string2 );

  arguments:  string1 - first string

                        string2 - second string

   return:  < 0 - string1 is less than string2

                 = 0 - string1 is equal to string2

                 > 0 - string1 is greater than string2

strcpy

  char  fi ( "strcpy", char string1, char string2 );

  arguments:  string1 - destination string

                       string2 - source string

  return:  string1 - result string.

strcpyn

  char  fi ("strcpyn", char string1, char string2, dint len );

  arguments:  string1 - destination string

                        string2 - source string

                               len - number of copy bytes from string2

  return:  string1 - result string.

strlen

  dint  fi ( "strlen", char string );

  arguments:  string - test string

  return:  len of the string in bytes.

strrev

  char  fi ( "strrev", char string );

  arguments:  string - source string

  return:  result string.

strset

  char  fi ( "strset", char string, dint ch );

  arguments:  string - source string

  return:  result string, fill ch.

strstr

  char  fi ( "strset", char string1, char string2 );

  arguments:  string1 - source string

                        string2 - test string

  return:  0 or result string, beginning with string2 within string1.

acos

  dflt  fi ( "acos", dflt value );

  arguments:  value - variable or constant

  return:  arc cosine.

cos

  dflt  fi ( "cos", dflt value );

  arguments:  value - variable or constant

  return:  cosine.

exp

  dflt  fi ( "exp", dflt value );

  arguments:  value - variable or constant

  return:  exp with base ( e ).

log

  dflt  fi ( "log", dflt value );

  arguments:  value - variable or constant

   return:  natural logarithm of value.

log10

  dflt  fi ( "log10", dflt value );

  arguments:  value - variable or constant

  return:  base-10 logarithm of value.

max

  dflt  fi ( "max", a, b );

  arguments:  a and b - values for compare of arithmetic type

   return:  larger from values.

min

  dflt  fi ( "min", a, b );

  arguments:  a and b - values for compare of arithmetic type

  return:  smaller from values.

sqrt

  dflt  fi ( "sqrt", dflt value );

  arguments:  value - variable or constant

  return:  square root of value.

calc

 dflt  fi ( "calc", char formula );

  arguments:  formula - arithmetic expression

  return:  compute value.


e-mail:rts@rtsrts.com


Copyright (C)RTsRTs 2000-2023