git @ Cat's Eye Technologies Squishy2K / f315ac6
Place Squishy2K distribution in the public domain. --HG-- rename : README.txt => README.markdown catseye 10 years ago
4 changed file(s) with 100 addition(s) and 95 deletion(s). Raw diff Collapse all Expand all
0 Squishky2K
1 ==========
2
3 This is the reference distribution for the esoteric programming language
4 Squishy2K.
5
6 Here is a copy of the email that announced its creation. That's all the
7 docs you get for now.
8
9 .....Subject: [Esoteric] [Languages] New! Squishy2K (v2000.10.06)
10 Date: Fri, 06 Oct 2000 20:56:43 -0500
11 From: Chris Pressey
12 Organization: Cat's Eye Technologies
13 To: Cat's Eye Technologies Mailing List
14
15
16 Back in ancient history I came up with a language which worked like a
17 Turing-Complete EBNF - a compiler-compiler that could also do banal
18 computation via translation. I wanted to call the language Wirth in
19 honour of the inventor of EBNF. But the name SQUISHY was proposed and
20 stuck.
21
22 SQUISHY is now left to the sands of time, and this was long before I had
23 ever heard of a semi-Thue grammar or the language Thue.
24
25 But SQUISHY is now back, refurbished for the twenty-first century, in
26 the form of Squishy2K! Squishy2K is a lot like the original SQUISHY
27 except with more and less. It's not as much like EBNF anymore. On the
28 other hand, it's more like a state machine now! And in Perl it's dead
29 simple, something like 7K of code.
30
31 Squishy2K is a string-rewriting language (read: Thue) embedded within a
32 state machine (read: beta-Juliet) with states-doubling-as-functions
33 thrown in for good measure (read: I haven't rhe foggiest idea what I'm
34 doing.)
35
36 Reading the grammar will prove to you how simple it is.
37
38 Program ::= {State}.
39 State ::= "*" Name "{" {Rule} ["!" Name] "}".
40 Rule ::= LString "?" RString "!" [Name].
41 LString ::= {quoted | "few" | "many" | "start" | "finish"}.
42 RString ::= {quoted | digit | Name "(" RString ")"}.
43
44 In English... a program consists of any number of states. Each state
45 begins with an asterisk, gives a name (alphanumeric), and contains any
46 number of rules and an optional notwithstanding clause between curly
47 braces. The state named "main" is where flow control begins and ends.
48
49 Each rule is composed of an "lstring" (a pattern to be searched for) and
50 an "rstring" (an expression to replace any matched pattern with.) The
51 pattern tokens "start" and "finish" match the beginning and the end of
52 the input string respectively. The tokens "few" and "many" match any
53 number of characters, the former preferring to match as few as possible,
54 the latter is "greedy." In the rstring, backreferences to the few and
55 many tokens may be made with digits: 1 indicates the first few or many,
56 2 the second, and so on.
57
58 Each rule, and the notwithstanding clause, can name another state, and
59 when a match succeeds on that rule (or no match succeeds for the
60 notwithstanding clause), a transition along the arc to that state fires
61 (i.e. it's a goto...)
62
63 That's about it.
64
65 Now I have to write a fake infomercial for it, and it'll be complete.
66 :-)
67
68 _chris
69
70 --
71 Uryc! V'z genccrq vafvqr gur ebg13 plcure!
72 Share and Enjoy on Cat's Eye Technologies' Electronic Mailing List
73 http://www.catseye.mb.ca/list.html
+0
-65
README.txt less more
0 Subject: [Esoteric] [Languages] New! Squishy2K (v2000.10.06)
1 Date: Fri, 06 Oct 2000 20:56:43 -0500
2 From: Chris Pressey
3 Organization: Cat's Eye Technologies
4 To: Cat's Eye Technologies Mailing List
5
6
7 Back in ancient history I came up with a language which worked like a
8 Turing-Complete EBNF - a compiler-compiler that could also do banal
9 computation via translation. I wanted to call the language Wirth in
10 honour of the inventor of EBNF. But the name SQUISHY was proposed and
11 stuck.
12
13 SQUISHY is now left to the sands of time, and this was long before I had
14 ever heard of a semi-Thue grammar or the language Thue.
15
16 But SQUISHY is now back, refurbished for the twenty-first century, in
17 the form of Squishy2K! Squishy2K is a lot like the original SQUISHY
18 except with more and less. It's not as much like EBNF anymore. On the
19 other hand, it's more like a state machine now! And in Perl it's dead
20 simple, something like 7K of code.
21
22 Squishy2K is a string-rewriting language (read: Thue) embedded within a
23 state machine (read: beta-Juliet) with states-doubling-as-functions
24 thrown in for good measure (read: I haven't rhe foggiest idea what I'm
25 doing.)
26
27 Reading the grammar will prove to you how simple it is.
28
29 Program ::= {State}.
30 State ::= "*" Name "{" {Rule} ["!" Name] "}".
31 Rule ::= LString "?" RString "!" [Name].
32 LString ::= {quoted | "few" | "many" | "start" | "finish"}.
33 RString ::= {quoted | digit | Name "(" RString ")"}.
34
35 In English... a program consists of any number of states. Each state
36 begins with an asterisk, gives a name (alphanumeric), and contains any
37 number of rules and an optional notwithstanding clause between curly
38 braces. The state named "main" is where flow control begins and ends.
39
40 Each rule is composed of an "lstring" (a pattern to be searched for) and
41 an "rstring" (an expression to replace any matched pattern with.) The
42 pattern tokens "start" and "finish" match the beginning and the end of
43 the input string respectively. The tokens "few" and "many" match any
44 number of characters, the former preferring to match as few as possible,
45 the latter is "greedy." In the rstring, backreferences to the few and
46 many tokens may be made with digits: 1 indicates the first few or many,
47 2 the second, and so on.
48
49 Each rule, and the notwithstanding clause, can name another state, and
50 when a match succeeds on that rule (or no match succeeds for the
51 notwithstanding clause), a transition along the arc to that state fires
52 (i.e. it's a goto...)
53
54 That's about it.
55
56 Now I have to write a fake infomercial for it, and it'll be complete.
57 :-)
58
59 _chris
60
61 --
62 Uryc! V'z genccrq vafvqr gur ebg13 plcure!
63 Share and Enjoy on Cat's Eye Technologies' Electronic Mailing List
64 http://www.catseye.mb.ca/list.html
0 This is free and unencumbered software released into the public domain.
1
2 Anyone is free to copy, modify, publish, use, compile, sell, or
3 distribute this software, either in source code form or as a compiled
4 binary, for any purpose, commercial or non-commercial, and by any
5 means.
6
7 In jurisdictions that recognize copyright laws, the author or authors
8 of this software dedicate any and all copyright interest in the
9 software to the public domain. We make this dedication for the benefit
10 of the public at large and to the detriment of our heirs and
11 successors. We intend this dedication to be an overt act of
12 relinquishment in perpetuity of all present and future rights to this
13 software under copyright law.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 OTHER DEALINGS IN THE SOFTWARE.
22
23 For more information, please refer to <http://unlicense.org/>
00 #!/usr/bin/env perl
11 # squishy2k.pl - v2000.10.06 Chris Pressey
22 # Squishy2K to Perl 5 compiler in Perl 5
3
4 # Copyright (c)2000-2012, Chris Pressey, Cat's Eye Technologies.
5 # All rights reserved.
6 #
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
9 # are met:
10 #
11 # 1. Redistributions of source code must retain the above copyright
12 # notices, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notices, this list of conditions, and the following disclaimer in
15 # the documentation and/or other materials provided with the
16 # distribution.
17 # 3. Neither the names of the copyright holders nor the names of their
18 # contributors may be used to endorse or promote products derived
19 # from this software without specific prior written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 # COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 # POSSIBILITY OF SUCH DAMAGE.
3 # This work is in the public domain. See the file UNLICENSE for more
4 # information.
335
346 ### SYNOPSIS
357