Author: particle
Date: Wed Dec 28 11:24:35 2005
New Revision: 10740
Added:
trunk/languages/cola/core.pir
- copied unchanged from r10738, trunk/languages/cola/core.imc
trunk/languages/regex/01_basic.pir
- copied, changed from r10738, trunk/languages/regex/01_basic.imc
trunk/languages/regex/02_date.pir
- copied, changed from r10738, trunk/languages/regex/02_date.imc
trunk/languages/regex/regex-compiler.pir
- copied, changed from r10738, trunk/languages/regex/regex-compiler.imc
Removed:
trunk/languages/cola/core.imc
trunk/languages/regex/01_basic.imc
trunk/languages/regex/02_date.imc
trunk/languages/regex/regex-compiler.imc
Modified:
trunk/MANIFEST
trunk/config/gen/makefiles/regex.in
trunk/languages/cola/README
trunk/languages/cola/cola.y
trunk/languages/cola/parser.c
trunk/languages/regex/README
trunk/languages/regex/lib/Parrot/Test/Regex.pm
trunk/languages/regex/test.pl
Log:
#37520: [TODO] rename library files from .imc to .pir
~converted remaining languages/ files
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Wed Dec 28 11:24:35 2005
@@ -777,7 +777,7 @@ languages/cola/cola.h
languages/cola/cola.l [cola]
languages/cola/cola.y [cola]
languages/cola/colac [cola]
-languages/cola/core.imc [cola]
+languages/cola/core.pir [cola]
languages/cola/examples/calc.cola [cola]
languages/cola/examples/expressions.cola [cola]
languages/cola/examples/fib.cola [cola]
@@ -1094,8 +1094,8 @@ languages/python/t/pie/b2.t
languages/python/t/pie/b3.t []
languages/python/t/pie/b5.t []
languages/python/t/pie/b6.t []
-languages/regex/01_basic.imc [regex]
-languages/regex/02_date.imc [regex]
+languages/regex/01_basic.pir [regex]
+languages/regex/02_date.pir [regex]
languages/regex/ChangeLog [regex]
languages/regex/MAINTAINER [regex]
languages/regex/README [regex]
@@ -1121,7 +1121,7 @@ languages/regex/lib/Regex/Parse/P6C.pm
languages/regex/lib/Regex/Rewrite.pm [regex]
languages/regex/lib/Regex/State.pm [regex]
languages/regex/lib/Regex/TreeOptimize.pm [regex]
-languages/regex/regex-compiler.imc [regex]
+languages/regex/regex-compiler.pir [regex]
languages/regex/regex.pl [regex]
languages/regex/t/basic/a.t [regex]
languages/regex/t/basic/alt.t [regex]
Modified: trunk/config/gen/makefiles/regex.in
==============================================================================
--- trunk/config/gen/makefiles/regex.in (original)
+++ trunk/config/gen/makefiles/regex.in Wed Dec 28 11:24:35 2005
@@ -14,8 +14,8 @@ all : lib/Regex/Grammar.pm regex-compile
lib/Regex/Grammar.pm : lib/Regex/Grammar.y
$(YAPP) -s -m Regex::Grammar -o $@ lib/Regex/Grammar.y
-regex-compiler.pbc : regex-compiler.imc
- $(PARROT) -o regex-compiler.pbc regex-compiler.imc
+regex-compiler.pbc : regex-compiler.pir
+ $(PARROT) -o regex-compiler.pbc regex-compiler.pir
# Note: These tend to be in the order of the latest thing I've been
# working on to the oldest, so that I see the failures quicker.
@@ -44,7 +44,7 @@ test :
CLEANERS = \
lib/Regex/Grammar.pm \
"*.pbc" \
-test.imc
+test.pir
clean:
$(RM_F) $(CLEANERS)
Modified: trunk/languages/cola/README
==============================================================================
--- trunk/languages/cola/README (original)
+++ trunk/languages/cola/README Wed Dec 28 11:24:35 2005
@@ -161,7 +161,7 @@ Using the Compiler
colacc examples/mandelbrot.cola
- NOTE: colacc will expect you to have core.imc in the current directory
+ NOTE: colacc will expect you to have core.pir in the current directory
when you execute it as it autoincludes it in generated code.
This will call Parrot (and imcc) to generate 2 types of output. a.pasm
@@ -176,7 +176,7 @@ Using the Compiler
If you have trouble with colac you can just use colacc which
is the raw compiler which ignores 'using' directives.
- Also, if you look in "a.imc" you will see an intermediate
+ Also, if you look in "a.pir" you will see an intermediate
language. Debugging the compiler is easier by looking at the
intermediate code. This language can be piped through imcc to
re-generate the .pasm file, however this is done by default.
Modified: trunk/languages/cola/cola.y
==============================================================================
--- trunk/languages/cola/cola.y (original)
+++ trunk/languages/cola/cola.y Wed Dec 28 11:24:35 2005
@@ -1028,8 +1028,8 @@ int main(int argc, char * argv[])
fprintf(stderr, "Pass 3: Semantic checking...\n");
/*semant_ast(ast_start); */
- freopen("a.imc", "w", stdout);
- fprintf(stderr, "Compiling intermediate code to a.imc\n");
+ freopen("a.pir", "w", stdout);
+ fprintf(stderr, "Compiling intermediate code to a.pir\n");
/*
printf( "#Dump of global namespace:\n" );
indent = 0;
@@ -1051,13 +1051,13 @@ int main(int argc, char * argv[])
}
printf("# Include standard API stuff\n");
- printf(".include \"core.imc\"\n\n");
+ printf(".include \"core.pir\"\n\n");
fflush(stdout);
fprintf(stderr, "%ld lines compiled to PIR.\n", line);
fprintf(stderr, "Generating PASM\n");
- system("../../parrot -o a.pasm a.imc");
+ system("../../parrot -o a.pasm a.pir");
fprintf(stderr, "Generating PBC (Bytecode)\n");
- system("../../parrot -o a.pbc a.imc");
+ system("../../parrot -o a.pbc a.pir");
return 0;
}
Modified: trunk/languages/cola/parser.c
==============================================================================
--- trunk/languages/cola/parser.c (original)
+++ trunk/languages/cola/parser.c Wed Dec 28 11:24:35 2005
@@ -2653,8 +2653,8 @@ int main(int argc, char * argv[])
fprintf(stderr, "Pass 3: Semantic checking...\n");
/*semant_ast(ast_start); */
- freopen("a.imc", "w", stdout);
- fprintf(stderr, "Compiling intermediate code to a.imc\n");
+ freopen("a.pir", "w", stdout);
+ fprintf(stderr, "Compiling intermediate code to a.pir\n");
/*
printf( "#Dump of global namespace:\n" );
indent = 0;
@@ -2676,13 +2676,13 @@ int main(int argc, char * argv[])
}
printf("# Include standard API stuff\n");
- printf(".include \"core.imc\"\n\n");
+ printf(".include \"core.pir\"\n\n");
fflush(stdout);
fprintf(stderr, "%ld lines compiled to PIR.\n", line);
fprintf(stderr, "Generating PASM\n");
- system("../../parrot -o a.pasm a.imc");
+ system("../../parrot -o a.pasm a.pir");
fprintf(stderr, "Generating PBC (Bytecode)\n");
- system("../../parrot -o a.pbc a.imc");
+ system("../../parrot -o a.pbc a.pir");
return 0;
}
Copied: trunk/languages/regex/01_basic.pir (from r10738,
trunk/languages/regex/01_basic.imc)
==============================================================================
--- trunk/languages/regex/01_basic.imc (original)
+++ trunk/languages/regex/01_basic.pir Wed Dec 28 11:24:35 2005
@@ -1,7 +1,7 @@
# Basic example of using an embedded regex compiler. Requires
# "regex-compiler.pbc", which can be generated by running
#
-# parrot -o regex-compiler.pbc regex-compiler.imc
+# parrot -o regex-compiler.pbc regex-compiler.pir
#
.sub main :main
Copied: trunk/languages/regex/02_date.pir (from r10738,
trunk/languages/regex/02_date.imc)
==============================================================================
--- trunk/languages/regex/02_date.imc (original)
+++ trunk/languages/regex/02_date.pir Wed Dec 28 11:24:35 2005
@@ -2,7 +2,7 @@
# components of a simple date string. Requires "regex-compiler.pbc",
# which can be generated by running
#
-# parrot -o regex-compiler.pbc regex-compiler.imc
+# parrot -o regex-compiler.pbc regex-compiler.pir
#
.sub main :main
Modified: trunk/languages/regex/README
==============================================================================
--- trunk/languages/regex/README (original)
+++ trunk/languages/regex/README Wed Dec 28 11:24:35 2005
@@ -57,8 +57,8 @@ matching routine with some input. Or, ju
the --main argument to regex.pl to generate a sample driver program
that accepts an input string on the command line:
- perl regex.pl --main -o mytest.imc 'a*x'
- ../../parrot mytest.imc baax
+ perl regex.pl --main -o mytest.pir 'a*x'
+ ../../parrot mytest.pir baax
(output)
Match found
0: 1..3
@@ -73,8 +73,8 @@ structures encoding the matching informa
New stuff: now you can use the compiler as an embedded Parrot
compiler. Run 'make regex-compiler.pbc' to generate
-regex-compiler.pbc. Then run ../../parrot 01_basic.imc, ../../parrot
-02_date.imc, etc. These will dynamically load in the regex-compiler as
+regex-compiler.pbc. Then run ../../parrot 01_basic.pir, ../../parrot
+02_date.pir, etc. These will dynamically load in the regex-compiler as
the compiler for the "regex" language, and then use it to compile some
code and execute it.
@@ -121,7 +121,7 @@ default) as well. The second example wou
PIR.
Examples of using regex.pl to generate code that is compiled on the
-fly are in 01_basic.imc and 02_date.imc.
+fly are in 01_basic.pir and 02_date.pir.
If you use the -d flag, you'll get a very verbose description of the
matching progress as you run.
Modified: trunk/languages/regex/lib/Parrot/Test/Regex.pm
==============================================================================
--- trunk/languages/regex/lib/Parrot/Test/Regex.pm (original)
+++ trunk/languages/regex/lib/Parrot/Test/Regex.pm Wed Dec 28 11:24:35 2005
@@ -68,7 +68,7 @@ sub run_spec {
return 0;
}
-sub generate_regular_imc {
+sub generate_regular_pir {
my ($filename, $pattern) = @_;
open(PIR, ">$filename") or die "create $filename: $!";
@@ -94,8 +94,8 @@ END
}
sub generate_pbc {
- my ($imc, $pbc) = @_;
- my $status = system("$PARROT_EXE", "-o", $pbc, $imc);
+ my ($pir, $pbc) = @_;
+ my $status = system("$PARROT_EXE", "-o", $pbc, $pir);
if (! defined($status) || $status) {
die "assemble failed with status " . ($? >> 8);
}
@@ -104,7 +104,7 @@ sub generate_pbc {
sub generate_regular {
my $pattern = shift;
- generate_regular_imc("test_regex.pir", $pattern);
+ generate_regular_pir("test_regex.pir", $pattern);
generate_pbc("test_regex.pir", "test_regex.pbc");
}
Copied: trunk/languages/regex/regex-compiler.pir (from r10738,
trunk/languages/regex/regex-compiler.imc)
==============================================================================
--- trunk/languages/regex/regex-compiler.imc (original)
+++ trunk/languages/regex/regex-compiler.pir Wed Dec 28 11:24:35 2005
@@ -8,35 +8,35 @@
.param string code
.local int uniq
- .local string imcfile
+ .local string pirfile
.local string pir_data
.local string cmdline
uniq = time
- imcfile = "/tmp/regex-"
+ pirfile = "/tmp/regex-"
$S0 = uniq
- imcfile = concat $S0
- imcfile = concat ".imc"
+ pirfile = concat $S0
+ pirfile = concat ".pir"
cmdline = "regex.pl --sub-name=_regex -o "
- cmdline = concat imcfile
+ cmdline = concat pirfile
cmdline = concat " '"
cmdline = concat code
cmdline = concat "'"
$I0 = spawnw cmdline
- unless $I0 goto imc_to_pbc
- print "Failed to compile to .imc file.\n"
+ unless $I0 goto pir_to_pbc
+ print "Failed to compile to .pir file.\n"
# invoke P1
-imc_to_pbc:
- pir_data = _readfile(imcfile)
+pir_to_pbc:
+ pir_data = _readfile(pirfile)
$P0 = compreg "PIR"
$P1 = compile $P0, pir_data
# $P0 = compreg "FILE"
-# $P1 = $P0(imcfile)
-# $P1 = compile $P0, imcfile
+# $P1 = $P0(pirfile)
+# $P1 = compile $P0, pirfile
$P1 = find_global "_regex"
.return($P1)
Modified: trunk/languages/regex/test.pl
==============================================================================
--- trunk/languages/regex/test.pl (original)
+++ trunk/languages/regex/test.pl Wed Dec 28 11:24:35 2005
@@ -135,7 +135,7 @@ while (1) {
exit ($status ? 0 : 1);
-sub generate_regular_imc {
+sub generate_regular_pir {
my ($filename, $pattern) = @_;
open(PIR, ">$filename") or die "create $filename: $!";
@@ -161,8 +161,8 @@ END
}
sub generate_pbc {
- my ($imc, $pbc) = @_;
- my $status = system("$PARROT_EXE", "-o", $pbc, $imc);
+ my ($pir, $pbc) = @_;
+ my $status = system("$PARROT_EXE", "-o", $pbc, $pir);
if (! defined($status) || $status) {
die "assemble failed with status " . ($? >> 8);
}
@@ -170,7 +170,7 @@ sub generate_pbc {
sub generate_regular {
my $pattern = shift;
- generate_regular_imc("test_regex.pir", $pattern);
+ generate_regular_pir("test_regex.pir", $pattern);
generate_pbc("test_regex.pir", "test.pbc");
}