Changeset 38 in default for trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src
- Timestamp:
- 11/04/10 11:41:21 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/formatter/EbnfHtmlFormatterVisitor.java
r37 r38 8 8 9 9 import de.ugoe.cs.swe.bnftools.ebnf.EtsiBnf; 10 import de.ugoe.cs.swe.bnftools.ebnf.Rule; 11 import de.ugoe.cs.swe.bnftools.ebnf.RuleReference; 10 12 import de.ugoe.cs.swe.bnftools.ebnf.SectionHeading; 11 13 … … 125 127 // ----------------------------------------------------------------------------- 126 128 129 protected void visitAfter(EtsiBnf node) { 130 weaveComments(); 131 } 132 127 133 protected void visitBefore(SectionHeading node) { 128 134 if (!lastWasSectionHeading && !buf.substring(buf.length()-2).equals("\n\n")) … … 138 144 protected void visitAfter(SectionHeading node) { 139 145 } 146 147 protected void visitBefore(RuleReference node) { 148 wrap(); 149 150 metaText("<a href=\"#" + node.getRuleref().getName() + "\">"); 151 text(node.getRuleref().getName()); 152 metaText("</a>"); 153 } 140 154 141 protected void visitAfter(EtsiBnf node) { 142 weaveComments(); 155 protected void visitAfter(RuleReference node) { 156 } 157 158 protected void visitBefore(Rule node) { 159 if (lastWasSectionHeading) 160 newLine(); 161 162 lastWasSectionHeading=false; 163 164 newLineOffsetCounter = 0; 165 166 if (node.getRulenumber() > 0) 167 text(node.getRulenumber() + ". "); 168 169 metaText("<a name=\"#" + node.getName() + "\">"); 170 text(node.getName()); 171 metaText("</a>"); 172 text(" ::= "); 173 174 rightHandSideRuleOffset = newLineOffsetCounter; 175 ruleSpacingStack.push(newLineOffsetCounter); 176 } 177 178 protected void visitAfter(Rule node) { 179 metaText("<br/>"); 180 text(";"); 181 newLine(); 182 ruleSpacingStack.pop(); 143 183 } 144 184 }
Note: See TracChangeset
for help on using the changeset viewer.