spike_parser2.grammar

来自「这是一个DFA简化和生成LL(1)分析表的程序,自动生成表格及图形」· GRAMMAR 代码 · 共 61 行

GRAMMAR
61
字号
grammar: rule(s) eofile                  {                      my @rules = @{ $item[1] };                     {                         startrule => $rules[0]->[0],                         rules => { map {@$_} @rules },                     };                  }       | <error>eofile: /^\Z/rule: rulename ':' <commit> production(s /\|/)                   {                      [ $item[1], $item[4] ];                   }    | <error?> <reject>rulename: /[A-Za-z]\w*/production: item(s)          | nilitem: repetition    | subrule    | terminal    | action    | directivesubrule: /[A-Za-z]\w*\b(?!\s*:)/terminal: string        | regexstring: /"(\\.|[^"])*"/      | /'(\\.|[^'])*'/regex: {extract_delimited($text,'/')}    { $item[1] || undef }action: {extract_codeblock($text)}       { $item[1] || undef }directive: '<error?>'         | '<error>'         | '<reject>'         | '<commit>'         | '<uncommit>'         | '<leftop:' subrule regex subrule '>'                                { [ @item[2..4] ] }repetition: subrule howoften    { [ $item[1], @{$item[2]} ]; }howoften: '(?)'                         { [ '?' ]; }        | '(s?' <commit> regex(?) ')'   { [ 's?', @{$item[3]} ]; }        | '(s'  <commit> regex(?) ')'   { [ 's', @{$item[3]} ]; }nil: ''  { ["''"] }

⌨️ 快捷键说明

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