Front page | perl.perl6.internals |
Postings from September 2001
tclc
Thread Next
From:
Will Coleda
Date:
September 28, 2001 09:31
Subject:
tclc
Message ID:
8396618d.618d8396@infomg.com
Due to a bad case of congenital insanity, I have developed a barely
functional tcl to pasm compiler.
All of the parsing is currently done in perl (not parrot), so it can
only do a single pass, though it does deal with all of tcl's quoting and
word-grouping behavior.
I think the current parrot strings ops will allow me to move nearly all
of this into the parrot assembler (which is good, because otherwise
"eval" will never work). I thought perl5 would be an easier initial
target, however.
I've only bothered to implement two of the core commands: "set" and
"puts".
Before I add much of anything else, I need to implement expressions,
which means I'm going to have to deal with numbers... which, without
PMCs, is going to require some kind of variable typing. I suspect I'll
just cheat and say that S_FOO is a valid STRING name, and that I_FOO is
a valid integer.
I've neglected to attach tclc (and the various modules) so as to avoid
infecting anyone else. I'd be happy to provide a copy on request,
however.
Thanks for the interesting thought experiment. ^_^
(I tried to attach test.tcl and test.pasm, but my lovely MUA is not
cooperating. Here there are inline)
[wjc@volvo little_languages]$ cat test.tcl
#
# Exercise the various substitution and quoting modes
#
#
set a "St\[ring Parsing"
puts -nonewline "[set a]XX[set a]"
puts " "
puts [set a]
# Command substituion
set b "[set a] stuff\n" ;
puts $b
set a {
set b {
set c
}
set d
}
puts $a
#
# Exercise the various substitution and quoting modes
#
#
set S2, "St\[ring Parsing"
print S2
print " "
print S2
print "\n"
print S2
print "\n"
# Command substituion
set S3, ""
concat S3, S2
set S1, " stuff\n"
concat S3, S1
print S3
print "\n"
set S2, "\n set b {\n set c\n }\n set d\n"
print S2
print "\n"
end
Thread Next