20 lines
407 B
Plaintext
20 lines
407 B
Plaintext
read;
|
|
"[","]" { add "*"; push; }
|
|
[:space:] { clear; }
|
|
!"" {
|
|
clear; add "Sorry, only brackets [] allowed in this!\n";
|
|
print; quit;
|
|
}
|
|
parse>
|
|
pop; pop;
|
|
"[*]*","ob*ob*" { clear; add "ob*"; push; .reparse }
|
|
pop;
|
|
"[*ob*]*" { clear; add "ob*"; push; .reparse }
|
|
|
|
(eof) {
|
|
"ob*" { clear; add "brackets look balanced!\n"; print; quit; }
|
|
clear; add "brackets not balanced.\n"; print; quit;
|
|
}
|
|
|
|
push; push; push;
|