HELP.TXT 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. === PROGRAMMING IN RIGAL ===
  2. Short guide
  3. by Vadim Engelson
  4. Last revision 29-May-92
  5. 1. RIGAL LEXIC
  6. ===============
  7. LETTER is [A..Z,a..z,_,{,},`,|,~,Chr(128)..Chr(255)]
  8. SYMBOL is LETTER or [0..9]
  9. Variables are $ SYMBOLS, Rules are # SYMBOLS
  10. Identifiers are LETTER SYMBOLS
  11. Numbers are from 0 to 2**31-1
  12. Comments - after -- in string
  13. Character strings are ' ANY_CHARACTERS '
  14. To use single quote - write twice : ''
  15. Including files - (no inside #rule text)
  16. %INCLUDE filename with extension
  17. (no anything more till the end of this line)
  18. (!) ALL RIGAL KEYWORDS MUST BE WRITTEN IN UPPERCASE (CAPITAL
  19. LETTERS)
  20. (load - wrong , LOAD - right)
  21. (!) Rules, identifiers, variables in UPPERCASE & LOWERCASE
  22. are different
  23. ( $SOMETHING <> $something )
  24. and using here Chr(128)-Chr(255) not recommeded
  25. 2. LEXIC OF BUILT-IN SCANNER
  26. =============================
  27. We have built-in scanner to read text file and transform
  28. it to the list of atoms.
  29. Using:
  30. $E:=#CALL_PAS(35 'filename');
  31. (35 is built-in function number)
  32. "SYMBOL" "LETTER" - same as in Rigal lexic.
  33. Identifiers are LETTER SYMBOLS
  34. but { and } are not allowed !
  35. Numbers are from 0 to 2147483647 ( 2**31-1 )
  36. $0 to $7FFFffff
  37. #0 to #2147483647
  38. Comments are (* *) or { }
  39. One-character elements include # & ! ? ^ @
  40. Character strings are ' ANY_CHARACTERS '
  41. To use single quote - write twice : ''
  42. (!) ALL KEYWORDS may be WRITTEN IN any case ,but
  43. they are capitalized automatically.
  44. 3.OTHER SUBROUTINES
  45. ===================
  46. The scanners and special subroutines are called in the form
  47. #CALL_PAS ( <number> <parameters ...> )
  48. 1. If the first parameter is given, the option writes it on
  49. the screen. The option waits for the user's answer (Pascal
  50. READLN(STRING) executes). When the user presses ENTER key, the
  51. option returns the atom containing the string.
  52. $E:=#CALL_PAS(1 'Enter Y or N ');
  53. IF $E ->
  54. IF ($E=Y)OR($E=y)-> $REZ:=T;BREAK;FI;
  55. IF ($E=N)OR($E=n)-> $REZ:=NULL;BREAK;FI;
  56. FI;
  57. 12. Parameter is any object. Object is printed out to the
  58. PRINT file using pseudo graphic characters of extended ASCII
  59. code.
  60. Tree List
  61. ÄÄÄÂÄname:: ÄÄÄÄÒÄname::
  62. ÃÄarc1-el1 ÇÄel1
  63. ÀÄarc2-el2 ÓÄel2
  64. 13. Parameter is any object. Object is printed out to the
  65. screen using pseudo graphic characters of extended ASCII code.
  66. 16. Parameter must be existing file name. All the lines of
  67. the file are read and appended to the list of atoms (one atom
  68. corresponds to one line).
  69. 35. The first parameter must be file name. The atoms are read
  70. from file.