void main() {
String src = """
expression = binary_exp | unary_exp | comparative_exp | logical_exp | group | value;
group = "(" expression ")";
binary_exp = expression arithmetic_op expression;
unary_exp = (unary_prefix (unary_exp | value)) | ((unary_exp | value) unary_postfix);
comparative_exp = expression comparative_op expression;
arithmetic_op = "+" | "-" | "*" | "/" | "%";
logical_op = "||" | "&&";
comparative_op = "==" | "!=" | "<=" | ">=";
unary_prefix = "!" | "-";
unary_postfix = "++" | "--";
""";
src.trim().split('\n').forEach((String line) {
print("class ${line.split(' ')[0].split('_').map((String t) => t.capitalize()).toList().join('')} implements Expression {}");
});
}
extension StringExtension on String {
String capitalize() {
return "${this[0].toUpperCase()}${this.substring(1).toLowerCase()}";
}
}