Mercurial > repos > rhope
comparison parser_old.rhope @ 82:2e2e55fc12f9
Fix bug with conditionally assigning a literal or input to a named pipe
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 27 Jul 2010 15:23:32 -0400 |
parents | 4d5ea487f810 |
children | 27bb051d631c |
comparison
equal
deleted
inserted
replaced
81:dbe95bfec970 | 82:2e2e55fc12f9 |
---|---|
311 out <- [new node]Blocks <<[ Map[[node]Blocks >>, ["Map"]Set Input[1, ["Check Worker Literals"]Set Input[1, program]]] ] | 311 out <- [new node]Blocks <<[ Map[[node]Blocks >>, ["Map"]Set Input[1, ["Check Worker Literals"]Set Input[1, program]]] ] |
312 } | 312 } |
313 | 313 |
314 Add Multi Wire[worker,ref,junk,end index,input num:out] | 314 Add Multi Wire[worker,ref,junk,end index,input num:out] |
315 { | 315 { |
316 Print["Add Multi Wire"] | |
317 { Print[[ref]Index >>] | |
318 { Print[[ref]Output Number >>] | |
319 { Pretty Print[worker, ""] }}} | |
320 out <- [worker]Add Wire[[ref]Index >>, [ref]Output Number >>, end index, input num] | 316 out <- [worker]Add Wire[[ref]Index >>, [ref]Output Number >>, end index, input num] |
321 { Print["Added wire"] } | |
322 } | 317 } |
323 | 318 |
324 Add Param Wire[worker,param,input num,end index,blocks,parse worker,assignments:out] | 319 Add Param Wire[worker,param,input num,end index,blocks,parse worker,assignments:out] |
325 { | 320 { |
326 Print[["Add Param Wire: "]Append[input num]] | |
327 { | |
328 param worker, start index, output num <- [param]Add Wires[worker, blocks, parse worker, assignments] { Print["got param worker"] } | 321 param worker, start index, output num <- [param]Add Wires[worker, blocks, parse worker, assignments] { Print["got param worker"] } |
329 { | 322 { |
330 Print[["got normal output for param: "]Append[input num]] | |
331 { | |
332 Print[["Start index: "]Append[start index]] | |
333 Print[["Output num: "]Append[output num]] | |
334 | |
335 out <- [param worker]Add Wire[start index, output num, end index, input num] | 323 out <- [param worker]Add Wire[start index, output num, end index, input num] |
336 { Print["Added param wire"] } | |
337 } | |
338 }{}{ | 324 }{}{ |
339 Print["got multi output"] | |
340 out <- Fold[[["Add Multi Wire"]Set Input[3, end index]]Set Input[4, input num], param worker, ~] | 325 out <- Fold[[["Add Multi Wire"]Set Input[3, end index]]Set Input[4, input num], param worker, ~] |
341 { Print["Added multi wire"] } | |
342 } | |
343 } | 326 } |
344 } | 327 } |
345 | 328 |
346 _Add Block Wire[worker,node,junk,blocks,parse worker,assignments:out] | 329 _Add Block Wire[worker,node,junk,blocks,parse worker,assignments:out] |
347 { | 330 { |
407 } | 390 } |
408 } | 391 } |
409 | 392 |
410 Add Wires@Worker Node[node,worker,blocks,parse worker,assignments:worker,index,num,unused] | 393 Add Wires@Worker Node[node,worker,blocks,parse worker,assignments:worker,index,num,unused] |
411 { | 394 { |
412 Print[["Add Wires@Worker Node: "]Append[[node]Name >>]] | |
413 { | |
414 worker,index,num <- Add Wires Worker or Field[node, worker, blocks, parse worker, assignments] | 395 worker,index,num <- Add Wires Worker or Field[node, worker, blocks, parse worker, assignments] |
415 } | |
416 } | 396 } |
417 | 397 |
418 Add Wires Worker or Field[node,worker,blocks,parse worker,assignments:worker,index,num,unused] | 398 Add Wires Worker or Field[node,worker,blocks,parse worker,assignments:worker,index,num,unused] |
419 { | 399 { |
420 Fold[[["Assignments Add Wires"]Set Input[3, parse worker]]Set Input[4, [node]Index >>], worker, [node]Assignments >>] | 400 Fold[[["Assignments Add Wires"]Set Input[3, parse worker]]Set Input[4, [node]Index >>], worker, [node]Assignments >>] |
421 { | 401 { |
422 Print["Assignments Add Wires done"] | |
423 Fold[[[[["Add Block Wire"]Set Input[3, [node]Index >>]]Set Input[4, blocks]]Set Input[5, parse worker]]Set Input[6, assignments], ~, [node]Blocks >>] | 402 Fold[[[[["Add Block Wire"]Set Input[3, [node]Index >>]]Set Input[4, blocks]]Set Input[5, parse worker]]Set Input[6, assignments], ~, [node]Blocks >>] |
424 { | 403 { |
425 Print["Add Block Wire done"] | |
426 params worker <- Fold[[[[["Add Param Wire"]Set Input[3, [node]Index >>]]Set Input[4, blocks]]Set Input[5, parse worker]]Set Input[6, assignments], ~, [node]Params >>] | 404 params worker <- Fold[[[[["Add Param Wire"]Set Input[3, [node]Index >>]]Set Input[4, blocks]]Set Input[5, parse worker]]Set Input[6, assignments], ~, [node]Params >>] |
427 { Print["Add Param Wire done"] | 405 { |
428 index <- [node]Index >> | 406 index <- [node]Index >> |
429 num <- 0 | 407 num <- 0 |
430 } | 408 } |
431 } | 409 } |
432 } | 410 } |