apply_production.m
来自「CheckMate is a MATLAB-based tool for mod」· M 代码 · 共 22 行
M
22 行
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 + =
减小字号Ctrl + -
显示快捷键?