let result;
let str;
let html;
const flags = 'ug';
const exp = new ApgExp(grammar, flags);
console.log();
console.log('Demonstrate Unicode mode with the "u" flag.');
console.log();
console.log('SABNF grammar:');
console.log(exp.sourceToText());
str = '';
str += 'The word for "yes" is \u039d\u03b1\u03b9\n';
str += 'The word for "no" is \u038c\u03c7\u03b9\n';
str += 'The word for "maybe" is \u038a\u03c3\u03c9\u03c2\n';
console.log();
console.log('input string:');
console.log(str);
html = '';
html += '<h3>Greek words found</h3>\n';
const TRUE = true;
while (TRUE) {
result = exp.exec(str);
if (result == null) {
break;
}
const greek = result.rules['greek-word'];