23 lines
444 B
Text
23 lines
444 B
Text
#*
|
|
GRAMMAR PARSE TOKENS
|
|
no tokens required, except to store odd/even state
|
|
|
|
HISTORY
|
|
13 sept 2021: written
|
|
|
|
*#
|
|
|
|
begin { add "odd*"; push; }
|
|
read;
|
|
[:alpha:] {
|
|
pop;
|
|
B"odd*" { push; get; put; clear; }
|
|
B"even*" { push; swap; get; put; clear; }
|
|
}
|
|
![:alpha:].!"" {
|
|
pop;
|
|
B"odd*" { replace "odd*" "even*"; push; }
|
|
B"even*" { replace "even*" "odd*"; push; }
|
|
swap; print; clear; swap; print; clear;
|
|
}
|
|
(eof) { get; print; }
|