Execute SNUSP/Perl: Difference between revisions
Content added Content deleted
m (Mwn3d moved page RCSNUSP/Perl to Execute SNUSP/Perl: Task changed names) |
m (Fixed syntax highlighting.) |
||
Line 19: | Line 19: | ||
Here's the main program: |
Here's the main program: |
||
< |
<syntaxhighlight lang="perl">#!perl |
||
use strict; |
use strict; |
||
use warnings; |
use warnings; |
||
Line 295: | Line 295: | ||
EX |
EX |
||
__END__ |
__END__</syntaxhighlight> |
||
</lang> |
|||
The following is the file which is included by each compiled perl program. |
The following is the file which is included by each compiled perl program. |
||
Line 303: | Line 302: | ||
the main program. |
the main program. |
||
< |
<syntaxhighlight lang="perl">#!perl |
||
use strict; |
use strict; |
||
use warnings; |
use warnings; |
||
Line 359: | Line 358: | ||
1; |
1; |
||
__END__ |
__END__</syntaxhighlight> |
||
</lang> |
|||
Here's a basic Hello, World! program, which I found at: |
Here's a basic Hello, World! program, which I found at: |
||
http://www.quirkster.com/iano/snusp/snusp-js.html |
http://www.quirkster.com/iano/snusp/snusp-js.html |
||
< |
<syntaxhighlight lang=snusp"> \/\ /\ /\ /\ |
||
+++ ++ ++ ++ |
+++ ++ ++ ++ |
||
+++ ++ /++++\ ++ ++ /++++\ |
+++ ++ /++++\ ++ ++ /++++\ |
||
Line 381: | Line 379: | ||
. +> + + + + +- - +- -. |
. +> + + + + +- - +- -. |
||
\.+/\++/ \++++/ + . +\ /-.+/- -- |
\.+/\++/ \++++/ + . +\ /-.+/- -- |
||
\ / \< / \ / \/ |
\ / \< / \ / \/</syntaxhighlight> |
||
</lang> |
|||
When compiled, the SNUSP code above produces the Perl code below: |
When compiled, the SNUSP code above produces the Perl code below: |
||
< |
<syntaxhighlight lang="perl">#!perl |
||
use strict; |
use strict; |
||
use warnings; |
use warnings; |
||
Line 419: | Line 415: | ||
goto (pop @st);# U_40_9 '#' |
goto (pop @st);# U_40_9 '#' |
||
STACK_UNDERFLOW: ; |
STACK_UNDERFLOW: ; |
||
EXIT: exit($data[$col] || 0); |
EXIT: exit($data[$col] || 0);</syntaxhighlight> |
||
</lang> |
|||
This code produces: |
This code produces: |