match_production.m

来自「CheckMate is a MATLAB-based tool for mod」· M 代码 · 共 19 行

M
19
字号
function [match,idx] = match_production(top,rule)idx = 1;match = 0;while (idx+length(rule)-1 <= length(top)) && ~(match)  match = 1;  for k = 1:length(rule)    if ~strcmp(top{idx+k-1}.symbol,rule{k})      match = 0;      break;    end  end  if ~match    idx = idx + 1;  endend% -----------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?