Skip to content

Commit

Permalink
Rename from PmTcl to Partcl
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Dec 4, 2009
1 parent 3057092 commit e9f0876
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 93 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Expand Up @@ -2,7 +2,7 @@ Makefile
/parrot/
/parrot_install/
/src/gen/*.pir
pmtcl.pbc
pmtcl.c
pmtcl.o
pmtcl
partcl.pbc
partcl.c
partcl.o
partcl
8 changes: 4 additions & 4 deletions Configure.pl
Expand Up @@ -72,12 +72,12 @@
To automatically checkout (svn) and build a copy of parrot r$reqsvn,
try re-running Configure.pl with the '--gen-parrot' option.
Or, use the '--parrot-config' option to explicitly specify
the location of parrot_config to be used to build PmTcl.
the location of parrot_config to be used to build Partcl.
END
}

# Verify the Parrot installation is sufficient for building PmTcl
# Verify the Parrot installation is sufficient for building Partcl
verify_parrot(%config);

# Create the Makefile using the information we just got
Expand All @@ -95,7 +95,7 @@ END

print <<"END";
You can now use '$make' to build PmTcl.
You can now use '$make' to build Partcl.
After that, you can use '$make test' to run some local tests.
END
Expand Down Expand Up @@ -195,7 +195,7 @@ sub version_int {
# Print some help text.
sub print_help {
print <<'END';
Configure.pl - PmTcl Configure
Configure.pl - Partcl Configure
General Options:
--help Show this text
Expand Down
2 changes: 1 addition & 1 deletion README
@@ -1,4 +1,4 @@
PmTcl - a NQP-based implementation of Tcl
Partcl - a NQP-based implementation of Tcl

This is a proof of concept to reimplement partcl (tcl on parrot) using
the latest compiler tools available for parrot.
Expand Down
92 changes: 46 additions & 46 deletions build/Makefile.in
Expand Up @@ -37,31 +37,31 @@ PARROT_PERL_LIB = $(PARROT_TOOLS_DIR)/lib

NQP_LANG_DIR = $(PARROT_LIB_DIR)/languages/nqp

PMTCL_EXE = pmtcl$(EXE)
PMTCL_G_PIR = src/gen/pmtcl-grammar.pir
PMTCL_A_PIR = src/gen/pmtcl-actions.pir
PMTCL_C_PIR = src/gen/pmtcl-compiler.pir
PMTCL_B_PIR = src/gen/pmtcl-commands-main.pir
PMTCL_B_I_PIR = src/gen/pmtcl-commands-info.pir
PMTCL_B_N_PIR = src/gen/pmtcl-commands-namespace.pir
PMTCL_B_P_PIR = src/gen/pmtcl-commands-package.pir
PMTCL_B_S_PIR = src/gen/pmtcl-commands-string.pir
PARTCL_EXE = partcl$(EXE)
PARTCL_G_PIR = src/gen/partcl-grammar.pir
PARTCL_A_PIR = src/gen/partcl-actions.pir
PARTCL_C_PIR = src/gen/partcl-compiler.pir
PARTCL_B_PIR = src/gen/partcl-commands-main.pir
PARTCL_B_I_PIR = src/gen/partcl-commands-info.pir
PARTCL_B_N_PIR = src/gen/partcl-commands-namespace.pir
PARTCL_B_P_PIR = src/gen/partcl-commands-package.pir
PARTCL_B_S_PIR = src/gen/partcl-commands-string.pir
TCLLEXPAD_PIR = src/gen/tcllexpad.pir
ARE_G_PIR = src/gen/are-grammar.pir
ARE_A_PIR = src/gen/are-actions.pir
ARE_C_PIR = src/gen/are-compiler.pir
INIT_PIR = src/gen/init.pir

PMTCL_SOURCES = \
src/PmTcl.pir \
$(PMTCL_G_PIR) \
$(PMTCL_A_PIR) \
$(PMTCL_C_PIR) \
$(PMTCL_B_PIR) \
$(PMTCL_B_I_PIR) \
$(PMTCL_B_N_PIR) \
$(PMTCL_B_P_PIR) \
$(PMTCL_B_S_PIR) \
PARTCL_SOURCES = \
src/Partcl.pir \
$(PARTCL_G_PIR) \
$(PARTCL_A_PIR) \
$(PARTCL_C_PIR) \
$(PARTCL_B_PIR) \
$(PARTCL_B_I_PIR) \
$(PARTCL_B_N_PIR) \
$(PARTCL_B_P_PIR) \
$(PARTCL_B_S_PIR) \
$(TCLLEXPAD_PIR) \
$(ARE_G_PIR) \
$(ARE_A_PIR) \
Expand All @@ -76,31 +76,31 @@ CLEANUPS = \
*.c\
*.o\
src/gen/*.pir \
$(PMTCL_EXE) \
pmtcl.pbc

all: $(PMTCL_EXE)

$(PMTCL_EXE) : $(PMTCL_SOURCES)
$(PARROT) -o pmtcl.pbc src/PmTcl.pir
$(PBC_TO_EXE) pmtcl.pbc

$(PMTCL_G_PIR): src/PmTcl/Grammar.pm
$(PARROT_NQP) --target=pir -o $(PMTCL_G_PIR) src/PmTcl/Grammar.pm
$(PMTCL_A_PIR): src/PmTcl/Actions.pm
$(PARROT_NQP) --target=pir -o $(PMTCL_A_PIR) src/PmTcl/Actions.pm
$(PMTCL_C_PIR): src/PmTcl/Compiler.pm
$(PARROT_NQP) --target=pir -o $(PMTCL_C_PIR) src/PmTcl/Compiler.pm
$(PMTCL_B_PIR): src/PmTcl/commands/main.pm
$(PARROT_NQP) --target=pir -o $(PMTCL_B_PIR) src/PmTcl/commands/main.pm
$(PMTCL_B_I_PIR): src/PmTcl/commands/info.pm
$(PARROT_NQP) --target=pir -o $(PMTCL_B_I_PIR) src/PmTcl/commands/info.pm
$(PMTCL_B_N_PIR): src/PmTcl/commands/namespace.pm
$(PARROT_NQP) --target=pir -o $(PMTCL_B_N_PIR) src/PmTcl/commands/namespace.pm
$(PMTCL_B_P_PIR): src/PmTcl/commands/package.pm
$(PARROT_NQP) --target=pir -o $(PMTCL_B_P_PIR) src/PmTcl/commands/package.pm
$(PMTCL_B_S_PIR): src/PmTcl/commands/string.pm
$(PARROT_NQP) --target=pir -o $(PMTCL_B_S_PIR) src/PmTcl/commands/string.pm
$(PARTCL_EXE) \
partcl.pbc

all: $(PARTCL_EXE)

$(PARTCL_EXE) : $(PARTCL_SOURCES)
$(PARROT) -o partcl.pbc src/Partcl.pir
$(PBC_TO_EXE) partcl.pbc

$(PARTCL_G_PIR): src/Partcl/Grammar.pm
$(PARROT_NQP) --target=pir -o $(PARTCL_G_PIR) src/Partcl/Grammar.pm
$(PARTCL_A_PIR): src/Partcl/Actions.pm
$(PARROT_NQP) --target=pir -o $(PARTCL_A_PIR) src/Partcl/Actions.pm
$(PARTCL_C_PIR): src/Partcl/Compiler.pm
$(PARROT_NQP) --target=pir -o $(PARTCL_C_PIR) src/Partcl/Compiler.pm
$(PARTCL_B_PIR): src/Partcl/commands/main.pm
$(PARROT_NQP) --target=pir -o $(PARTCL_B_PIR) src/Partcl/commands/main.pm
$(PARTCL_B_I_PIR): src/Partcl/commands/info.pm
$(PARROT_NQP) --target=pir -o $(PARTCL_B_I_PIR) src/Partcl/commands/info.pm
$(PARTCL_B_N_PIR): src/Partcl/commands/namespace.pm
$(PARROT_NQP) --target=pir -o $(PARTCL_B_N_PIR) src/Partcl/commands/namespace.pm
$(PARTCL_B_P_PIR): src/Partcl/commands/package.pm
$(PARROT_NQP) --target=pir -o $(PARTCL_B_P_PIR) src/Partcl/commands/package.pm
$(PARTCL_B_S_PIR): src/Partcl/commands/string.pm
$(PARROT_NQP) --target=pir -o $(PARTCL_B_S_PIR) src/Partcl/commands/string.pm
$(TCLLEXPAD_PIR): src/TclLexPad.pm
$(PARROT_NQP) --target=pir -o $(TCLLEXPAD_PIR) src/TclLexPad.pm
$(ARE_G_PIR): src/ARE/Grammar.pm
Expand All @@ -123,8 +123,8 @@ TEST_FILES = \
t/cmd_split.t \
t/tcl_command_subst.t

test: $(PMTCL_EXE)
prove --exec=./$(PMTCL_EXE) $(TEST_FILES)
test: $(PARTCL_EXE)
prove --exec=./$(PARTCL_EXE) $(TEST_FILES)

## cleaning

Expand Down
18 changes: 9 additions & 9 deletions src/PmTcl.pir → src/Partcl.pir
Expand Up @@ -15,14 +15,14 @@
parrotns.'export_to'(hllns, imports)
.end

.include 'src/gen/pmtcl-grammar.pir'
.include 'src/gen/pmtcl-actions.pir'
.include 'src/gen/pmtcl-compiler.pir'
.include 'src/gen/pmtcl-commands-main.pir'
.include 'src/gen/pmtcl-commands-info.pir'
.include 'src/gen/pmtcl-commands-namespace.pir'
.include 'src/gen/pmtcl-commands-package.pir'
.include 'src/gen/pmtcl-commands-string.pir'
.include 'src/gen/partcl-grammar.pir'
.include 'src/gen/partcl-actions.pir'
.include 'src/gen/partcl-compiler.pir'
.include 'src/gen/partcl-commands-main.pir'
.include 'src/gen/partcl-commands-info.pir'
.include 'src/gen/partcl-commands-namespace.pir'
.include 'src/gen/partcl-commands-package.pir'
.include 'src/gen/partcl-commands-string.pir'
.include 'src/gen/tcllexpad.pir'
.include 'src/gen/are-grammar.pir'
.include 'src/gen/are-actions.pir'
Expand All @@ -38,7 +38,7 @@
lexpad = get_hll_global '%GLOBALS'
.lex '%LEXPAD', lexpad

$P0 = compreg 'PmTcl'
$P0 = compreg 'Partcl'
# Cannot tailcall here. (TT #1029)
$P1 = $P0.'command_line'(args)
.return ($P1)
Expand Down
2 changes: 1 addition & 1 deletion src/PmTcl/Actions.pm → src/Partcl/Actions.pm
@@ -1,4 +1,4 @@
class PmTcl::Actions is HLL::Actions;
class Partcl::Actions is HLL::Actions;

method TOP($/) { make $<TOP_eval>.ast; }

Expand Down
7 changes: 7 additions & 0 deletions src/Partcl/Compiler.pm
@@ -0,0 +1,7 @@
class Partcl::Compiler is HLL::Compiler;

INIT {
Partcl::Compiler.language('Partcl');
Partcl::Compiler.parsegrammar(Partcl::Grammar);
Partcl::Compiler.parseactions(Partcl::Actions);
}
12 changes: 6 additions & 6 deletions src/PmTcl/Grammar.pm → src/Partcl/Grammar.pm
@@ -1,4 +1,4 @@
grammar PmTcl::Grammar is HLL::Grammar;
grammar Partcl::Grammar is HLL::Grammar;

token TOP { <TOP_eval> }

Expand Down Expand Up @@ -88,11 +88,11 @@ token variable { '$' <identifier> }
# expression parsing

INIT {
PmTcl::Grammar.O(':prec<13>', '%multiplicative');
PmTcl::Grammar.O(':prec<12>', '%additive');
PmTcl::Grammar.O(':prec<10>', '%compare_numeric');
PmTcl::Grammar.O(':prec<09>', '%equality_numeric');
PmTcl::Grammar.O(':prec<08>', '%equality_string');
Partcl::Grammar.O(':prec<13>', '%multiplicative');
Partcl::Grammar.O(':prec<12>', '%additive');
Partcl::Grammar.O(':prec<10>', '%compare_numeric');
Partcl::Grammar.O(':prec<09>', '%equality_numeric');
Partcl::Grammar.O(':prec<08>', '%equality_string');
}

# The <.ws> rule only gets used in expressions.
Expand Down
File renamed without changes.
28 changes: 14 additions & 14 deletions src/PmTcl/commands/main.pm → src/Partcl/commands/main.pm
Expand Up @@ -37,7 +37,7 @@ our sub catch($code, $varname?) {
my $retval := 0; # TCL_OK
my $result;
try {
$result := PmTcl::Compiler.eval($code);
$result := Partcl::Compiler.eval($code);
CONTROL {
my $parrot_type := $!<type>;

Expand Down Expand Up @@ -102,7 +102,7 @@ our sub eval(*@args) {
our %EVALCACHE;
my &sub := %EVALCACHE{$code};
unless pir::defined__IP(&sub) {
&sub := PmTcl::Compiler.compile($code);
&sub := Partcl::Compiler.compile($code);
%EVALCACHE{$code} := &sub;
}
&sub();
Expand All @@ -122,10 +122,10 @@ our sub expr(*@args) {
my &sub := %EXPRCACHE{$code};
unless pir::defined__IP(&sub) {
my $parse :=
PmTcl::Grammar.parse(
Partcl::Grammar.parse(
$code,
:rule('TOP_expr'),
:actions(PmTcl::Actions)
:actions(Partcl::Actions)
);
&sub := PAST::Compiler.compile($parse.ast);
%EXPRCACHE{$code} := &sub;
Expand Down Expand Up @@ -187,7 +187,7 @@ our sub join(*@args) {
my $joinString := @args[1];

my @list :=
PmTcl::Grammar.parse($list, :rule<list>, :actions(PmTcl::Actions) ).ast // pir::new__Ps('TclList');
Partcl::Grammar.parse($list, :rule<list>, :actions(Partcl::Actions) ).ast // pir::new__Ps('TclList');

$joinString := " " unless pir::defined($joinString);

Expand All @@ -212,7 +212,7 @@ our sub list(*@args) {

our sub lindex($list, $pos) {
my @list :=
PmTcl::Grammar.parse($list, :rule<list>, :actions(PmTcl::Actions) ).ast;
Partcl::Grammar.parse($list, :rule<list>, :actions(Partcl::Actions) ).ast;

return @list[$pos];
}
Expand All @@ -222,7 +222,7 @@ our sub llength(*@args) {
error('wrong # args: should be "llength list"')
}
my @list :=
PmTcl::Grammar.parse(@args[0], :rule<list>, :actions(PmTcl::Actions) ).ast;
Partcl::Grammar.parse(@args[0], :rule<list>, :actions(Partcl::Actions) ).ast;

return +@list;
}
Expand All @@ -237,14 +237,14 @@ our sub proc(*@args) {
my $body := @args[2];

my $parse :=
PmTcl::Grammar.parse( $body, :rule<TOP_proc>, :actions(PmTcl::Actions) );
Partcl::Grammar.parse( $body, :rule<TOP_proc>, :actions(Partcl::Actions) );
my $block := $parse.ast;
my @params :=
PmTcl::Grammar.parse($args, :rule<list>, :actions(PmTcl::Actions) ).ast;
Partcl::Grammar.parse($args, :rule<list>, :actions(Partcl::Actions) ).ast;

for @params {
my @argument :=
PmTcl::Grammar.parse($_, :rule<list>, :actions(PmTcl::Actions) ).ast;
Partcl::Grammar.parse($_, :rule<list>, :actions(Partcl::Actions) ).ast;

if +@argument == 1 {
$block[0].push(
Expand Down Expand Up @@ -330,7 +330,7 @@ our sub set($varname, $value?) {
}

our sub source($filename) {
PmTcl::Compiler.evalfiles($filename);
Partcl::Compiler.evalfiles($filename);
}

our sub split(*@args) {
Expand Down Expand Up @@ -447,7 +447,7 @@ our sub uplevel($level, *@args) {

## now evaluate @args in the current context
my $code := concat(|@args);
PmTcl::Compiler.eval($code);
Partcl::Compiler.eval($code);
}


Expand All @@ -468,7 +468,7 @@ our sub while (*@args) {
## into a list of elements, honoring braces and backslash
## expansion (similar to the Tcl_SplitList function). The actual
## parsing and expansion is handled by the <list> token in
## PmTcl::Grammar .
## Partcl::Grammar .
our sub EXPAND($args) {
PmTcl::Grammar.parse($args, :rule<list>, :actions(PmTcl::Actions) ).ast;
Partcl::Grammar.parse($args, :rule<list>, :actions(Partcl::Actions) ).ast;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions src/PmTcl/Compiler.pm

This file was deleted.

2 changes: 1 addition & 1 deletion t/sanity.t
@@ -1,4 +1,4 @@
#! ./pmtcl
#! ./partcl
# Run enough to get partcl's lib/test_more.tcl running.

puts 1..10
Expand Down

0 comments on commit e9f0876

Please sign in to comment.