parser.cup

来自「该工具也是用于字节码插桩」· CUP 代码 · 共 92 行

CUP
92
字号
/* * Parser.cup * * Parser for the Table format. * * See LICENSE file for license conditions. */package residue.tables;import java_cup.runtime.*;import java.util.*;terminal Integer NUMBER;terminal String STRING;terminal SEMICOLON, STARTPROBED, STARTREFERENCED, STARTROOTS;non terminal Table table;non terminal TableEntry probedline, referencedline;non terminal List probedlines, referencedlines;non terminal Set intlist, rootset;start with table;table ::= STARTPROBED          probedlines:pl          STARTREFERENCED          referencedlines:rl	  STARTROOTS	  rootset:rs           {:              RESULT = new Table(pl, rl, rs);          :};rootset ::= rootset:rs STRING:st  {: rs.add(st); RESULT = rs; :}	  |                       {: RESULT = new TreeSet();  :}	  ;probedlines ::= probedlines:pl probedline:p  {: pl.add(p); RESULT = pl;   :}              |                              {: RESULT = new ArrayList(); :}              ;probedline ::= NUMBER:index               NUMBER:ref               STRING:classname               STRING:methodname               NUMBER:start               NUMBER:probe               NUMBER:end               STRING:sourcename               intlist:lines               SEMICOLON               {:                   RESULT = new TableEntry(index,                                           ref,                                           classname,                                           methodname,                                           start,                                           probe,                                           end,                                           sourcename,                                           lines);               :};referencedlines ::= referencedlines:rl referencedline:r  {: rl.add(r); RESULT = rl;   :}                  |                                      {: RESULT = new ArrayList(); :}                  ;referencedline ::= NUMBER:index                   NUMBER:ref                   STRING:classname                   STRING:methodname                   NUMBER:start                   NUMBER:end                   STRING:sourcename                   intlist:lines                   SEMICOLON                   {:                       RESULT = new TableEntry(index,                                               ref,                                               classname,                                               methodname,                                               start,                                               end,                                               sourcename,                                               lines);                   :};intlist ::= intlist:il NUMBER:n  {: il.add(n); RESULT = il; :}          |  {: RESULT = new HashSet(); :}          ;

⌨️ 快捷键说明

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