Ejemplo n.º 1
0
  private void writeSwitchStatement(IASTSwitchStatement switchStatement) {
    switchIsNew = true;

    scribe.print(SWITCH_BRACKET);
    scribe.noNewLines();
    if (switchStatement instanceof ICPPASTSwitchStatement) {
      ICPPASTSwitchStatement cppSwitchStatement = (ICPPASTSwitchStatement) switchStatement;
      if (cppSwitchStatement.getControllerDeclaration() == null) {
        cppSwitchStatement.getControllerExpression().accept(visitor);
      } else {
        declWriter.writeDeclaration(cppSwitchStatement.getControllerDeclaration(), false);
      }
    } else {
      switchStatement.getControllerExpression().accept(visitor);
    }
    scribe.print(')');
    scribe.newLines();
    nextCompoundNoNewLine();
    writeBodyStatement(switchStatement.getBody(), false);

    switchIsNew = false;
  }
Ejemplo n.º 2
0
 protected void writeDeclarationWithoutSemicolon(IASTDeclaration declaration) {
   declWriter.writeDeclaration(declaration, false);
 }