def XXXX_create_cast_expression(self, tok):
if tok.typeof_arg:
type_expression = self.type_manager.get_type_of(
tok.typeof_arg.first)
else:
type_expression = tok.simple_type
# Check that casting makes sense.
target = self.type_manager.get_type_of(type_expression)
if not target:
raise pyparsing.ParseException(
"%s is not a type" % target)
return c_ast.CFunctionCall(
function_name='()',
arguments=[
c_ast.CLiteral(target),
tok.expression,
],
)
评论列表
文章目录