diff 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
line wrap: on
line diff
--- a/parser.vistxt	Tue Dec 01 03:59:31 2009 -0500
+++ b/parser.vistxt	Tue Dec 22 01:22:09 2009 -0500
@@ -69,7 +69,7 @@
 	]Global Separator <<["::"]
 	]Hex Escape <<["x"]
 	]Uses <<["uses"]
-	]Escape Map <<[[[[New@Dictionary[]]Set["n","\n"]]Set["r","\r"]]Set["t","\t"]]
+	]Escape Map <<[[[[Dictionary[]]Set["n","\n"]]Set["r","\r"]]Set["t","\t"]]
 :|
 
 Company Output Reference
@@ -87,7 +87,7 @@
 |:
 	reflist <- [refs(0)]Index[name(1)] |::|
 	|:
-		reflist <- New@List[]
+		reflist <- List[]
 	:|
 	out(0) <- [refs(0)]Set[name(1), [reflist]Append[reference(2)]]
 :|
@@ -113,9 +113,9 @@
 New@Parse Program(0,1)
 |:
 	out(0) <- [[[Build["Parse Program"]
-	]Workers <<[New@Dictionary[]]
-	]Imports <<[New@Dictionary[]]
-	]Blueprints <<[New@Dictionary[]]
+	]Workers <<[Dictionary[]]
+	]Imports <<[Dictionary[]]
+	]Blueprints <<[Dictionary[]]
 :|
 
 Company Blueprint Definition
@@ -141,7 +141,7 @@
 
 New@Parse Worker(4,1)
 |:
-	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[]]
+	out(0) <- [[[[[[Build["Parse Worker"]]Name <<[name(0)]]Inputs <<[inputs(1)]]Outputs <<[outputs(2)]]Line Number <<[line(3)]]Trees <<[List[]]]Uses Stores <<[List[]]
 :|
 
 Company Worker Node
@@ -155,7 +155,7 @@
 
 New@Worker Node(2,1)
 |:
-	out(0) <- [[[[Build["Worker Node"]]Name <<[name(0)]]Params <<[params(1)]]Assignments <<[New@List[]]]Blocks <<[New@List[]]
+	out(0) <- [[[[Build["Worker Node"]]Name <<[name(0)]]Params <<[params(1)]]Assignments <<[List[]]]Blocks <<[List[]]
 :|
 
 Add List Helper(6,3)
@@ -351,7 +351,7 @@
 
 New@Field Node(3,1)
 |:
-	out(0) <- [[[[[Build["Field Node"]]Name <<[name(0)]]Assignments <<[New@List[]]]Blocks <<[New@List[]]]Set? <<[set(2)]]Params <<[params(1)]
+	out(0) <- [[[[[Build["Field Node"]]Name <<[name(0)]]Assignments <<[List[]]]Blocks <<[List[]]]Set? <<[set(2)]]Params <<[params(1)]
 :|
 
 Add to Worker@Field Node(5,3)
@@ -405,7 +405,7 @@
 
 New@Named Pipe Node(1,1)
 |:
-	out(0) <- [[[Build["Named Pipe Node"]]Name <<[name(0)]]Assignments <<[New@List[]]]Blocks <<[New@List[]]
+	out(0) <- [[[Build["Named Pipe Node"]]Name <<[name(0)]]Assignments <<[List[]]]Blocks <<[List[]]
 :|
 
 Add to Worker@Named Pipe Node(5,3)
@@ -478,7 +478,7 @@
 
 New@Global Node(2,1)
 |:
-	out(0) <- [[[[Build["Global Node"]]Store <<[store(0)]]Name <<[name(1)]]Assignments <<[New@List[]]]Blocks <<[New@List[]]
+	out(0) <- [[[[Build["Global Node"]]Store <<[store(0)]]Name <<[name(1)]]Assignments <<[List[]]]Blocks <<[List[]]
 :|
 
 Add to Worker@Global Node(5,3)
@@ -516,7 +516,7 @@
 
 New@Literal Node(1,1)
 |:
-	out(0) <- [[[Build["Literal Node"]]Value <<[value(0)]]Assignments <<[New@List[]]]Blocks <<[New@List[]]
+	out(0) <- [[[Build["Literal Node"]]Value <<[value(0)]]Assignments <<[List[]]]Blocks <<[List[]]
 :|
 
 Add to Worker@Literal Node(5,3)
@@ -599,7 +599,7 @@
 |:
 	If[[block count(3)] > [0]]
 	|:
-		after, before <- [string(0)]Get DString[[[New@List[]]Append[begin comment(1)]]Append[end comment(2)]] |::| |::|
+		after, before <- [string(0)]Get DString[[[List[]]Append[begin comment(1)]]Append[end comment(2)]] |::| |::|
 		|:
 			If[[~] = [begin comment(1)]]
 			|:
