• R/O
  • SSH
  • HTTPS

jpl: Commit


Commit MetaInfo

Revision481 (tree)
Time2019-03-10 02:17:26
Authorjakobthomsen

Log Message

rename

Change Summary

Incremental Difference

--- trunk/experimental2/compiler.compiled.c (revision 480)
+++ trunk/experimental2/compiler.compiled.c (revision 481)
@@ -366,10 +366,10 @@
366366 mem_init();
367367 uint64_t result = 0; struct stack callstack = stack_alloc();
368368 stack_push(&callstack, 0); // end marker
369- uint64_t state = tuple2_alloc(/*main*/1835100526LLU, 0/*arg*/);
370- while(memory[tuple2_access0(state)].value)
369+ uint64_t stackframe = tuple2_alloc(/*main*/1835100526LLU, 0/*arg*/);
370+ while(memory[tuple2_access0(stackframe)].value)
371371 {
372- switch(memory[tuple2_access0(state)].value)
372+ switch(memory[tuple2_access0(stackframe)].value)
373373 {
374374 case /*intro*/452824691311LLU:
375375 {
@@ -748,13 +748,13 @@
748748 printf(" uint64_t result = 0;");
749749 printf(" struct stack callstack = stack_alloc();\n");
750750 printf(" stack_push(&callstack, 0); // end marker\n");
751- printf(" uint64_t state = tuple2_alloc(/*main*/1835100526LLU, 0/*arg*/);\n");
752- printf(" while(memory[tuple2_access0(state)].value)\n");
751+ printf(" uint64_t stackframe = tuple2_alloc(/*main*/1835100526LLU, 0/*arg*/);\n");
752+ printf(" while(memory[tuple2_access0(stackframe)].value)\n");
753753 printf(" {\n");
754- printf(" switch(memory[tuple2_access0(state)].value)\n");
754+ printf(" switch(memory[tuple2_access0(stackframe)].value)\n");
755755 printf(" {\n");
756- tuple2_free(state);
757- state = stack_pop(&callstack);
756+ tuple2_free(stackframe);
757+ stackframe = stack_pop(&callstack);
758758 stack_push(&callstack, result);
759759
760760 break;
@@ -763,13 +763,13 @@
763763 {
764764
765765 printf(" default:\n");
766- printf(" fprintf(stderr, \"no such state %%d\\n\", (int)memory[tuple2_access0(state)].value);\n");
767- printf(" return (int)memory[tuple2_access0(state)].value;\n");
768- printf(" // exit((int)memory[tuple2_access0(state)].value);\n");
766+ printf(" fprintf(stderr, \"no such stackframe %%d\\n\", (int)memory[tuple2_access0(stackframe)].value);\n");
767+ printf(" return (int)memory[tuple2_access0(stackframe)].value;\n");
768+ printf(" // exit((int)memory[tuple2_access0(stackframe)].value);\n");
769769 printf(" }\n");
770770 printf(" }\n");
771771 printf("\n");
772- printf(" tuple2_free(state);\n");
772+ printf(" tuple2_free(stackframe);\n");
773773 printf(" result = stack_pop(&callstack);\n");
774774 printf(" stack_free(&callstack);\n");
775775 printf(" mem_show();\n");
@@ -778,8 +778,8 @@
778778 printf(" return (int)result;\n");
779779 printf("}\n");
780780 printf("\n");
781- tuple2_free(state);
782- state = stack_pop(&callstack);
781+ tuple2_free(stackframe);
782+ stackframe = stack_pop(&callstack);
783783 stack_push(&callstack, result);
784784
785785 break;
@@ -793,8 +793,8 @@
793793 result <<= 8;
794794 result |= (uint64_t)((uint8_t)getchar());
795795 }
796- tuple2_free(state);
797- state = stack_pop(&callstack);
796+ tuple2_free(stackframe);
797+ stackframe = stack_pop(&callstack);
798798 stack_push(&callstack, result);
799799
800800 break;
@@ -801,9 +801,9 @@
801801 }
802802 case /*main*/1835100526LLU:
803803 {
804-/*intro*/memory[tuple2_access0(state)].value = 18446744073709551615LLU;
805- stack_push(&callstack, state);
806- state = tuple2_alloc(452824691311LLU, 0);
804+/*intro*/memory[tuple2_access0(stackframe)].value = 18446744073709551615LLU;
805+ stack_push(&callstack, stackframe);
806+ stackframe = tuple2_alloc(452824691311LLU, 0);
807807 result = 0;
808808 break;
809809 }
@@ -818,7 +818,7 @@
818818 while(isspace(c)) c = (uint32_t)getchar(); // skip WS
819819 if((unsigned int)c > 255)
820820 {
821- memory[tuple2_access0(state)].value = 0;
821+ memory[tuple2_access0(stackframe)].value = 0;
822822 break;
823823 }
824824 printf(" case ");
@@ -871,8 +871,8 @@
871871 {
872872 if(125 == c)
873873 {
874- printf("tuple2_free(state);\n");
875- printf(" state = stack_pop(&callstack);\n");
874+ printf("tuple2_free(stackframe);\n");
875+ printf(" stackframe = stack_pop(&callstack);\n");
876876 printf(" stack_push(&callstack, result);\n");
877877 break;
878878 }
@@ -879,9 +879,9 @@
879879 //else if(isdigit(c))
880880 //{
881881 // uint64_t dest = --tmpaddr;
882- // printf("memory[tuple2_access0(state)].value = %lldLL;\n", (long long)dest); // use negative to display numbers concisely
883- // printf(" stack_push(&callstack, state);\n");
884- // printf(" state = tuple2_alloc(%c", c);
882+ // printf("memory[tuple2_access0(stackframe)].value = %lldLL;\n", (long long)dest); // use negative to display numbers concisely
883+ // printf(" stack_push(&callstack, stackframe);\n");
884+ // printf(" stackframe = tuple2_alloc(%c", c);
885885 // while(isdigit(ungetc(getchar(), stdin))) putchar(getchar()); // echo label
886886 // printf(", 0);\n");
887887 // printf(" result = 0;\n");
@@ -906,9 +906,9 @@
906906 printf("*/");
907907
908908 uint64_t dest = --tmpaddr;
909- printf("memory[tuple2_access0(state)].value = %lluLLU;\n", (long long)dest); // use negative to display numbers concisely
910- printf(" stack_push(&callstack, state);\n");
911- printf(" state = tuple2_alloc(%lluLLU, 0);\n", (unsigned long long)id); // echo label
909+ printf("memory[tuple2_access0(stackframe)].value = %lluLLU;\n", (long long)dest); // use negative to display numbers concisely
910+ printf(" stack_push(&callstack, stackframe);\n");
911+ printf(" stackframe = tuple2_alloc(%lluLLU, 0);\n", (unsigned long long)id); // echo label
912912 printf(" result = 0;\n");
913913 printf(" break;\n");
914914 printf(" }\n");
@@ -938,10 +938,10 @@
938938 c = (uint32_t)getchar();
939939 }
940940
941- memory[tuple2_access0(state)].value = 0;
942- /*outro*/memory[tuple2_access0(state)].value = 18446744073709551614LLU;
943- stack_push(&callstack, state);
944- state = tuple2_alloc(478711935599LLU, 0);
941+ memory[tuple2_access0(stackframe)].value = 0;
942+ /*outro*/memory[tuple2_access0(stackframe)].value = 18446744073709551614LLU;
943+ stack_push(&callstack, stackframe);
944+ stackframe = tuple2_alloc(478711935599LLU, 0);
945945 result = 0;
946946 break;
947947 }
@@ -949,20 +949,20 @@
949949 {
950950 result = stack_pop(&callstack);
951951 result = 0;
952-tuple2_free(state);
953- state = stack_pop(&callstack);
952+tuple2_free(stackframe);
953+ stackframe = stack_pop(&callstack);
954954 stack_push(&callstack, result);
955955
956956 break;
957957 }
958958 default:
959- fprintf(stderr, "no such state %d\n", (int)memory[tuple2_access0(state)].value);
960- return (int)memory[tuple2_access0(state)].value;
961- // exit((int)memory[tuple2_access0(state)].value);
959+ fprintf(stderr, "no such stackframe %d\n", (int)memory[tuple2_access0(stackframe)].value);
960+ return (int)memory[tuple2_access0(stackframe)].value;
961+ // exit((int)memory[tuple2_access0(stackframe)].value);
962962 }
963963 }
964964
965- tuple2_free(state);
965+ tuple2_free(stackframe);
966966 result = stack_pop(&callstack);
967967 stack_free(&callstack);
968968 mem_show();
--- trunk/experimental2/compiler.source.c (revision 480)
+++ trunk/experimental2/compiler.source.c (revision 481)
@@ -375,10 +375,10 @@
375375 printf(" uint64_t result = 0;");
376376 printf(" struct stack callstack = stack_alloc();\n");
377377 printf(" stack_push(&callstack, 0); // end marker\n");
378- printf(" uint64_t state = tuple2_alloc(/*main*/1835100526LLU, 0/*arg*/);\n");
379- printf(" while(memory[tuple2_access0(state)].value)\n");
378+ printf(" uint64_t stackframe = tuple2_alloc(/*main*/1835100526LLU, 0/*arg*/);\n");
379+ printf(" while(memory[tuple2_access0(stackframe)].value)\n");
380380 printf(" {\n");
381- printf(" switch(memory[tuple2_access0(state)].value)\n");
381+ printf(" switch(memory[tuple2_access0(stackframe)].value)\n");
382382 printf(" {\n");
383383 `
384384 }
@@ -387,13 +387,13 @@
387387 {
388388 `
389389 printf(" default:\n");
390- printf(" fprintf(stderr, \"no such state %%d\\n\", (int)memory[tuple2_access0(state)].value);\n");
391- printf(" return (int)memory[tuple2_access0(state)].value;\n");
392- printf(" // exit((int)memory[tuple2_access0(state)].value);\n");
390+ printf(" fprintf(stderr, \"no such stackframe %%d\\n\", (int)memory[tuple2_access0(stackframe)].value);\n");
391+ printf(" return (int)memory[tuple2_access0(stackframe)].value;\n");
392+ printf(" // exit((int)memory[tuple2_access0(stackframe)].value);\n");
393393 printf(" }\n");
394394 printf(" }\n");
395395 printf("\n");
396- printf(" tuple2_free(state);\n");
396+ printf(" tuple2_free(stackframe);\n");
397397 printf(" result = stack_pop(&callstack);\n");
398398 printf(" stack_free(&callstack);\n");
399399 printf(" mem_show();\n");
@@ -428,7 +428,7 @@
428428 while(isspace(c)) c = (uint32_t)getchar(); // skip WS
429429 if((unsigned int)c > 255)
430430 {
431- memory[tuple2_access0(state)].value = 0;
431+ memory[tuple2_access0(stackframe)].value = 0;
432432 break;
433433 }
434434 printf(" case ");
@@ -481,8 +481,8 @@
481481 {
482482 if(125 == c)
483483 {
484- printf("tuple2_free(state);\n");
485- printf(" state = stack_pop(&callstack);\n");
484+ printf("tuple2_free(stackframe);\n");
485+ printf(" stackframe = stack_pop(&callstack);\n");
486486 printf(" stack_push(&callstack, result);\n");
487487 break;
488488 }
@@ -489,9 +489,9 @@
489489 //else if(isdigit(c))
490490 //{
491491 // uint64_t dest = --tmpaddr;
492- // printf("memory[tuple2_access0(state)].value = %lldLL;\n", (long long)dest); // use negative to display numbers concisely
493- // printf(" stack_push(&callstack, state);\n");
494- // printf(" state = tuple2_alloc(%c", c);
492+ // printf("memory[tuple2_access0(stackframe)].value = %lldLL;\n", (long long)dest); // use negative to display numbers concisely
493+ // printf(" stack_push(&callstack, stackframe);\n");
494+ // printf(" stackframe = tuple2_alloc(%c", c);
495495 // while(isdigit(ungetc(getchar(), stdin))) putchar(getchar()); // echo label
496496 // printf(", 0);\n");
497497 // printf(" result = 0;\n");
@@ -516,9 +516,9 @@
516516 printf("*/");
517517
518518 uint64_t dest = --tmpaddr;
519- printf("memory[tuple2_access0(state)].value = %lluLLU;\n", (long long)dest); // use negative to display numbers concisely
520- printf(" stack_push(&callstack, state);\n");
521- printf(" state = tuple2_alloc(%lluLLU, 0);\n", (unsigned long long)id); // echo label
519+ printf("memory[tuple2_access0(stackframe)].value = %lluLLU;\n", (long long)dest); // use negative to display numbers concisely
520+ printf(" stack_push(&callstack, stackframe);\n");
521+ printf(" stackframe = tuple2_alloc(%lluLLU, 0);\n", (unsigned long long)id); // echo label
522522 printf(" result = 0;\n");
523523 printf(" break;\n");
524524 printf(" }\n");
@@ -548,7 +548,7 @@
548548 c = (uint32_t)getchar();
549549 }
550550
551- memory[tuple2_access0(state)].value = 0;
551+ memory[tuple2_access0(stackframe)].value = 0;
552552 `
553553 outro
554554
Show on old repository browser