Mercurial > repos > rhope
comparison parser.vistxt @ 47:6202b866d72c
Cleaned up constructor names and merged some other changes in to support the Rhope website
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 22 Dec 2009 01:22:09 -0500 |
parents | 640f541e9116 |
children |
comparison
equal
deleted
inserted
replaced
46:429b5f441381 | 47:6202b866d72c |
---|---|
67 ]Import <<["Import"] | 67 ]Import <<["Import"] |
68 ]Blueprint <<["Blueprint"] | 68 ]Blueprint <<["Blueprint"] |
69 ]Global Separator <<["::"] | 69 ]Global Separator <<["::"] |
70 ]Hex Escape <<["x"] | 70 ]Hex Escape <<["x"] |
71 ]Uses <<["uses"] | 71 ]Uses <<["uses"] |
72 ]Escape Map <<[[[[New@Dictionary[]]Set["n","\n"]]Set["r","\r"]]Set["t","\t"]] | 72 ]Escape Map <<[[[[Dictionary[]]Set["n","\n"]]Set["r","\r"]]Set["t","\t"]] |
73 :| | 73 :| |
74 | 74 |
75 Company Output Reference | 75 Company Output Reference |
76 |: | 76 |: |
77 Index | 77 Index |
85 | 85 |
86 Add Pipe Reference(3,1) | 86 Add Pipe Reference(3,1) |
87 |: | 87 |: |
88 reflist <- [refs(0)]Index[name(1)] |::| | 88 reflist <- [refs(0)]Index[name(1)] |::| |
89 |: | 89 |: |
90 reflist <- New@List[] | 90 reflist <- List[] |
91 :| | 91 :| |
92 out(0) <- [refs(0)]Set[name(1), [reflist]Append[reference(2)]] | 92 out(0) <- [refs(0)]Set[name(1), [reflist]Append[reference(2)]] |
93 :| | 93 :| |
94 | 94 |
95 Assignment Save Reference(5,1) | 95 Assignment Save Reference(5,1) |
111 :| | 111 :| |
112 | 112 |
113 New@Parse Program(0,1) | 113 New@Parse Program(0,1) |
114 |: | 114 |: |
115 out(0) <- [[[Build["Parse Program"] | 115 out(0) <- [[[Build["Parse Program"] |
116 ]Workers <<[New@Dictionary[]] | 116 ]Workers <<[Dictionary[]] |
117 ]Imports <<[New@Dictionary[]] | 117 ]Imports <<[Dictionary[]] |
118 ]Blueprints <<[New@Dictionary[]] | 118 ]Blueprints <<[Dictionary[]] |
119 :| | 119 :| |
120 | 120 |
121 Company Blueprint Definition | 121 Company Blueprint Definition |
122 |: | 122 |: |
123 Name | 123 Name |
139 Uses Stores | 139 Uses Stores |
140 :| | 140 :| |
141 | 141 |
142 New@Parse Worker(4,1) | 142 New@Parse Worker(4,1) |
143 |: | 143 |: |
144 out(0) <- [[[[[[Build["Parse Worker"]]Name <<[name(0)]]Inputs <<[inputs(1)]]Outputs <<[outputs(2)]]Line Number <<[line(3)]]Trees <<[New@List[]]]Uses Stores <<[New@List[]] | 144 out(0) <- [[[[[[Build["Parse Worker"]]Name <<[name(0)]]Inputs <<[inputs(1)]]Outputs <<[outputs(2)]]Line Number <<[line(3)]]Trees <<[List[]]]Uses Stores <<[List[]] |
145 :| | 145 :| |
146 | 146 |
147 Company Worker Node | 147 Company Worker Node |
148 |: | 148 |: |
149 Name | 149 Name |
153 Index | 153 Index |
154 :| | 154 :| |
155 | 155 |
156 New@Worker Node(2,1) | 156 New@Worker Node(2,1) |
157 |: | 157 |: |
158 out(0) <- [[[[Build["Worker Node"]]Name <<[name(0)]]Params <<[params(1)]]Assignments <<[New@List[]]]Blocks <<[New@List[]] | 158 out(0) <- [[[[Build["Worker Node"]]Name <<[name(0)]]Params <<[params(1)]]Assignments <<[List[]]]Blocks <<[List[]] |
159 :| | 159 :| |
160 | 160 |
161 Add List Helper(6,3) | 161 Add List Helper(6,3) |
162 |: | 162 |: |
163 ,nextworker,nextrefs <- [[list(0)]Index[key(3)]]Add to Worker[worker(1), program(2), parse worker(4), refs(5)] | 163 ,nextworker,nextrefs <- [[list(0)]Index[key(3)]]Add to Worker[worker(1), program(2), parse worker(4), refs(5)] |
349 has block(0) <- Yes | 349 has block(0) <- Yes |
350 :| | 350 :| |
351 | 351 |
352 New@Field Node(3,1) | 352 New@Field Node(3,1) |
353 |: | 353 |: |
354 out(0) <- [[[[[Build["Field Node"]]Name <<[name(0)]]Assignments <<[New@List[]]]Blocks <<[New@List[]]]Set? <<[set(2)]]Params <<[params(1)] | 354 out(0) <- [[[[[Build["Field Node"]]Name <<[name(0)]]Assignments <<[List[]]]Blocks <<[List[]]]Set? <<[set(2)]]Params <<[params(1)] |
355 :| | 355 :| |
356 | 356 |
357 Add to Worker@Field Node(5,3) | 357 Add to Worker@Field Node(5,3) |
358 |: | 358 |: |
359 If[[node(0)]Set? >>] | 359 If[[node(0)]Set? >>] |
403 :| | 403 :| |
404 :| | 404 :| |
405 | 405 |
406 New@Named Pipe Node(1,1) | 406 New@Named Pipe Node(1,1) |
407 |: | 407 |: |
408 out(0) <- [[[Build["Named Pipe Node"]]Name <<[name(0)]]Assignments <<[New@List[]]]Blocks <<[New@List[]] | 408 out(0) <- [[[Build["Named Pipe Node"]]Name <<[name(0)]]Assignments <<[List[]]]Blocks <<[List[]] |
409 :| | 409 :| |
410 | 410 |
411 Add to Worker@Named Pipe Node(5,3) | 411 Add to Worker@Named Pipe Node(5,3) |
412 |: | 412 |: |
413 [[parse worker(3)]Inputs >>]Find[[node(0)]Name >>] | 413 [[parse worker(3)]Inputs >>]Find[[node(0)]Name >>] |
476 Index | 476 Index |
477 :| | 477 :| |
478 | 478 |
479 New@Global Node(2,1) | 479 New@Global Node(2,1) |
480 |: | 480 |: |
481 out(0) <- [[[[Build["Global Node"]]Store <<[store(0)]]Name <<[name(1)]]Assignments <<[New@List[]]]Blocks <<[New@List[]] | 481 out(0) <- [[[[Build["Global Node"]]Store <<[store(0)]]Name <<[name(1)]]Assignments <<[List[]]]Blocks <<[List[]] |
482 :| | 482 :| |
483 | 483 |
484 Add to Worker@Global Node(5,3) | 484 Add to Worker@Global Node(5,3) |
485 |: | 485 |: |
486 out worker(1) <- [worker(1)]Add Global Get[[node(0)]Store >>, [node(0)]Name >>] |::| | 486 out worker(1) <- [worker(1)]Add Global Get[[node(0)]Store >>, [node(0)]Name >>] |::| |
514 out(0) <- Yes | 514 out(0) <- Yes |
515 :| | 515 :| |
516 | 516 |
517 New@Literal Node(1,1) | 517 New@Literal Node(1,1) |
518 |: | 518 |: |
519 out(0) <- [[[Build["Literal Node"]]Value <<[value(0)]]Assignments <<[New@List[]]]Blocks <<[New@List[]] | 519 out(0) <- [[[Build["Literal Node"]]Value <<[value(0)]]Assignments <<[List[]]]Blocks <<[List[]] |
520 :| | 520 :| |
521 | 521 |
522 Add to Worker@Literal Node(5,3) | 522 Add to Worker@Literal Node(5,3) |
523 |: | 523 |: |
524 out worker(1) <- [worker(1)]Add Constant[[node(0)]Value >>] |::| | 524 out worker(1) <- [worker(1)]Add Constant[[node(0)]Value >>] |::| |
597 | 597 |
598 Block Comment(4,1) | 598 Block Comment(4,1) |
599 |: | 599 |: |
600 If[[block count(3)] > [0]] | 600 If[[block count(3)] > [0]] |
601 |: | 601 |: |
602 after, before <- [string(0)]Get DString[[[New@List[]]Append[begin comment(1)]]Append[end comment(2)]] |::| |::| | 602 after, before <- [string(0)]Get DString[[[List[]]Append[begin comment(1)]]Append[end comment(2)]] |::| |::| |
603 |: | 603 |: |
604 If[[~] = [begin comment(1)]] | 604 If[[~] = [begin comment(1)]] |
605 |: | 605 |: |
606 out(0) <- Block Comment[after, begin comment(1), end comment(2), [block count(3)]+[1]] | 606 out(0) <- Block Comment[after, begin comment(1), end comment(2), [block count(3)]+[1]] |
607 :||: | 607 :||: |
684 out(0) <- Val[trimmed] | 684 out(0) <- Val[trimmed] |
685 :| | 685 :| |
686 :| | 686 :| |
687 :| | 687 :| |
688 | 688 |
689 Blueprint(4,1) | 689 PBlueprint(4,1) |
690 |: | 690 |: |
691 ,whitespace name <- [string(0)]Get Comment DString[[params(1)]Block Begin >>, params(1)] | 691 ,whitespace name <- [string(0)]Get Comment DString[[params(1)]Block Begin >>, params(1)] |
692 |: | 692 |: |
693 ,no blueprint <- [whitespace name]Slice[ [[params(1)]Blueprint >>]Length ] | 693 ,no blueprint <- [whitespace name]Slice[ [[params(1)]Blueprint >>]Length ] |
694 name <- Trim[no blueprint, "\r\n\t "] | 694 name <- Trim[no blueprint, "\r\n\t "] |
695 name lines <- 0//[Count Substring[left, "\n"]] + [Count Substring[right, "\n"]] | 695 name lines <- 0//[Count Substring[left, "\n"]] + [Count Substring[right, "\n"]] |
696 ,body <- [~]Get Comment DString[ [params(1)]Block End >>, params(1)] | 696 ,body <- [~]Get Comment DString[ [params(1)]Block End >>, params(1)] |
697 |: | 697 |: |
698 body lines <- [body]Split["\n"] | 698 body lines <- [body]Split["\n"] |
699 more lines <- [[[body lines]Length] - [1]] + [name lines] | 699 more lines <- [[[body lines]Length] - [1]] + [name lines] |
700 fields <- Fold[["Process Blueprint Field"]Set Input[2, [params(1)]Blueprint Type Delim >>], New@List[], Filter[Map[body lines, ["Trim"]Set Input[1,"\n\r\t "]], "Filter Empty"]] | 700 fields <- Fold[["Process Blueprint Field"]Set Input[2, [params(1)]Blueprint Type Delim >>], List[], Filter[Map[body lines, ["Trim"]Set Input[1,"\n\r\t "]], "Filter Empty"]] |
701 new tree <- [tree(2)]Blueprints << [ [[tree(2)]Blueprints >>]Set[name, New@Blueprint Definition[name, fields]] ] | 701 new tree <- [tree(2)]Blueprints << [ [[tree(2)]Blueprints >>]Set[name, New@Blueprint Definition[name, fields]] ] |
702 out(0) <- Null[~, params(1), new tree, [lines(3)] + [more lines]] | 702 out(0) <- Null[~, params(1), new tree, [lines(3)] + [more lines]] |
703 :| |::| |: | 703 :| |::| |: |
704 out(0) <- [tree(2)]Errors <<[ [[tree(2)]Errors >>]Append[New@Parse Error["Error",[["Blueprint is missing an block close symbol \""]Append[[params(1)]Block End >>]]Append["\""], lines(3)]] ] | 704 out(0) <- [tree(2)]Errors <<[ [[tree(2)]Errors >>]Append[New@Parse Error["Error",[["Blueprint is missing an block close symbol \""]Append[[params(1)]Block End >>]]Append["\""], lines(3)]] ] |
705 :| | 705 :| |
728 |: | 728 |: |
729 check block <- Comment Left Trim[string(0), "\n\r\t ", params(1)] | 729 check block <- Comment Left Trim[string(0), "\n\r\t ", params(1)] |
730 If[[check block]Starts With[[params(1)]Block Begin >>]] | 730 If[[check block]Starts With[[params(1)]Block Begin >>]] |
731 |: | 731 |: |
732 ,begin block <- [check block]Slice[[[params(1)]Block Begin >>]Length] | 732 ,begin block <- [check block]Slice[[[params(1)]Block Begin >>]Length] |
733 trees, after block <- Worker Body[begin block, params(1), New@List[]] | 733 trees, after block <- Worker Body[begin block, params(1), List[]] |
734 blocks(0), after(1) <- Get Expression Blocks[after block, params(1), [blocks(2)]Append[trees]] | 734 blocks(0), after(1) <- Get Expression Blocks[after block, params(1), [blocks(2)]Append[trees]] |
735 :||: | 735 :||: |
736 If[[check block]Starts With[[params(1)]Empty Block >>]] | 736 If[[check block]Starts With[[params(1)]Empty Block >>]] |
737 |: | 737 |: |
738 blocks(0) <- blocks(2) | 738 blocks(0) <- blocks(2) |
760 :| | 760 :| |
761 :| | 761 :| |
762 | 762 |
763 Parse String(3,2) | 763 Parse String(3,2) |
764 |: | 764 |: |
765 delims <- [[New@List[]]Append[[params(1)]String End >>]]Append[[params(1)]String Escape >>] | 765 delims <- [[List[]]Append[[params(1)]String End >>]]Append[[params(1)]String Escape >>] |
766 after, before, delim <- [string(0)]Get Comment DString[delims, params(1)] | 766 after, before, delim <- [string(0)]Get Comment DString[delims, params(1)] |
767 |: | 767 |: |
768 If[[delim] = [[params(1)]String End >>]] | 768 If[[delim] = [[params(1)]String End >>]] |
769 |: | 769 |: |
770 value(0) <- [current(2)]Append[before] | 770 value(0) <- [current(2)]Append[before] |
837 value,after(1) <- Parse String[string begin, params(1), ""] | 837 value,after(1) <- Parse String[string begin, params(1), ""] |
838 :||: | 838 :||: |
839 If[[name]Starts With[[params(1)]List Begin >>]] | 839 If[[name]Starts With[[params(1)]List Begin >>]] |
840 |: | 840 |: |
841 ,list start <- [name]Slice[[[params(1)]List Begin >>]Length] | 841 ,list start <- [name]Slice[[[params(1)]List Begin >>]Length] |
842 value,after(1) <- Parse List[list start, params(1), New@List[]] | 842 value,after(1) <- Parse List[list start, params(1), List[]] |
843 :||: | 843 :||: |
844 If[[[name]Slice[1]]In["-0123456789"]] | 844 If[[[name]Slice[1]]In["-0123456789"]] |
845 |: | 845 |: |
846 value,after(1) <- Parse Number[name, params(1)] | 846 value,after(1) <- Parse Number[name, params(1)] |
847 :||: | 847 :||: |
931 expression(0) <- Worker or Field[name(2), more args, params(1)] | 931 expression(0) <- Worker or Field[name(2), more args, params(1)] |
932 :| | 932 :| |
933 | 933 |
934 Postfix or Infix(2,2) | 934 Postfix or Infix(2,2) |
935 |: | 935 |: |
936 args, after args <- Parse Arguments[string(0), params(1), New@List[]] | 936 args, after args <- Parse Arguments[string(0), params(1), List[]] |
937 delims <- [[[[[{"\n"}]Append[[params(1)]Arg Begin >>]]Append[[params(1)]Empty Block >>]]Append[[params(1)]Block Begin >>]]Append[[params(1)]Arg End >>]]Append[[params(1)]List Delim >>] | 937 delims <- [[[[[{"\n"}]Append[[params(1)]Arg Begin >>]]Append[[params(1)]Empty Block >>]]Append[[params(1)]Block Begin >>]]Append[[params(1)]Arg End >>]]Append[[params(1)]List Delim >>] |
938 after,before,delim <- [after args]Get Comment DString[delims, params(1)] | 938 after,before,delim <- [after args]Get Comment DString[delims, params(1)] |
939 |: | 939 |: |
940 If[[delim] = [[params(1)]Arg Begin >>]] | 940 If[[delim] = [[params(1)]Arg Begin >>]] |
941 |: | 941 |: |
969 If[[maybe name]Contains[[params(1)]List Delim >>]] | 969 If[[maybe name]Contains[[params(1)]List Delim >>]] |
970 |: | 970 |: |
971 after expression <- [after literal]Append[[delim]Append[after]] | 971 after expression <- [after literal]Append[[delim]Append[after]] |
972 expression, after literal <- Named Pipe or Literal[Right Trim[before, "\r\n\t "], params(1)] | 972 expression, after literal <- Named Pipe or Literal[Right Trim[before, "\r\n\t "], params(1)] |
973 :||: | 973 :||: |
974 expression, after expression <- Prefix[after, params(1), maybe name, New@List[]] | 974 expression, after expression <- Prefix[after, params(1), maybe name, List[]] |
975 :| | 975 :| |
976 :| | 976 :| |
977 :||: | 977 :||: |
978 If[[delim] = [[params(1)]Assign >>]] | 978 If[[delim] = [[params(1)]Assign >>]] |
979 |: | 979 |: |
1001 expression, after expression <- Named Pipe or Literal[trimmed(0), params(1)] | 1001 expression, after expression <- Named Pipe or Literal[trimmed(0), params(1)] |
1002 :| | 1002 :| |
1003 :| | 1003 :| |
1004 //Any expression can be followed by one or more blocks mapping the inputs of other expressions | 1004 //Any expression can be followed by one or more blocks mapping the inputs of other expressions |
1005 //to the outputs of the current one | 1005 //to the outputs of the current one |
1006 blocks,after blocks(1) <- Get Expression Blocks[after expression, params(1), New@List[]] | 1006 blocks,after blocks(1) <- Get Expression Blocks[after expression, params(1), List[]] |
1007 final expression(0) <- [expression]Blocks <<[blocks] | 1007 final expression(0) <- [expression]Blocks <<[blocks] |
1008 :| | 1008 :| |
1009 :| | 1009 :| |
1010 | 1010 |
1011 Worker Body(3,2) | 1011 Worker Body(3,2) |
1041 ,whitespace name <- [string(0)]Get Comment DString[[params(1)]Arg Begin >>, params(1)] | 1041 ,whitespace name <- [string(0)]Get Comment DString[[params(1)]Arg Begin >>, params(1)] |
1042 |: | 1042 |: |
1043 worker name <- Trim[whitespace name, "\n\r\t "] | 1043 worker name <- Trim[whitespace name, "\n\r\t "] |
1044 in out <- [params(1)]In Out Delim >> | 1044 in out <- [params(1)]In Out Delim >> |
1045 arg end <- [params(1)]Arg End >> | 1045 arg end <- [params(1)]Arg End >> |
1046 delims <- [[New@List[]]Append[in out]]Append[arg end] | 1046 delims <- [[List[]]Append[in out]]Append[arg end] |
1047 after <- [~]Get Comment DString[delims, params(1)] |::| | 1047 after <- [~]Get Comment DString[delims, params(1)] |::| |
1048 |: | 1048 |: |
1049 arglist <- Trim[~,"\r\n\t "] | 1049 arglist <- Trim[~,"\r\n\t "] |
1050 :||: | 1050 :||: |
1051 //check if there is an in/out separator | 1051 //check if there is an in/out separator |
1065 | 1065 |
1066 New@Parse Worker[worker name, inputs, outputs, 0] | 1066 New@Parse Worker[worker name, inputs, outputs, 0] |
1067 |: | 1067 |: |
1068 body text, modifiers <- [after arglist]Get Comment DString[[params(1)]Block Begin >>, params(1)] | 1068 body text, modifiers <- [after arglist]Get Comment DString[[params(1)]Block Begin >>, params(1)] |
1069 modified <- Process Modifiers[~, params(1), modifiers] | 1069 modified <- Process Modifiers[~, params(1), modifiers] |
1070 expression trees, after body <- Worker Body[body text, params(1), New@List[]] | 1070 expression trees, after body <- Worker Body[body text, params(1), List[]] |
1071 worker <- [modified]Trees <<[expression trees] | 1071 worker <- [modified]Trees <<[expression trees] |
1072 new worker dict <- [[tree(2)]Workers >>]Set[worker name, worker] | 1072 new worker dict <- [[tree(2)]Workers >>]Set[worker name, worker] |
1073 out(0) <- Null[after body, params(1), [tree(2)]Workers <<[new worker dict], 0] | 1073 out(0) <- Null[after body, params(1), [tree(2)]Workers <<[new worker dict], 0] |
1074 :| | 1074 :| |
1075 :| | 1075 :| |
1082 |: | 1082 |: |
1083 trimmed <- Comment Left Trim[string(0), " \n\r\t", params(1)] | 1083 trimmed <- Comment Left Trim[string(0), " \n\r\t", params(1)] |
1084 current line <- 0//[lines(3)] + [Count Substring[whitespace, "\n"]] | 1084 current line <- 0//[lines(3)] + [Count Substring[whitespace, "\n"]] |
1085 If[[trimmed]Starts With[ [params(1)]Blueprint >> ]] | 1085 If[[trimmed]Starts With[ [params(1)]Blueprint >> ]] |
1086 |: | 1086 |: |
1087 out(0) <- Blueprint[trimmed, params(1), tree(2), current line] | 1087 out(0) <- PBlueprint[trimmed, params(1), tree(2), current line] |
1088 :||: | 1088 :||: |
1089 If[[trimmed]Starts With[ [params(1)]Import >> ]] | 1089 If[[trimmed]Starts With[ [params(1)]Import >> ]] |
1090 |: | 1090 |: |
1091 out(0) <- Parse Import[trimmed, params(1), tree(2), current line] | 1091 out(0) <- Parse Import[trimmed, params(1), tree(2), current line] |
1092 :||: | 1092 :||: |
1107 :| | 1107 :| |
1108 :| | 1108 :| |
1109 | 1109 |
1110 Add Wires Helper(5,1) | 1110 Add Wires Helper(5,1) |
1111 |: | 1111 |: |
1112 worker(0) <- [node(1)]Add Wires[worker(0), New@List[], parse worker(3), assignments(4)] | 1112 worker(0) <- [node(1)]Add Wires[worker(0), List[], parse worker(3), assignments(4)] |
1113 :| | 1113 :| |
1114 | 1114 |
1115 Add Contents(3,2) | 1115 Add Contents(3,2) |
1116 |: | 1116 |: |
1117 worker <- [[program(2)]Find Worker[name(1)]]Uses[[parse worker(0)]Uses Stores >>] | 1117 worker <- [[program(2)]Find Worker[name(1)]]Uses[[parse worker(0)]Uses Stores >>] |
1118 trees, contents worker, refs <- Add List to Worker[[parse worker(0)]Trees >>, worker, program(2), parse worker(0), New@Dictionary[]] | 1118 trees, contents worker, refs <- Add List to Worker[[parse worker(0)]Trees >>, worker, program(2), parse worker(0), Dictionary[]] |
1119 Fold[[["Add Wires Helper"]Set Input[3, parse worker(0)]]Set Input[4, refs], contents worker, trees] | 1119 Fold[[["Add Wires Helper"]Set Input[3, parse worker(0)]]Set Input[4, refs], contents worker, trees] |
1120 out(0) <- [parse worker(0)]Trees <<[trees] | 1120 out(0) <- [parse worker(0)]Trees <<[trees] |
1121 key(1) <- name(1) | 1121 key(1) <- name(1) |
1122 :| | 1122 :| |
1123 | 1123 |
1145 out(0) <- prog | 1145 out(0) <- prog |
1146 :| | 1146 :| |
1147 | 1147 |
1148 Tree to Program(1,1) | 1148 Tree to Program(1,1) |
1149 |: | 1149 |: |
1150 out(0) <- _Tree to Program[parse tree(0), [New@Program[]]Add Builtins] | 1150 out(0) <- _Tree to Program[parse tree(0), [Program[]]Add Builtins] |
1151 :| | 1151 :| |
1152 | 1152 |
1153 Needs Imports(3,1) | 1153 Needs Imports(3,1) |
1154 |: | 1154 |: |
1155 If[not imported?(1)] | 1155 If[not imported?(1)] |
1168 out(0) <- [after import]Imports <<[ [[after import]Imports >>]Set[file name(1), No] ] | 1168 out(0) <- [after import]Imports <<[ [[after import]Imports >>]Set[file name(1), No] ] |
1169 :| | 1169 :| |
1170 | 1170 |
1171 Process Imports(2,1) | 1171 Process Imports(2,1) |
1172 |: | 1172 |: |
1173 needs import <- Fold["Needs Imports", New@List[], [parse tree(0)]Imports >>] | 1173 needs import <- Fold["Needs Imports", List[], [parse tree(0)]Imports >>] |
1174 If[[[needs import]Length] > [0]] | 1174 If[[[needs import]Length] > [0]] |
1175 |: | 1175 |: |
1176 import tree <- Fold[["Do Import"]Set Input[3, params(1)], parse tree(0), needs import] | 1176 import tree <- Fold[["Do Import"]Set Input[3, params(1)], parse tree(0), needs import] |
1177 out(0) <- Process Imports[import tree, params(1)] | 1177 out(0) <- Process Imports[import tree, params(1)] |
1178 :||: | 1178 :||: |
1232 import tree <- Process Imports[~, params(0)] | 1232 import tree <- Process Imports[~, params(0)] |
1233 Init Used Stores[import tree, stores(2)] | 1233 Init Used Stores[import tree, stores(2)] |
1234 |: _REPL[params(0), _Tree to Program[import tree, prog(1)], ~] :| | 1234 |: _REPL[params(0), _Tree to Program[import tree, prog(1)], ~] :| |
1235 :| | 1235 :| |
1236 :||: | 1236 :||: |
1237 trees <- Worker Body[[line]Append["}"], params(0), New@List[]] | 1237 trees <- Worker Body[[line]Append["}"], params(0), List[]] |
1238 tree <- [New@Worker Node["Val", [New@List[]]Append[[trees]Index[0]]]]Assignments <<[{"__out"}] | 1238 tree <- [New@Worker Node["Val", [List[]]Append[[trees]Index[0]]]]Assignments <<[{"__out"}] |
1239 this stores <- [[tree]Gather Stores[params(0), New@Dictionary[]]]Keys | 1239 this stores <- [[tree]Gather Stores[params(0), Dictionary[]]]Keys |
1240 next stores <- Fold["_Init Used Store", stores(2), this stores] | 1240 next stores <- Fold["_Init Used Store", stores(2), this stores] |
1241 |: | 1241 |: |
1242 pworker <- [[New@Parse Worker["__Eval", New@List[], {"__out"}, 0]]Trees <<[[New@List[]]Append[tree]]]Uses Stores <<[this stores] | 1242 pworker <- [[New@Parse Worker["__Eval", List[], {"__out"}, 0]]Trees <<[[List[]]Append[tree]]]Uses Stores <<[this stores] |
1243 :| | 1243 :| |
1244 [[prog(1)]Find Worker["__Eval"]]Clear | 1244 [[prog(1)]Find Worker["__Eval"]]Clear |
1245 |: Add Contents[pworker, "__Eval", prog(1)] | 1245 |: Add Contents[pworker, "__Eval", prog(1)] |
1246 |: Pretty Print[[[[prog(1)]Find Worker["__Eval"]]Do[New@List[]]]Index[0], ""] | 1246 |: Pretty Print[[[[prog(1)]Find Worker["__Eval"]]Do[List[]]]Index[0], ""] |
1247 |: _REPL[params(0), prog(1), next stores] :| :| :| | 1247 |: _REPL[params(0), prog(1), next stores] :| :| :| |
1248 :| | 1248 :| |
1249 :| | 1249 :| |
1250 :| | 1250 :| |
1251 | 1251 |
1252 REPL(1,0) | 1252 REPL(1,0) |
1253 |: | 1253 |: |
1254 Print["Rhope Alpha 2\nCopyright 2008 by Michael Pavone\nEntering interactive mode\n"] | 1254 Print["Rhope Alpha 2\nCopyright 2008 by Michael Pavone\nEntering interactive mode\n"] |
1255 prog <- Tree to Program[Null["Val[in:out]\n{\n out <- in\n}\n__Eval[:__out]\n{\n}\n", params(0), New@Parse Program[], 0]] | 1255 prog <- Tree to Program[Null["Val[in:out]\n{\n out <- in\n}\n__Eval[:__out]\n{\n}\n", params(0), New@Parse Program[], 0]] |
1256 _REPL[params(0), prog, New@Dictionary[]] | 1256 _REPL[params(0), prog, Dictionary[]] |
1257 :| | 1257 :| |
1258 | 1258 |
1259 Add If Store(3,1) | 1259 Add If Store(3,1) |
1260 |: | 1260 |: |
1261 If[[name(1)]Contains[[params(2)]Global Separator >>]] | 1261 If[[name(1)]Contains[[params(2)]Global Separator >>]] |
1311 ,text <- [file]Get FString[[file]Length] | 1311 ,text <- [file]Get FString[[file]Length] |
1312 params <- New@Parser[] | 1312 params <- New@Parser[] |
1313 Null[text, params, New@Parse Program[], 0] | 1313 Null[text, params, New@Parse Program[], 0] |
1314 |: | 1314 |: |
1315 tree <- Process Imports[~, params] | 1315 tree <- Process Imports[~, params] |
1316 Init Used Stores[tree, New@Dictionary[]] | 1316 Init Used Stores[tree, Dictionary[]] |
1317 |: [Tree to Program[tree]]Run[[args(0)]Tail[1]] :| | 1317 |: [Tree to Program[tree]]Run[[args(0)]Tail[1]] :| |
1318 :| | 1318 :| |
1319 :||: | 1319 :||: |
1320 REPL[New@Parser[]] | 1320 REPL[New@Parser[]] |
1321 :| | 1321 :| |