本文整理匯總了Java中org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression類的典型用法代碼示例。如果您正苦於以下問題:Java IASTTypeIdExpression類的具體用法?Java IASTTypeIdExpression怎麽用?Java IASTTypeIdExpression使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IASTTypeIdExpression類屬於org.eclipse.cdt.core.dom.ast包,在下文中一共展示了IASTTypeIdExpression類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visit
import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression; //導入依賴的package包/類
public int visit(IASTTypeIdExpression expression) {
ISourceLocation loc = getSourceLocation(expression);
IConstructor typ = tr.resolveType(expression);
expression.getTypeId().accept(this);
switch (expression.getOperator()) {
case IASTTypeIdExpression.op_sizeof:
stack.push(builder.Expression_sizeof(stack.pop(), loc, typ));
break;
case IASTTypeIdExpression.op_typeid:
stack.push(builder.Expression_typeid(stack.pop(), loc, typ));
break;
case IASTTypeIdExpression.op_alignof: // gnu-only?
stack.push(builder.Expression_alignOf(stack.pop(), loc, typ));
break;
case IASTTypeIdExpression.op_sizeofParameterPack:
stack.push(builder.Expression_sizeofParameterPack(stack.pop(), loc, typ));
break;
default:
throw new RuntimeException("ERROR: IASTTypeIdExpression called with unimplemented/unknown operator "
+ expression.getOperator());
}
return PROCESS_ABORT;
}
示例2: visit
import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression; //導入依賴的package包/類
@Override
public int visit(IASTExpression node) {
if (node instanceof IASTFieldReference) {
return visit((IASTFieldReference)node);
}
else if (node instanceof IASTIdExpression) {
return visit((IASTIdExpression)node);
}
else if (node instanceof ICPPASTNewExpression) {
return visit((ICPPASTNewExpression)node);
}
else if (node instanceof IASTFunctionCallExpression) {
return visit((IASTFunctionCallExpression)node);
}
else if (node instanceof IASTUnaryExpression) {
return visit((IASTUnaryExpression)node); // to check whether this is an assignement
}
else if (node instanceof IASTBinaryExpression) {
return visit((IASTBinaryExpression)node); // to check whether this is an assignement
}
else if (node instanceof IASTLiteralExpression) {
return visit((IASTLiteralExpression)node);
}
else if (node instanceof IASTTypeIdExpression) {
return visit((IASTTypeIdExpression)node);
}
else if (node instanceof IASTCastExpression) {
return visit((IASTCastExpression)node);
}
return super.visit(node);
}
示例3: visit
import org.eclipse.cdt.core.dom.ast.IASTTypeIdExpression; //導入依賴的package包/類
@Override
protected int visit(IASTTypeIdExpression node) {
inSizeofExpression = (node.getOperator() == IASTTypeIdExpression.op_sizeof);
node.getTypeId().accept(this);
inSizeofExpression = false;
return PROCESS_SKIP;
}