aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-10-01 01:04:30 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2026-10-11 00:14:35 +0200
commit4ce39e4fc1de9536de7dedfe91b6dee38dec76ae (patch)
treef9820f96b8eab624430c3700f32a2878a7036ee2 /examples
parent9140988be4e5bb028b7140aca1a67af1370c72a7 (diff)
downloadprc-4ce39e4fc1de9536de7dedfe91b6dee38dec76ae.tar.gz
WIP sym + cgen
Diffstat (limited to 'examples')
-rw-r--r--examples/alias.prs (renamed from examples/alias.prose)0
-rw-r--r--examples/argcv.prs (renamed from examples/argcv.prose)0
-rw-r--r--examples/c.prs (renamed from examples/c.prose)0
-rw-r--r--examples/call.prose18
-rw-r--r--examples/call.prs17
-rw-r--r--examples/from.prs (renamed from examples/from.prose)0
-rw-r--r--examples/hello.prose7
-rw-r--r--examples/hello.prs20
8 files changed, 37 insertions, 25 deletions
diff --git a/examples/alias.prose b/examples/alias.prs
index 0fae9a6..0fae9a6 100644
--- a/examples/alias.prose
+++ b/examples/alias.prs
diff --git a/examples/argcv.prose b/examples/argcv.prs
index da50b59..da50b59 100644
--- a/examples/argcv.prose
+++ b/examples/argcv.prs
diff --git a/examples/c.prose b/examples/c.prs
index 8224fb5..8224fb5 100644
--- a/examples/c.prose
+++ b/examples/c.prs
diff --git a/examples/call.prose b/examples/call.prose
deleted file mode 100644
index d90ccff..0000000
--- a/examples/call.prose
+++ /dev/null
@@ -1,18 +0,0 @@
-* function calls
-function foo
- linkage
- myparam word
- ret word
- procedure using myparam returning ret
- display "myparam is " myparam
- set ret to 0
-
-public function main
- linkage
- status word
- storage
- myvar word
- procedure returning status
- set myvar to 123
- call foo using myvar returning status
- display "status is " status
diff --git a/examples/call.prs b/examples/call.prs
new file mode 100644
index 0000000..3c7d9c4
--- /dev/null
+++ b/examples/call.prs
@@ -0,0 +1,17 @@
+* function calls
+function foo
+ linkage
+ a word
+ b word
+ c word
+ d word
+ procedure using a b c returning d
+
+public function main
+ types
+ foo prototype
+ procedure
+ storage
+ myfoo foo
+ procedure
+ call foo using a b c returning d
diff --git a/examples/from.prose b/examples/from.prs
index 746371d..746371d 100644
--- a/examples/from.prose
+++ b/examples/from.prs
diff --git a/examples/hello.prose b/examples/hello.prose
deleted file mode 100644
index 00c0fe1..0000000
--- a/examples/hello.prose
+++ /dev/null
@@ -1,7 +0,0 @@
-* hello world example
-public function main
- linkage
- status word
- procedure returning status
- display "hello world"
- set status to 0
diff --git a/examples/hello.prs b/examples/hello.prs
new file mode 100644
index 0000000..4ba371a
--- /dev/null
+++ b/examples/hello.prs
@@ -0,0 +1,20 @@
+* hello world example
+
+public function main
+ globals
+ myptr pointer to int
+ types
+ socket prototype
+ linkage
+ fd int
+ procedure returning fd
+
+ vfprintf prototype
+ procedure
+
+ myalias alias int
+ procedure
+ display "socket=" socket etc
+ display ", vfprintf=" vfprintf
+ display "this is a string"
+ display cast "this is a string" to pointer to void