Ignore:
Timestamp:
10/22/10 16:48:56 (14 years ago)
Author:
zeiss
Message:

sdfsd

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

    r13 r17  
    3232        private FormatterConfig config; 
    3333 
     34        private boolean lastWasSectionHeading=false; 
     35         
    3436        public EbnfFormatterVisitor(EObject rootNode, FormatterConfig config) { 
    3537                super(rootNode); 
     
    164166 
    165167        protected void visitBefore(Rule node) { 
     168                if (lastWasSectionHeading) 
     169                        buf.append("\n"); 
     170                 
     171                lastWasSectionHeading=false; 
     172 
    166173                if (node.getRulenumber() > 0) 
    167174                        buf.append(node.getRulenumber() + ". "); 
     
    188195 
    189196        protected void visitBefore(SectionHeading node) { 
    190                 if (!buf.substring(buf.length()-2).equals("\n\n")) 
     197                if (!lastWasSectionHeading && !buf.substring(buf.length()-2).equals("\n\n")) 
    191198                        buf.append("\n"); 
    192199                 
     200                lastWasSectionHeading=true; 
     201//              if (!lastWasSectionHeading || !buf.substring(buf.length()-2).equals("\n\n")) 
     202//              if (!buf.substring(buf.length()-2).equals("\n\n")) 
     203//                      buf.append("\n"); 
     204                 
    193205                buf.append(node.getSectionHeader()); 
    194206        } 
    195207 
    196208        protected void visitAfter(SectionHeading node) { 
    197                 buf.append("\n"); 
     209//              buf.append("\n"); 
    198210        } 
    199211 
Note: See TracChangeset for help on using the changeset viewer.