tripl.1 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. .TH TRIPL 1 "26 Dec 21"
  2. .SH NAME
  3. tripl \- the interpreter of the tripl programming language.
  4. .SH SYNOPSIS
  5. \fBtripl\fP [ FILE ]
  6. .SH DESCRIPTION
  7. \fBtripl\fP is a programming language that uses different
  8. characters to do different things. You can use tripl to calculate
  9. the sum of two numbers, print out messages and other things interesting.
  10. .SH LICENSE
  11. \fBtripl\fP is distrubuted under the GNU General Public License. See the
  12. \fBLICENSE\fP file in the source directory of tripl. Of course, you need
  13. to download that from https://gitee.com/pengruiyang-cpu/tripl.git before
  14. that.
  15. .SH SYNTAX
  16. \fBvariable define\fP: \fB$\fP uses to push a number into stack. now we also support global variables.
  17. eg. \fB$ name 1048576;\fP
  18. \fB$ name = +1048576;\fP
  19. \fB$ name = -1048576;\fP
  20. # or just leave blank. default value is 0
  21. \fB$ name;$\fP;
  22. \fB$ name 1048576 @ rdonly global;\fP
  23. usable variable attributes: global rdonly ptr
  24. \fB#\fP: line comment
  25. \fBname setting\fP: there are two ways to set names. one is C-style and one is math-style.
  26. eg. \fBa = 0;\fP
  27. \fB0 -> a;\fP
  28. \fB-0 -> b;\fP
  29. \fB-1000 -> c;\fP
  30. \fBname setting with math expressions\fP: you can use math expressions but there are some problems. you cannot
  31. use things like this \fBa = b = $ 1 + 1;\fP because we the value of a is the returning value of the arch_math_expr.
  32. on interpreter both a and b are 2 but on machines, a = 0 b = 2.
  33. eg. \fBa = $ 1 + 1;\fP
  34. \fBa = $ 1 - 1;\fP
  35. \fB!\fP: dump. This dumps things you want, e.g. functions, names, libraries
  36. \fBTHIS ONLY WORKS IN INTERPRETER MODE\fP
  37. eg. \fB! @ var;
  38. usable attributes: var (aka variables) fn (aka functions) names libs (aka libraries)
  39. all
  40. \fB<\fP: import shared library and declares.
  41. \fBTHE C-STYLE DECLARES SUPPORT\fP
  42. eg. \fB< "foobar.so"\fP
  43. \fB< fn @ fn;\fP
  44. \fB< name @ var;\fP
  45. \fB< fn 2 @ fn;\fP
  46. \fB< fn (a, b) @ fn;\fP
  47. \fB< age @ var;\fP
  48. usable attributes: shared (aka dynalib), fn (aka function), var (aka variable)