本文整理汇总了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;
}