syntax_en.txt 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. The language syntax consists of the following commands:
  2. setchar c - sets the value in the current cell to c
  3. walk n - go to n cells
  4. change v - change the value in the current cell to v (integer)
  5. mov n - move the value of the current cell to n cells
  6. copy n t - copy the value of the current cell to the cell located n cells from the current
  7. using a buffer located across t cells from the current
  8. print n - print cell values ​​from the current to the next through n cells
  9. split v - split string v into characters and distribute them in the following cells
  10. alias name value - create an alias with the name 'name' and the value 'value'
  11. $name - get the value from the alias name
  12. pointer name n - create a pointer to cell n
  13. &name = c - set the value of the cell at address name to 'c'
  14. &name clear - clear cell at address name
  15. &name add v - increase the value in the cell at the address name by v
  16. &name sub v - decrease the value in the cell at the address name by v
  17. array name n l - create a pointer to cells from n to n + l
  18. @name n = c - set the value of the cell at the address name[n] to 'c'
  19. @name n clear - clear cell at name[n]
  20. @name n add v - increase the value in the cell at the address name[n] by v
  21. @name n sub v - decrease the value in the cell at the address name[n] by v
  22. putchar - output a character from the current cell
  23. read - read one character from standard input
  24. reads n - read characters from standard input and distribute them in cells from the current to the next through n cells
  25. sum * a * b * c - add the values of cells a and b, and add the result to cell c (in theory, you can use this
  26. function in the form of sum * a * b * a, but I'm not sure if this will work)
  27. sub * a * b * c - similar to sum, but here subtraction
  28. * a - access to the pointer
  29. # - comment
  30. A program consists of calls to certain commands with their arguments. Between them should be separators:
  31. '(', ')', ',', ' ', and ';'. They can be used to improve code readability.
  32. For example:
  33. split "Hello world!\n";
  34. equals to
  35. split("Hello world!\n")
  36. Please note that there are no name conflicts between pointers and aliases, as they
  37. stored differently
  38. eg:
  39. alias hw "Hello, World!"; # Create hw alias
  40. pointer hw 1; # Create hw pointer
  41. split $ hw; # Split the string stored in PSEUDONYM hw
  42. & hw = c; # Set the value of 'c' to the cell BY ADDRESS hw