Ignore:
Timestamp:
11/04/10 11:24:11 (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

    r34 r37  
    6969        } 
    7070 
    71         private boolean isCommentNode(LeafNode node) { 
     71        protected boolean isCommentNode(LeafNode node) { 
    7272                if ((node.getText().trim().startsWith("//") || node.getText().trim().startsWith("/*")) && (node.isHidden())) 
    7373                        return true; 
     
    7575        } 
    7676         
    77         private void collectAllComments(CompositeNode node) { 
     77        protected void collectAllComments(CompositeNode node) { 
    7878                for (int i=0; i < node.getChildren().size(); i++) { 
    7979                        AbstractNode currentNode = node.getChildren().get(i); 
     
    9191        } 
    9292 
    93         private boolean isSingleLineComment(String str) { 
     93        protected boolean isSingleLineComment(String str) { 
    9494                if (str.startsWith("//")) 
    9595                        return true; 
     
    9797        } 
    9898         
    99         private boolean isMultiLineComment(String str) { 
     99        protected boolean isMultiLineComment(String str) { 
    100100                if (str.startsWith("/*")) 
    101101                        return true; 
     
    103103        } 
    104104 
    105         private boolean isWhitespace(char ch) { 
     105        protected boolean isWhitespace(char ch) { 
    106106                if ((ch==' ') || (ch == '\t') || (ch == '\n') || (ch == '\r')) 
    107107                        return true; 
     
    109109        } 
    110110         
    111         private void skipWhitespacesOriginalText() { 
     111        protected void skipWhitespacesOriginalText() { 
    112112                while (bufferPositionOriginalText < originalText.length() && isWhitespace(originalText.charAt(bufferPositionOriginalText))) { 
    113113                        bufferPositionOriginalText++; 
     
    115115        } 
    116116 
    117         private void skipWhitespacesFormattedText(StringBuffer result) { 
     117        protected void skipWhitespacesFormattedText(StringBuffer result) { 
    118118                while (bufferPositionFormattedText < formattedText.length() && isWhitespace(formattedText.charAt(bufferPositionFormattedText))) { 
    119119                        result.append(formattedText.substring(bufferPositionFormattedText, bufferPositionFormattedText+1)); 
     
    122122        } 
    123123 
    124         private boolean isSingleLineCommentNext(String str, int position) { 
     124        protected boolean isSingleLineCommentNext(String str, int position) { 
    125125                if ((str.charAt(position) == '/') && (str.charAt(position) == '/')) 
    126126                        return true; 
     
    128128        } 
    129129         
    130         private boolean isMultiLineCommentNext(String str, int position) { 
     130        protected boolean isMultiLineCommentNext(String str, int position) { 
    131131                if ((str.charAt(position) == '/') && (str.charAt(position) == '*')) 
    132132                        return true; 
     
    134134        } 
    135135                 
    136         private boolean isCommentNext(String str, int position) { 
     136        protected boolean isCommentNext(String str, int position) { 
    137137                if (isSingleLineCommentNext(str, position) || isMultiLineCommentNext(str, position)) 
    138138                        return true; 
     
    141141        } 
    142142         
    143         private String scanBackWhitespaces(String str, int position) { 
     143        protected String scanBackWhitespaces(String str, int position) { 
    144144                StringBuffer whiteSpaces = new StringBuffer(); 
    145145                int currentPosition = position; 
     
    151151        } 
    152152         
    153         private String stripEndingNewline(String str) { 
     153        protected String stripEndingNewline(String str) { 
    154154                int position = str.length() - 1; 
    155155                while ((str.charAt(position) == '\n') || (str.charAt(position) == '\r')) { 
     
    159159        } 
    160160         
    161         private int scanBackNewlinesCount(String str, int position) { 
     161        protected int scanBackNewlinesCount(String str, int position) { 
    162162                int newLinesCount = 0; 
    163163                int currentPosition = position; 
     
    179179        } 
    180180         
    181         private void weaveComments() { 
     181        protected void weaveComments() { 
    182182                bufferPositionOriginalText = 0; 
    183183                bufferPositionFormattedTextNoWhitespaces = 0; 
     
    255255        } 
    256256 
    257         private void newLine() { 
     257        protected void newLine() { 
    258258                buf.append("\n"); 
    259259                if ((ruleSpacingStack != null) && (!ruleSpacingStack.empty())) { 
     
    264264        } 
    265265         
    266         private void text(String str) { 
     266        protected void text(String str) { 
    267267                buf.append(str); 
    268268                newLineOffsetCounter += str.length(); 
    269269        } 
    270270 
    271         private void space() { 
     271        protected void space() { 
    272272                buf.append(" "); 
    273273                newLineOffsetCounter++; 
    274274        } 
    275275         
    276         private void spaces(int count) { 
     276        protected void spaces(int count) { 
    277277                for (int i=0; i < count; i++) { 
    278278                        buf.append(" "); 
     
    280280        } 
    281281 
    282         private boolean lastIsClosingParentheses() { 
     282        protected boolean lastIsClosingParentheses() { 
    283283                char ch = buf.toString().charAt(buf.toString().length()-1); 
    284284                if ((ch == ')') || (ch == ']') || (ch == '}')) 
     
    287287        } 
    288288 
    289         private void wrap() { 
     289        protected void wrap() { 
    290290                if ((config.isWrapAfterThreshold()) && (newLineOffsetCounter > config.getWrapThreshold())) { 
    291291                        char last = buf.toString().charAt(buf.toString().length()-1); 
Note: See TracChangeset for help on using the changeset viewer.