org.eclipse.xtext.formatting.impl
Class FormattingConfigBasedStream
java.lang.Object
  
org.eclipse.xtext.formatting.impl.AbstractTokenStream
      
org.eclipse.xtext.formatting.impl.BaseTokenStream
          
org.eclipse.xtext.formatting.impl.FormattingConfigBasedStream
- All Implemented Interfaces: 
 - ITokenStream, ITokenStreamExtension
 
public class FormattingConfigBasedStream
- extends BaseTokenStream
 
- Author:
 
  - Moritz Eysholdt - Initial contribution and API
 
 
 
 
 
| 
Method Summary | 
protected  void | 
addLineEntry(org.eclipse.emf.ecore.EObject grammarElement,
             java.lang.String value,
             boolean isHidden)
 
            | 
protected  java.util.Set<AbstractFormattingConfig.ElementLocator> | 
collectLocators(org.eclipse.emf.ecore.EObject ele)
 
            | 
protected  java.util.Set<AbstractFormattingConfig.ElementLocator> | 
collectLocatorsForComments(java.util.Collection<AbstractFormattingConfig.ElementLocator> semanticLocators,
                           org.eclipse.emf.ecore.EObject left,
                           org.eclipse.emf.ecore.EObject right)
 
            | 
protected  FormattingConfigBasedStream.Line | 
createLine()
 
            | 
protected  FormattingConfigBasedStream.Line | 
createLine(int leftover)
 
            | 
protected  FormattingConfigBasedStream.Line | 
createLine(java.util.List<FormattingConfigBasedStream.LineEntry> entries)
 
            | 
protected  FormattingConfigBasedStream.Line | 
createLine(java.util.List<FormattingConfigBasedStream.LineEntry> initialEntries,
           int leftover)
 
            | 
 FormattingConfigBasedStream.LineEntry | 
createLineEntry(org.eclipse.emf.ecore.EObject grammarElement,
                java.lang.String value,
                boolean isHidden,
                java.util.Set<AbstractFormattingConfig.ElementLocator> beforeLocators,
                java.lang.String leadingWS,
                int indent,
                ParserRule hiddenTokenDefition)
 
            | 
protected  Pair<java.lang.Integer,RuleCall> | 
findTopmostHiddenTokenDef()
 
            | 
 void | 
flush()
 
            | 
 void | 
init(ParserRule startRule)
 
            | 
 void | 
writeHidden(org.eclipse.emf.ecore.EObject grammarElement,
            java.lang.String value)
 
            | 
 void | 
writeSemantic(org.eclipse.emf.ecore.EObject grammarElement,
              java.lang.String value)
 
            | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
activeRangeLocators
protected java.util.Set<AbstractFormattingConfig.ElementLocator> activeRangeLocators
cfg
protected FormattingConfig cfg
currentLine
protected FormattingConfigBasedStream.Line currentLine
hiddenTokenHelper
protected IHiddenTokenHelper hiddenTokenHelper
indentationLevel
protected int indentationLevel
indentationPrefix
protected java.lang.String indentationPrefix
last
protected org.eclipse.emf.ecore.EObject last
matcher
protected IElementMatcherProvider.IElementMatcher<AbstractFormattingConfig.ElementPattern> matcher
preservedWS
protected java.lang.String preservedWS
preserveSpaces
protected boolean preserveSpaces
FormattingConfigBasedStream
public FormattingConfigBasedStream(ITokenStream out,
                                   java.lang.String indentation,
                                   FormattingConfig cfg,
                                   IElementMatcherProvider.IElementMatcher<AbstractFormattingConfig.ElementPattern> matcher,
                                   IHiddenTokenHelper hiddenTokenHelper,
                                   boolean preserveSpaces)
addLineEntry
protected void addLineEntry(org.eclipse.emf.ecore.EObject grammarElement,
                            java.lang.String value,
                            boolean isHidden)
                     throws java.io.IOException
- Throws:
 java.io.IOException
 
collectLocators
protected java.util.Set<AbstractFormattingConfig.ElementLocator> collectLocators(org.eclipse.emf.ecore.EObject ele)
 
collectLocatorsForComments
protected java.util.Set<AbstractFormattingConfig.ElementLocator> collectLocatorsForComments(java.util.Collection<AbstractFormattingConfig.ElementLocator> semanticLocators,
                                                                                            org.eclipse.emf.ecore.EObject left,
                                                                                            org.eclipse.emf.ecore.EObject right)
 
createLine
protected FormattingConfigBasedStream.Line createLine()
 
createLine
protected FormattingConfigBasedStream.Line createLine(int leftover)
 
createLine
protected FormattingConfigBasedStream.Line createLine(java.util.List<FormattingConfigBasedStream.LineEntry> entries)
 
createLine
protected FormattingConfigBasedStream.Line createLine(java.util.List<FormattingConfigBasedStream.LineEntry> initialEntries,
                                                      int leftover)
 
createLineEntry
public FormattingConfigBasedStream.LineEntry createLineEntry(org.eclipse.emf.ecore.EObject grammarElement,
                                                             java.lang.String value,
                                                             boolean isHidden,
                                                             java.util.Set<AbstractFormattingConfig.ElementLocator> beforeLocators,
                                                             java.lang.String leadingWS,
                                                             int indent,
                                                             ParserRule hiddenTokenDefition)
 
findTopmostHiddenTokenDef
protected Pair<java.lang.Integer,RuleCall> findTopmostHiddenTokenDef()
 
flush
public void flush()
           throws java.io.IOException
- Specified by:
 flush in interface ITokenStream- Overrides:
 flush in class BaseTokenStream
 
- Throws:
 java.io.IOException
 
init
public void init(ParserRule startRule)
- Specified by:
 init in interface ITokenStreamExtension- Overrides:
 init in class BaseTokenStream
 
 
writeHidden
public void writeHidden(org.eclipse.emf.ecore.EObject grammarElement,
                        java.lang.String value)
                 throws java.io.IOException
- Specified by:
 writeHidden in interface ITokenStream- Overrides:
 writeHidden in class AbstractTokenStream
 
- Throws:
 java.io.IOException
 
writeSemantic
public void writeSemantic(org.eclipse.emf.ecore.EObject grammarElement,
                          java.lang.String value)
                   throws java.io.IOException
- Specified by:
 writeSemantic in interface ITokenStream- Overrides:
 writeSemantic in class AbstractTokenStream
 
- Throws:
 java.io.IOException