001 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 002 // for details. All rights reserved. Use of this source code is governed by a 003 // BSD-style license that can be found in the LICENSE file. 004 005 package com.google.dart.compiler.util; 006 007 /** 008 * Interface used for printing text output. 009 */ 010 public interface TextOutput { 011 int getPosition(); 012 013 int getLine(); 014 015 int getColumn(); 016 017 void indentIn(); 018 019 void indentOut(); 020 021 void newline(); 022 023 void print(char c); 024 025 void print(int v); 026 027 void print(double v); 028 029 void print(char[] s); 030 031 void print(CharSequence s); 032 033 void printOpt(char c); 034 035 void printOpt(char[] s); 036 037 void printOpt(String s); 038 039 boolean isCompact(); 040 041 boolean isJustNewlined(); 042 043 void setOutListener(OutListener outListener); 044 045 void maybeIndent(); 046 047 public interface OutListener { 048 void newLined(); 049 050 void indentedAfterNewLine(); 051 } 052 }