On Jun 1, 2018, at 8:25 PM, Eliot Miranda <eliot.miranda@gmail.com> wrote:
Hi All,
can anyone tell me why the following rules
rules replace: '``@statements. interpreterProxy pop: ``@const. interpreterProxy pushInteger: ``@integer' with: '``@statements. interpreterProxy methodReturnInteger: ``@integer'; replace: '``@statements. interpreterProxy pop: ``@const. ^interpreterProxy pushInteger: ``@integer' with: '``@statements. ^interpreterProxy methodReturnInteger: ``@integer'.
You need a â.â in your ``@statements (i.e., ``@.statements). The ``@ prefix matches any node, but ``@. will match a list of statements (0 or more). Currently, you are only matching sequence nodes with exactly 3 statements. You also need to add some temps in case the sequence node has temps: | `@temps | ``@.statements. interpreterProxy pop: ``@const. ^interpreterProxy pushInteger: ``@integer -> | `@temps | ``@.statements. ^interpreterProxy methodReturnInteger: ``@integer John Brant