| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| AppClass.tcl | 2023-02-20 | 2.4 kB | |
| checkstring.tcl | 2023-02-20 | 2.0 kB | |
| README.txt | 2023-02-20 | 799 Bytes | |
| AppClass.sm | 2023-02-20 | 1.9 kB | |
| Makefile | 2023-02-20 | 2.4 kB | |
| Totals: 5 Items | 9.5 kB | 0 | |
Tcl Example 2
This state machine "recognizes" the string 0*1*. Example 2 differs
from example 1 in that example 2 uses default transitions.
+ Building
----------
NOTE: Smc.jar must be built and installed.
Unix & Windows:
$ java -jar ../../../bin/Smc.jar -tcl AppClass.sm
+ Executing
-----------
Unix & Windows
$ tclsh checkstring.tcl <string>
Try several different strings, such as:
$ tclsh checkstring.tcl ""
-> acceptable
$ tclsh checkstring.tcl 000
-> acceptable
$ tclsh checkstring.tcl 00011
-> acceptable
$ tclsh checkstring.tcl 111
-> acceptable
$ tclsh checkstring.tcl 000111100
-> unacceptable
$ tclsh checkstring.tcl 00011a1b10c0
-> unacceptable