Ignore:
Timestamp:
11/03/10 16:02:27 (14 years ago)
Author:
zeiss
Message:
 
File:
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  
    3535 
    3636public class EbnfFormatterVisitor extends EbnfVisitor { 
    37         private StringBuffer buf; 
    38         private FormatterConfig config; 
    39         private int bufferPositionFormattedTextNoWhitespaces = 0; 
    40         private int bufferPositionOriginalText = 0; 
    41         private int allCommentsPosition = 0; 
    42         private ArrayList<LeafNode> allComments = new ArrayList<LeafNode>(); 
    43          
    44         private boolean lastWasSectionHeading=false; 
    45         private CompositeNode parserEtsiBnfNode; 
    46         private String originalText; 
    47         private int bufferPositionFormattedText; 
    48         private String formattedText; 
    49         private String formattedTextNoWhitespaces; 
    50         private String originalTextNoWhitespaces; 
    51         private int newLineOffsetCounter = 0; 
    52         private int rightHandSideRuleOffset = 0; 
    53         private Stack<Integer> ruleSpacingStack = new Stack<Integer>(); 
    54         private Double 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; 
    5555         
    5656        public EbnfFormatterVisitor(EObject rootNode, FormatterConfig config) { 
     
    392392 
    393393        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(";"); 
    395403                newLine(); 
    396404        } 
Note: See TracChangeset for help on using the changeset viewer.