langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java
changeset 14952 d0022ae20516
parent 14541 36f9d11fc9aa
child 15552 99e4c7eb352c
equal deleted inserted replaced
14951:8d9ea42e4aba 14952:d0022ae20516
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package com.sun.tools.javac.parser;
    26 package com.sun.tools.javac.parser;
    27 
    27 
    28 import com.sun.tools.javac.util.Filter;
       
    29 import java.text.BreakIterator;
    28 import java.text.BreakIterator;
    30 import java.util.Arrays;
    29 import java.util.Arrays;
    31 import java.util.HashMap;
    30 import java.util.HashMap;
    32 import java.util.HashSet;
    31 import java.util.HashSet;
    33 import java.util.LinkedList;
       
    34 import java.util.Locale;
    32 import java.util.Locale;
    35 import java.util.Map;
    33 import java.util.Map;
    36 import java.util.Queue;
       
    37 import java.util.Set;
    34 import java.util.Set;
    38 
    35 
    39 import com.sun.source.doctree.AttributeTree.ValueKind;
    36 import com.sun.source.doctree.AttributeTree.ValueKind;
    40 import com.sun.tools.javac.parser.DocCommentParser.TagParser.Kind;
    37 import com.sun.tools.javac.parser.DocCommentParser.TagParser.Kind;
    41 import com.sun.tools.javac.parser.Tokens.Comment;
    38 import com.sun.tools.javac.parser.Tokens.Comment;
    50 import com.sun.tools.javac.tree.DCTree.DCStartElement;
    47 import com.sun.tools.javac.tree.DCTree.DCStartElement;
    51 import com.sun.tools.javac.tree.DCTree.DCText;
    48 import com.sun.tools.javac.tree.DCTree.DCText;
    52 import com.sun.tools.javac.tree.DocTreeMaker;
    49 import com.sun.tools.javac.tree.DocTreeMaker;
    53 import com.sun.tools.javac.tree.JCTree;
    50 import com.sun.tools.javac.tree.JCTree;
    54 import com.sun.tools.javac.util.DiagnosticSource;
    51 import com.sun.tools.javac.util.DiagnosticSource;
    55 import com.sun.tools.javac.util.JCDiagnostic;
       
    56 import com.sun.tools.javac.util.List;
    52 import com.sun.tools.javac.util.List;
    57 import com.sun.tools.javac.util.ListBuffer;
    53 import com.sun.tools.javac.util.ListBuffer;
    58 import com.sun.tools.javac.util.Log;
    54 import com.sun.tools.javac.util.Log;
    59 import com.sun.tools.javac.util.Name;
    55 import com.sun.tools.javac.util.Name;
    60 import com.sun.tools.javac.util.Names;
    56 import com.sun.tools.javac.util.Names;
   734 
   730 
   735         if (checkSemi && ch == ';') {
   731         if (checkSemi && ch == ';') {
   736             nextChar();
   732             nextChar();
   737             return m.at(p).Entity(names.fromChars(buf, namep, bp - namep - 1));
   733             return m.at(p).Entity(names.fromChars(buf, namep, bp - namep - 1));
   738         } else {
   734         } else {
   739             String code = checkSemi ? "dc.missing.semicolon" : "dc.bad.entity";
   735             String code = checkSemi
       
   736                     ? "dc.missing.semicolon"
       
   737                     : "dc.bad.entity";
   740             return erroneous(code, p);
   738             return erroneous(code, p);
   741         }
   739         }
   742     }
   740     }
   743 
   741 
   744     /**
   742     /**
   886                 nextChar();
   884                 nextChar();
   887         }
   885         }
   888     }
   886     }
   889 
   887 
   890     protected void addPendingText(ListBuffer<DCTree> list, int textEnd) {
   888     protected void addPendingText(ListBuffer<DCTree> list, int textEnd) {
   891         if (textStart != -1 && textStart <= textEnd) {
   889         if (textStart != -1) {
   892             list.add(m.at(textStart).Text(newString(textStart, textEnd + 1)));
   890             if (textStart <= textEnd) {
       
   891                 list.add(m.at(textStart).Text(newString(textStart, textEnd + 1)));
       
   892             }
   893             textStart = -1;
   893             textStart = -1;
   894         }
   894         }
   895     }
   895     }
   896 
   896 
   897     protected DCErroneous erroneous(String code, int pos) {
   897     protected DCErroneous erroneous(String code, int pos) {
  1194                             List<DCTree> html = blockContent();
  1194                             List<DCTree> html = blockContent();
  1195                             if (html != null)
  1195                             if (html != null)
  1196                                 return m.at(pos).See(html);
  1196                                 return m.at(pos).See(html);
  1197                             break;
  1197                             break;
  1198 
  1198 
       
  1199                         case '@':
       
  1200                             if (newline)
       
  1201                                 throw new ParseException("dc.no.content");
       
  1202                             break;
       
  1203 
       
  1204                         case EOI:
       
  1205                             if (bp == buf.length - 1)
       
  1206                                 throw new ParseException("dc.no.content");
       
  1207                             break;
       
  1208 
  1199                         default:
  1209                         default:
  1200                             if (isJavaIdentifierStart(ch) || ch == '#') {
  1210                             if (isJavaIdentifierStart(ch) || ch == '#') {
  1201                                 DCReference ref = reference(true);
  1211                                 DCReference ref = reference(true);
  1202                                 List<DCTree> description = blockContent();
  1212                                 List<DCTree> description = blockContent();
  1203                                 return m.at(pos).See(description.prepend(ref));
  1213                                 return m.at(pos).See(description.prepend(ref));