本文整理匯總了Java中com.sun.tools.javac.tree.JCTree.JCAssignOp方法的典型用法代碼示例。如果您正苦於以下問題:Java JCTree.JCAssignOp方法的具體用法?Java JCTree.JCAssignOp怎麽用?Java JCTree.JCAssignOp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sun.tools.javac.tree.JCTree
的用法示例。
在下文中一共展示了JCTree.JCAssignOp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: makeConcat
import com.sun.tools.javac.tree.JCTree; //導入方法依賴的package包/類
@Override
public Item makeConcat(JCTree.JCAssignOp tree) {
// Generate code to make a string builder
JCDiagnostic.DiagnosticPosition pos = tree.pos();
// Create a string builder.
newStringBuilder(tree);
// Generate code for first string, possibly save one
// copy under builder
Item l = gen.genExpr(tree.lhs, tree.lhs.type);
if (l.width() > 0) {
gen.getCode().emitop0(dup_x1 + 3 * (l.width() - 1));
}
// Load first string and append to builder.
l.load();
appendString(tree.lhs);
// Append all other strings to builder.
List<JCTree> args = collectAll(tree.rhs);
for (JCTree t : args) {
gen.genExpr(t, t.type).load();
appendString(t);
}
// Convert builder to string.
builderToString(pos);
return l;
}