0
我試圖線a, f_1(b, c, f_2(d, e))
轉換爲使用Text::Balanced
子程序和Lisp風格的函數調用行 a (f_1 b c (f_2 d e))
:的Perl:轉換函數調用到LISP風格的函數調用
函數調用的形式是f(arglist)
, arglist也可以在它內部進行一個或多個函數調用,
的路上我試圖 -
my $text = q|a, f_1(a, b, f_2(c, d))|;
my ($match, $remainder) = extract_bracketed($text); # defaults to '()'
# $match is not containing the text i want which is : a, b, f_2(c,d) because "(" is preceded by a string;
my ($d_match, $d_remainder) = extract_delimited($remainder,",");
# $d_match doesnt contain the the first string
# planning to use remainder texts from the bracketed and delimited operations in a loop to translate.
嘗試甚至開始標記爲/^[\w_0-9]+\(/
和結束標記extract_tagged作爲/\)/
子,但不會太那裏工作。 Parse::RecDescent
很難理解並在短時間內投入使用。
你沒有分隔(報價)文字。你對'extract_delimited'沒有用處。你甚至從來沒有嘗試提取標識符?我認爲你該僱用某人了。你沒有時間並不能完成我們的工作來編寫你的代碼。 – ikegami