Can vi emulate the power of yacc?
Fri, 13 Mar 2020 00:56:01 -0700 (PDT)

          From comp.compilers

Related articles
Can vi emulate the power of yacc? (2020-03-13)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: Fri, 13 Mar 2020 00:56:01 -0700 (PDT)
Organization: Compilers Central
Injection-Info:; posting-host=""; logging-data="55127"; mail-complaints-to=""
Keywords: syntax, question
Posted-Date: 13 Mar 2020 08:26:35 EDT

There are 3 ingredients in vi which, when combined, via the Chomsky-Schuetzenberger Theorem, may give it the power to fully emulate simple syntax direct translations and push down transducers ... and possibly even syntax directed translations.

(1) "%" to match brackets; with the important condition that this works on at least 2 different kinds of brackets
(2) the regular expression facility; particularly its ability to name and use parameters
(3) the search & replace function.

So, here's a simple challenge of sorts to test the idea: write a vi script that converts between infix and postfix order with at least two levels of operator precedence. I don't know if it can actually be done.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.