Changeset 34 in default for trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src
- Timestamp:
- 11/03/10 16:02:27 (14 years ago)
- Location:
- trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/formatter
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/formatter/EbnfFormatterVisitor.java
r32 r34 35 35 36 36 public class EbnfFormatterVisitor extends EbnfVisitor { 37 pr ivateStringBuffer buf;38 pr ivateFormatterConfig config;39 pr ivateint bufferPositionFormattedTextNoWhitespaces = 0;40 pr ivateint bufferPositionOriginalText = 0;41 pr ivateint allCommentsPosition = 0;42 pr ivateArrayList<LeafNode> allComments = new ArrayList<LeafNode>();43 44 pr ivateboolean lastWasSectionHeading=false;45 pr ivateCompositeNode parserEtsiBnfNode;46 pr ivateString originalText;47 pr ivateint bufferPositionFormattedText;48 pr ivateString formattedText;49 pr ivateString formattedTextNoWhitespaces;50 pr ivateString originalTextNoWhitespaces;51 pr ivateint newLineOffsetCounter = 0;52 pr ivateint rightHandSideRuleOffset = 0;53 pr ivateStack<Integer> ruleSpacingStack = new Stack<Integer>();54 pr ivateDouble averageSingleDefinitionLength;37 protected StringBuffer buf; 38 protected FormatterConfig config; 39 protected int bufferPositionFormattedTextNoWhitespaces = 0; 40 protected int bufferPositionOriginalText = 0; 41 protected int allCommentsPosition = 0; 42 protected ArrayList<LeafNode> allComments = new ArrayList<LeafNode>(); 43 44 protected boolean lastWasSectionHeading=false; 45 protected CompositeNode parserEtsiBnfNode; 46 protected String originalText; 47 protected int bufferPositionFormattedText; 48 protected String formattedText; 49 protected String formattedTextNoWhitespaces; 50 protected String originalTextNoWhitespaces; 51 protected int newLineOffsetCounter = 0; 52 protected int rightHandSideRuleOffset = 0; 53 protected Stack<Integer> ruleSpacingStack = new Stack<Integer>(); 54 protected Double averageSingleDefinitionLength; 55 55 56 56 public EbnfFormatterVisitor(EObject rootNode, FormatterConfig config) { … … 392 392 393 393 protected void visitBefore(Import node) { 394 text("import \"" + node.getImportURI() + "\";"); 394 text("import \"" + node.getImportURI() + "\""); 395 if (node.getGrammarType() != null) { 396 text("/" + node.getGrammarType()); 397 } 398 if (node.getLabel() != null) { 399 space(); 400 text("label: " + node.getLabel()); 401 } 402 text(";"); 395 403 newLine(); 396 404 }
Note: See TracChangeset
for help on using the changeset viewer.