本文整理汇总了Java中com.sun.tools.javac.tree.DCTree.DCAttribute类的典型用法代码示例。如果您正苦于以下问题:Java DCAttribute类的具体用法?Java DCAttribute怎么用?Java DCAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DCAttribute类属于com.sun.tools.javac.tree.DCTree包,在下文中一共展示了DCAttribute类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: diffAttribute
import com.sun.tools.javac.tree.DCTree.DCAttribute; //导入依赖的package包/类
private int diffAttribute(DCDocComment doc, DCAttribute oldT, DCAttribute newT, int[] elementBounds) {
return elementBounds[1];
}
示例2: htmlAttrs
import com.sun.tools.javac.tree.DCTree.DCAttribute; //导入依赖的package包/类
/**
* Read a series of HTML attributes, terminated by {@literal > }.
* Each attribute is of the form {@literal identifier[=value] }.
* "value" may be unquoted, single-quoted, or double-quoted.
*/
protected List<DCTree> htmlAttrs() {
ListBuffer<DCTree> attrs = new ListBuffer<DCTree>();
skipWhitespace();
loop:
while (isIdentifierStart(ch)) {
int namePos = bp;
Name name = readIdentifier();
skipWhitespace();
List<DCTree> value = null;
ValueKind vkind = ValueKind.EMPTY;
if (ch == '=') {
ListBuffer<DCTree> v = new ListBuffer<DCTree>();
nextChar();
skipWhitespace();
if (ch == '\'' || ch == '"') {
vkind = (ch == '\'') ? ValueKind.SINGLE : ValueKind.DOUBLE;
char quote = ch;
nextChar();
textStart = bp;
while (bp < buflen && ch != quote) {
if (newline && ch == '@') {
attrs.add(erroneous("dc.unterminated.string", namePos));
// No point trying to read more.
// In fact, all attrs get discarded by the caller
// and superseded by a malformed.html node because
// the html tag itself is not terminated correctly.
break loop;
}
attrValueChar(v);
}
addPendingText(v, bp - 1);
nextChar();
} else {
vkind = ValueKind.UNQUOTED;
textStart = bp;
while (bp < buflen && !isUnquotedAttrValueTerminator(ch)) {
attrValueChar(v);
}
addPendingText(v, bp - 1);
}
skipWhitespace();
value = v.toList();
}
DCAttribute attr = m.at(namePos).Attribute(name, vkind, value);
attrs.add(attr);
}
return attrs.toList();
}
示例3: htmlAttrs
import com.sun.tools.javac.tree.DCTree.DCAttribute; //导入依赖的package包/类
/**
* Read a series of HTML attributes, terminated by {@literal > }.
* Each attribute is of the form {@literal identifier[=value] }.
* "value" may be unquoted, single-quoted, or double-quoted.
*/
protected List<DCTree> htmlAttrs() {
ListBuffer<DCTree> attrs = new ListBuffer<>();
skipWhitespace();
loop:
while (isIdentifierStart(ch)) {
int namePos = bp;
Name name = readAttributeName();
skipWhitespace();
List<DCTree> value = null;
ValueKind vkind = ValueKind.EMPTY;
if (ch == '=') {
ListBuffer<DCTree> v = new ListBuffer<>();
nextChar();
skipWhitespace();
if (ch == '\'' || ch == '"') {
vkind = (ch == '\'') ? ValueKind.SINGLE : ValueKind.DOUBLE;
char quote = ch;
nextChar();
textStart = bp;
while (bp < buflen && ch != quote) {
if (newline && ch == '@') {
attrs.add(erroneous("dc.unterminated.string", namePos));
// No point trying to read more.
// In fact, all attrs get discarded by the caller
// and superseded by a malformed.html node because
// the html tag itself is not terminated correctly.
break loop;
}
attrValueChar(v);
}
addPendingText(v, bp - 1);
nextChar();
} else {
vkind = ValueKind.UNQUOTED;
textStart = bp;
while (bp < buflen && !isUnquotedAttrValueTerminator(ch)) {
attrValueChar(v);
}
addPendingText(v, bp - 1);
}
skipWhitespace();
value = v.toList();
}
DCAttribute attr = m.at(namePos).newAttributeTree(name, vkind, value);
attrs.add(attr);
}
return attrs.toList();
}
示例4: newAttributeTree
import com.sun.tools.javac.tree.DCTree.DCAttribute; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public DCAttribute newAttributeTree(javax.lang.model.element.Name name, ValueKind vkind, java.util.List<? extends DocTree> value) {
DCAttribute tree = new DCAttribute(name, vkind, cast(value));
tree.pos = pos;
return tree;
}