📄 apply_production.m
字号:
function top_new = apply_production(top,idx,production)% Apply production to sequence of symbol nodes (which are variables or% terminals) starting with top{idx}. Replace the whole sequence of nodes by% a single state formula node that contains this sequence of nodes in its% value.top_new = cell(1,idx-1);for l = 1:idx-1 top_new{l} = top{l};endtop_new{idx}.symbol = production.var;top_new{idx}.production = production.name;top_new{idx}.value = {};for l = idx:idx+length(production.rule)-1 top_new{idx}.value{l-idx+1} = top{l};endfor l = idx+length(production.rule):length(top) top_new{l-length(production.rule)+1} = top{l};endreturn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -