comparison parser_old.rhope @ 99:e09c2d1d6d5b

Got dataflow graph code working in compiler (nworker_c.rhope)
author Mike Pavone <pavone@retrodev.com>
date Fri, 06 Aug 2010 01:42:37 -0400
parents 27bb051d631c
children 25a205094f9b
comparison
equal deleted inserted replaced
98:a34a982ecd32 99:e09c2d1d6d5b
1027 yesno <- No 1027 yesno <- No
1028 }{ 1028 }{
1029 If[[before] = [""]] 1029 If[[before] = [""]]
1030 { 1030 {
1031 Print[[["Found "]Append[delim]]Append[" where a named pipe or literal was expected"]] 1031 Print[[["Found "]Append[delim]]Append[" where a named pipe or literal was expected"]]
1032 { Print[["Near: "]Append[ [afterdelim]Slice[40]]] } 1032 { Print[["Near: "]Append[ [afterdelim]Slice[80]]] }
1033 }{ 1033 }{
1034 If[[before]Contains[[params]Global Separator >>]] 1034 If[[before]Contains[[params]Global Separator >>]]
1035 { 1035 {
1036 parts <- [before]Split[[params]Global Separator >>] 1036 parts <- [before]Split[[params]Global Separator >>]
1037 out <- New@Global Node[Right Trim[[parts]Index[0],"\r\n\t "], Trim[[parts]Index[1], "\r\n\t "]] 1037 out <- New@Global Node[Right Trim[[parts]Index[0],"\r\n\t "], Trim[[parts]Index[1], "\r\n\t "]]
1320 1320
1321 Worker Name[string,params,tree,lines:out] 1321 Worker Name[string,params,tree,lines:out]
1322 { 1322 {
1323 ,after arglist <- Worker Declaration[string, params] 1323 ,after arglist <- Worker Declaration[string, params]
1324 { 1324 {
1325 Print[worker name]
1325 worker name <- [~]Name >> 1326 worker name <- [~]Name >>
1326 body text, modifiers <- [after arglist]Get Comment DString[[params]Block Begin >>, params] 1327 body text, modifiers <- [after arglist]Get Comment DString[[params]Block Begin >>, params]
1327 modified <- Process Modifiers[~, params, modifiers] 1328 modified <- Process Modifiers[~, params, modifiers]
1328 expression trees, after body <- Worker Body[body text, params, ()] 1329 expression trees, after body <- Worker Body[body text, params, ()]
1329 worker <- [modified]Trees <<[expression trees] 1330 worker <- [modified]Trees <<[expression trees]
1507 } 1508 }
1508 } 1509 }
1509 1510
1510 Do Import[tree,file name,unused,params:out] 1511 Do Import[tree,file name,unused,params:out]
1511 { 1512 {
1513 Print[["Parsing: "]Append[file name]]
1512 file <- <String@File[file name] 1514 file <- <String@File[file name]
1513 ,text <- [file]Get FString[[file]Length] 1515 ,text <- [file]Get FString[[file]Length]
1514 after import <- Null[text, params, tree, 0] 1516 after import <- Null[text, params, tree, 0]
1515 out <- [after import]Imports <<[ [[after import]Imports >>]Set[file name, No] ] 1517 out <- [after import]Imports <<[ [[after import]Imports >>]Set[file name, No] ]
1516 } 1518 }