visitClassDecl method

  1. @override
String visitClassDecl(
  1. ClassDecl stmt
)
override

Implementation

@override
String visitClassDecl(ClassDecl stmt) {
  final output = StringBuffer();
  if (stmt.isExternal) {
    output.write('${_lexicon.kExternal} ');
  }
  if (stmt.isAbstract) {
    output.write('${_lexicon.kAbstract} ');
  }
  output.write('${_lexicon.kClass} ${stmt.id.id} ');
  if (stmt.superType != null) {
    final superClassTypeString = formatAST(stmt.superType!);
    output.write('${_lexicon.kExtends} $superClassTypeString ');
  }
  final blockString = visitBlockStmt(stmt.definition);
  output.write(blockString);
  return output.toString();
}