Qi (programming Language) - Qi YACC

Qi YACC

Qi YACC is an untyped compiler-compiler based on a top-down recursive descent parsing strategy. It is derived from the TDPL (top-down parsing language) and is the basis for much of the inbuilt parsing in Qi. Qi YACC takes Backus–Naur Form code directly as a pseudo-code:

:= | := goto

becomes

(defcc ; ;) (defcc goto ;)

The following is a Qi-YACC program that parenthesises any input occurring between { ... }s.

(2-) (defcc { } := ; := ; := ;) (3-) (defcc ;) (4-)(defcc -*- := (if (element? -*- ) #\Escape -*-);) (5-) (compile ) ] c]

Qi-YACC is more extensively discussed on the home site (see External Links).

Read more about this topic:  Qi (programming Language)