@@ -686,7 +686,7 @@
 	:|
 :|
 
-Blueprint(4,1)
+PBlueprint(4,1)
 |:
 	,whitespace name <- [string(0)]Get Comment DString[[params(1)]Block Begin >>, params(1)]
 	|:	
@@ -697,7 +697,7 @@
 		|:
 			body lines <- [body]Split["\n"]
 			more lines <- [[[body lines]Length] - [1]] + [name lines]
-			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"]]
+			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"]]
 			new tree <- [tree(2)]Blueprints << [ [[tree(2)]Blueprints >>]Set[name, New@Blueprint Definition[name, fields]] ]
 			out(0) <- Null[~, params(1), new tree, [lines(3)] + [more lines]]
 		:| |::| |:
@@ -730,7 +730,7 @@
 	If[[check block]Starts With[[params(1)]Block Begin >>]]
 	|:
 		,begin block <- [check block]Slice[[[params(1)]Block Begin >>]Length]
-		trees, after block <- Worker Body[begin block, params(1), New@List[]]
+		trees, after block <- Worker Body[begin block, params(1), List[]]
 		blocks(0), after(1) <- Get Expression Blocks[after block, params(1), [blocks(2)]Append[trees]]
 	:||:
 		If[[check block]Starts With[[params(1)]Empty Block >>]]
@@ -762,7 +762,7 @@
 
 Parse String(3,2)
 |:
-	delims <- [[New@List[]]Append[[params(1)]String End >>]]Append[[params(1)]String Escape >>]
+	delims <- [[List[]]Append[[params(1)]String End >>]]Append[[params(1)]String Escape >>]
 	after, before, delim <- [string(0)]Get Comment DString[delims, params(1)]
 	|:
 		If[[delim] = [[params(1)]String End >>]]
@@ -839,7 +839,7 @@
 		If[[name]Starts With[[params(1)]List Begin >>]]
 		|:
 			,list start <- [name]Slice[[[params(1)]List Begin >>]Length]
-			value,after(1) <- Parse List[list start, params(1), New@List[]]
+			value,after(1) <- Parse List[list start, params(1), List[]]
 		:||:
 			If[[[name]Slice[1]]In["-0123456789"]]
 			|:
@@ -933,7 +933,7 @@
 
 Postfix or Infix(2,2)
 |:
-	args, after args <- Parse Arguments[string(0), params(1), New@List[]]
+	args, after args <- Parse Arguments[string(0), params(1), List[]]
 	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 >>]
 	after,before,delim <- [after args]Get Comment DString[delims, params(1)]
 	|:
@@ -971,7 +971,7 @@
 					after expression <- [after literal]Append[[delim]Append[after]]
 					expression, after literal <- Named Pipe or Literal[Right Trim[before, "\r\n\t "], params(1)]
 				:||:
-					expression, after expression <- Prefix[after, params(1), maybe name, New@List[]]
+					expression, after expression <- Prefix[after, params(1), maybe name, List[]]
 				:|
 			:|
 		:||:
@@ -1003,7 +1003,7 @@
 		:|
 		//Any expression can be followed by one or more blocks mapping the inputs of other expressions
 		//to the outputs of the current one
-		blocks,after blocks(1) <- Get Expression Blocks[after expression, params(1), New@List[]]
+		blocks,after blocks(1) <- Get Expression Blocks[after expression, params(1), List[]]
 		final expression(0) <- [expression]Blocks <<[blocks]
 	:|
 :|
@@ -1043,7 +1043,7 @@
 		worker name <- Trim[whitespace name, "\n\r\t "]
 		in out <- [params(1)]In Out Delim >>
 		arg end <- [params(1)]Arg End >>
-		delims <- [[New@List[]]Append[in out]]Append[arg end]
+		delims <- [[List[]]Append[in out]]Append[arg end]
 		after <- [~]Get Comment DString[delims, params(1)] |::| 
 		|:
 			arglist <- Trim[~,"\r\n\t "]
@@ -1067,7 +1067,7 @@
 			|:
 				body text, modifiers <- [after arglist]Get Comment DString[[params(1)]Block Begin >>, params(1)]
 				modified <- Process Modifiers[~, params(1), modifiers]
-				expression trees, after body <- Worker Body[body text, params(1), New@List[]]
+				expression trees, after body <- Worker Body[body text, params(1), List[]]
 				worker <- [modified]Trees <<[expression trees]
 				new worker dict <- [[tree(2)]Workers >>]Set[worker name, worker]
 				out(0) <- Null[after body, params(1), [tree(2)]Workers <<[new worker dict], 0]
