Jump to content

Parsing/Shunting-yard algorithm: Difference between revisions

m
use named params
(Added Algol 68)
m (use named params)
Line 2,463:
string res = "", sep = "", top
sequence stack = {}
--sequence ops = split(substitute_all(infix,{"(",") --"},{" (only works"," if) ("}),' properly spaced',no_empty:=1,limit:=0)
sequence ops = split(substitute_all(infix,{"(",")"},{" ( "," ) "}),' ',0,1)
printf(1,"Infix input: %-30s%s", {infix,iff(show_workings?'\n':'\t')})
for i=1 to length(ops) do
7,815

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.