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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classFormattingConfigBasedStream.Lineprotected classFormattingConfigBasedStream.LineEntry
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<AbstractFormattingConfig.ElementLocator>activeRangeLocatorsprotected FormattingConfigcfgprotected FormattingConfigBasedStream.LinecurrentLineprotected IHiddenTokenHelperhiddenTokenHelperprotected intindentationLevelprotected java.lang.StringindentationPrefixprotected org.eclipse.emf.ecore.EObjectlastprotected IElementMatcherProvider.IElementMatcher<AbstractFormattingConfig.ElementPattern>matcherprotected java.lang.StringpreservedWSprotected booleanpreserveSpaces-
Fields inherited from class org.eclipse.xtext.formatting.impl.BaseTokenStream
out
-
-
Constructor Summary
Constructors Constructor Description FormattingConfigBasedStream(ITokenStream out, java.lang.String initialIndentation, FormattingConfig cfg, IElementMatcherProvider.IElementMatcher<AbstractFormattingConfig.ElementPattern> matcher, IHiddenTokenHelper hiddenTokenHelper, boolean preserveSpaces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddLineEntry(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.LinecreateLine()protected FormattingConfigBasedStream.LinecreateLine(int leftover)protected FormattingConfigBasedStream.LinecreateLine(java.util.List<FormattingConfigBasedStream.LineEntry> entries)protected FormattingConfigBasedStream.LinecreateLine(java.util.List<FormattingConfigBasedStream.LineEntry> initialEntries, int leftover)FormattingConfigBasedStream.LineEntrycreateLineEntry(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 org.eclipse.xtext.util.Pair<java.lang.Integer,RuleCall>findTopmostHiddenTokenDef()voidflush()protected java.lang.StringgetLineSeparator()protected java.lang.StringharmonizeLineSeparator(java.lang.String value)voidinit(ParserRule startRule)voidwriteHidden(org.eclipse.emf.ecore.EObject grammarElement, java.lang.String value)voidwriteSemantic(org.eclipse.emf.ecore.EObject grammarElement, java.lang.String value)
-
-
-
Field Detail
-
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
-
-
Constructor Detail
-
FormattingConfigBasedStream
public FormattingConfigBasedStream(ITokenStream out, java.lang.String initialIndentation, FormattingConfig cfg, IElementMatcherProvider.IElementMatcher<AbstractFormattingConfig.ElementPattern> matcher, IHiddenTokenHelper hiddenTokenHelper, boolean preserveSpaces)
-
-
Method Detail
-
getLineSeparator
protected java.lang.String getLineSeparator()
- Since:
- 2.3
-
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 org.eclipse.xtext.util.Pair<java.lang.Integer,RuleCall> findTopmostHiddenTokenDef()
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfaceITokenStream- Overrides:
flushin classBaseTokenStream- Throws:
java.io.IOException
-
init
public void init(ParserRule startRule)
- Specified by:
initin interfaceITokenStreamExtension- Overrides:
initin classBaseTokenStream
-
writeHidden
public void writeHidden(org.eclipse.emf.ecore.EObject grammarElement, java.lang.String value) throws java.io.IOException- Specified by:
writeHiddenin interfaceITokenStream- Overrides:
writeHiddenin classAbstractTokenStream- Throws:
java.io.IOException
-
writeSemantic
public void writeSemantic(org.eclipse.emf.ecore.EObject grammarElement, java.lang.String value) throws java.io.IOException- Specified by:
writeSemanticin interfaceITokenStream- Overrides:
writeSemanticin classAbstractTokenStream- Throws:
java.io.IOException
-
harmonizeLineSeparator
protected java.lang.String harmonizeLineSeparator(java.lang.String value)
- Since:
- 2.22
-
-