@@ -1084,7 +1084,7 @@
 	current line <- 0//[lines(3)] + [Count Substring[whitespace, "\n"]]
 	If[[trimmed]Starts With[ [params(1)]Blueprint >> ]]
 	|:
-		out(0) <- Blueprint[trimmed, params(1), tree(2), current line]
+		out(0) <- PBlueprint[trimmed, params(1), tree(2), current line]
 	:||:
 		If[[trimmed]Starts With[ [params(1)]Import >> ]]
 		|:
@@ -1109,13 +1109,13 @@
 
 Add Wires Helper(5,1)
 |:
-	worker(0) <- [node(1)]Add Wires[worker(0), New@List[], parse worker(3), assignments(4)]
+	worker(0) <- [node(1)]Add Wires[worker(0), List[], parse worker(3), assignments(4)]
 :|
 
 Add Contents(3,2)
 |:
 	worker <- [[program(2)]Find Worker[name(1)]]Uses[[parse worker(0)]Uses Stores >>]
-	trees, contents worker, refs <- Add List to Worker[[parse worker(0)]Trees >>, worker, program(2), parse worker(0), New@Dictionary[]]
+	trees, contents worker, refs <- Add List to Worker[[parse worker(0)]Trees >>, worker, program(2), parse worker(0), Dictionary[]]
 	Fold[[["Add Wires Helper"]Set Input[3, parse worker(0)]]Set Input[4, refs], contents worker, trees]
 	out(0) <- [parse worker(0)]Trees <<[trees]
 	key(1) <- name(1)
@@ -1147,7 +1147,7 @@
 
 Tree to Program(1,1)
 |:
-	out(0) <- _Tree to Program[parse tree(0), [New@Program[]]Add Builtins]
+	out(0) <- _Tree to Program[parse tree(0), [Program[]]Add Builtins]
 :|
 
 Needs Imports(3,1)
@@ -1170,7 +1170,7 @@
 
 Process Imports(2,1)
 |:
-	needs import <- Fold["Needs Imports", New@List[], [parse tree(0)]Imports >>]
+	needs import <- Fold["Needs Imports", List[], [parse tree(0)]Imports >>]
 	If[[[needs import]Length] > [0]]
 	|:
 		import tree <- Fold[["Do Import"]Set Input[3, params(1)], parse tree(0), needs import]
@@ -1234,16 +1234,16 @@
 				|: _REPL[params(0), _Tree to Program[import tree, prog(1)], ~] :|
 			:|
 		:||:
-			trees <- Worker Body[[line]Append["}"], params(0), New@List[]]
-			tree <- [New@Worker Node["Val", [New@List[]]Append[[trees]Index[0]]]]Assignments <<[{"__out"}]
-			this stores <- [[tree]Gather Stores[params(0), New@Dictionary[]]]Keys
+			trees <- Worker Body[[line]Append["}"], params(0), List[]]
+			tree <- [New@Worker Node["Val", [List[]]Append[[trees]Index[0]]]]Assignments <<[{"__out"}]
+			this stores <- [[tree]Gather Stores[params(0), Dictionary[]]]Keys
 			next stores <- Fold["_Init Used Store", stores(2), this stores]
 			|:
-			pworker <- [[New@Parse Worker["__Eval", New@List[], {"__out"}, 0]]Trees <<[[New@List[]]Append[tree]]]Uses Stores <<[this stores]
+			pworker <- [[New@Parse Worker["__Eval", List[], {"__out"}, 0]]Trees <<[[List[]]Append[tree]]]Uses Stores <<[this stores]
 			:|
 			[[prog(1)]Find Worker["__Eval"]]Clear
 			|: Add Contents[pworker, "__Eval", prog(1)]
-			|: Pretty Print[[[[prog(1)]Find Worker["__Eval"]]Do[New@List[]]]Index[0], ""]
+			|: Pretty Print[[[[prog(1)]Find Worker["__Eval"]]Do[List[]]]Index[0], ""]
 			|: _REPL[params(0), prog(1), next stores] :| :| :|
 		:|
 	:|
@@ -1253,7 +1253,7 @@
 |:
 	Print["Rhope Alpha 2\nCopyright 2008 by Michael Pavone\nEntering interactive mode\n"]
 	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]]
-	_REPL[params(0), prog, New@Dictionary[]]
+	_REPL[params(0), prog, Dictionary[]]
 :|
 
 Add If Store(3,1)
@@ -1313,7 +1313,7 @@
 		Null[text, params, New@Parse Program[], 0]
 		|:
 			tree <- Process Imports[~, params]
-			Init Used Stores[tree, New@Dictionary[]]
+			Init Used Stores[tree, Dictionary[]]
 			|: [Tree to Program[tree]]Run[[args(0)]Tail[1]] :|
 		:|
 	:||: