Skip to content
Snippets Groups Projects
Commit c3062bcc authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Now works again.

This file should probably be somewhere else.

Rev: lib/modules/LR.pmod/lr.pike:1.2
parent 2ca6b72a
Branches
Tags
No related merge requests found
#!/home/grubba/src/pike/build/sol2.5/pike #!/usr/local/bin/pike
/* /*
* $Id: lr.pike,v 1.1 1997/03/03 23:50:17 grubba Exp $ * $Id: lr.pike,v 1.2 1998/04/22 19:48:45 grubba Exp $
* *
* An LR(1) Parser in Pike * An LR(1) Parser in Pike
* *
...@@ -114,7 +114,7 @@ string a_init(string ... args) ...@@ -114,7 +114,7 @@ string a_init(string ... args)
{ {
if (sizeof(args)) { if (sizeof(args)) {
werror(sprintf("Reducing %s => \"%s\"\n", werror(sprintf("Reducing %s => \"%s\"\n",
map(args, g->symbol_to_string) * ", ", Array.map(args, g->symbol_to_string) * ", ",
args * "")); args * ""));
return (`+(@args)); return (`+(@args));
} else { } else {
...@@ -141,7 +141,7 @@ void create() ...@@ -141,7 +141,7 @@ void create()
{ {
g = parser(); g = parser();
g->symbol_to_string = symbol_to_string; g->set_symbol_to_string(symbol_to_string);
#if 0 #if 0
foreach (g_init, array(string|int) i) { foreach (g_init, array(string|int) i) {
...@@ -203,9 +203,7 @@ int main(int argc, string *argv) ...@@ -203,9 +203,7 @@ int main(int argc, string *argv)
werror(sprintf("Memory usage:\n%O\n", _memory_usage())); werror(sprintf("Memory usage:\n%O\n", _memory_usage()));
#endif #endif
g->scanner=scanner; result = g->parse(scanner->scan);
result = g->parse();
werror(sprintf("Result of parsing: \"%s\"\n", result + "")); werror(sprintf("Result of parsing: \"%s\"\n", result + ""));
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment