git @ Cat's Eye Technologies Squishy2K / 465af7a
Move documentation to README, fix license text (no "REGENTS".) --HG-- rename : doc/squishy2k.txt => README.txt Cat's Eye Technologies 10 years ago
4 changed file(s) with 89 addition(s) and 124 deletion(s). Raw diff Collapse all Expand all
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
-32
doc/license.txt less more
0 Copyright (c)2000, Cat's Eye Technologies.
1 All rights reserved.
2
3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions
5 are met:
6
7 Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9
10 Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in
12 the documentation and/or other materials provided with the
13 distribution.
14
15 Neither the name of Cat's Eye Technologies nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20 CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
27 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 POSSIBILITY OF SUCH DAMAGE.
+0
-65
doc/squishy2k.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
11 # squishy2k.pl - v2000.10.06 Chris Pressey
22 # Squishy2K to Perl 5 compiler in Perl 5
33
4 # Copyright (c)2000, Cat's Eye Technologies.
4 # Copyright (c)2000-2012, Chris Pressey, Cat's Eye Technologies.
55 # All rights reserved.
66 #
77 # Redistribution and use in source and binary forms, with or without
88 # modification, are permitted provided that the following conditions
99 # are met:
10 #
11 # Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 #
14 # Redistributions in binary form must reproduce the above copyright
15 # notice, this list of conditions and the following disclaimer in
16 # the documentation and/or other materials provided with the
17 # distribution.
18 #
19 # Neither the name of Cat's Eye Technologies nor the names of its
20 # contributors may be used to endorse or promote products derived
21 # from this software without specific prior written permission.
22 #
23 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24 # CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
25 # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 # DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
28 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
29 # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
31 # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
32 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 # POSSIBILITY OF SUCH DAMAGE.
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.
3633
3734 ### SYNOPSIS
3835