|
@@ -15,31 +15,48 @@ to download that from https://gitee.com/pengruiyang-cpu/tripl.git before
|
|
|
that.
|
|
that.
|
|
|
|
|
|
|
|
.SH SYNTAX
|
|
.SH SYNTAX
|
|
|
-\fB$\fP: uses to push a number into stack.
|
|
|
|
|
|
|
+\fB$\fP: uses to push a number into stack. now we also support global variables.
|
|
|
|
|
|
|
|
-eg. \fB$ name 1048576\fP
|
|
|
|
|
|
|
+eg. \fB$ name 1048576;\fP
|
|
|
|
|
|
|
|
- \fB$ name 1048576 @ rdonly global\fP
|
|
|
|
|
|
|
+ \fB$ name = +1048576;\fP
|
|
|
|
|
|
|
|
-\fB`\fP: pop a number and free the memory of it. \fBWILL BE ABANDONED\fP
|
|
|
|
|
|
|
+ \fB$ name = -1048576;\fP
|
|
|
|
|
+
|
|
|
|
|
+ # or just leave blank. default value is 0
|
|
|
|
|
+
|
|
|
|
|
+ \fB$ name;$\fP;
|
|
|
|
|
+
|
|
|
|
|
+ \fB$ name 1048576 @ rdonly global;\fP
|
|
|
|
|
+
|
|
|
|
|
+ usable variable attributes: global rdonly ptr
|
|
|
|
|
|
|
|
-eg. \fB`;\fP
|
|
|
|
|
|
|
|
|
|
\fB#\fP: line comment
|
|
\fB#\fP: line comment
|
|
|
|
|
|
|
|
-\fB!\fP: stack dump. This dumps the stack, you can see numbers in the stack,
|
|
|
|
|
-but this won't change anything. \fBIT DOES NOT WORK IN COMPILE MODE\fP
|
|
|
|
|
|
|
+\fB!\fP: dump. This dumps things you want, e.g. functions, names, libraries
|
|
|
|
|
|
|
|
-\fB<\fP: import shared library.
|
|
|
|
|
|
|
+ \fBTHIS ONLY WORKS IN INTERPRETER MODE\fP
|
|
|
|
|
+
|
|
|
|
|
+eg. \fB! @ var;
|
|
|
|
|
+
|
|
|
|
|
+ usable attributes: var (aka variables) fn (aka functions) names libs (aka libraries)
|
|
|
|
|
+ all
|
|
|
|
|
+
|
|
|
|
|
+\fB<\fP: import shared library and declares.
|
|
|
|
|
|
|
|
eg. \fB< "foobar.so"\fP
|
|
eg. \fB< "foobar.so"\fP
|
|
|
|
|
+
|
|
|
|
|
+ \fB< fn @ fn;\fP
|
|
|
|
|
+
|
|
|
|
|
+ \fB< name @ var;\fP
|
|
|
|
|
|
|
|
-\fB@\fP: calling function. \fBWARNING: MAX 6 ARGUMENTS SUPPORT\fP
|
|
|
|
|
|
|
+ \fB< fn 2 @ fn;\fP
|
|
|
|
|
|
|
|
-eg. \fB@ printf "hello, world %d %s" 0 "hello"
|
|
|
|
|
|
|
+ \fB< fn (a, b) @ fn;\fP
|
|
|
|
|
|
|
|
- \fB@ printf ("hello, world");
|
|
|
|
|
|
|
+ \fB< age @ var;\fP
|
|
|
|
|
|
|
|
- \fB@ printf("a: %d\n", a);
|
|
|
|
|
|
|
+ usable attributes: shared (aka dynalib), fn (aka function), var (aka variable)
|
|
|
|
|
|
|
|
|
|
|