self.c99_complex = code.globalstate.directives['c99_complex']
+class NewExprNode(AtomicExprNode):
+
+ type = PyrexTypes.cpp_class_type
+ subexpr = ['arg']
+
+ def analyse_types(self, env):
+ entry = env.lookup(self.arg.name)
+ if not entry:
+ self.type = PyrexTypes.error_type
+ return
+
+ def coerce_to(self, type, env):
+ return self
+
+ def generate_result_code(self, code):
+ pass
+
+ def calculate_result_code(self):
+ pass
+
class NameNode(AtomicExprNode):
# Reference to a local or global variable name.
#power: atom trailer* ('**' factor)*
def p_power(s):
+ if s.systring == 'new':
+ return p_new_expr(s)
n1 = p_atom(s)
while s.sy in ('(', '[', '.'):
n1 = p_trailer(s, n1)
n1 = ExprNodes.binop_node(pos, '**', n1, n2)
return n1
+def p_new_expr(s):
+ # s.systring == 'new'
+ pos = s.position()
+ s.next()
+ args = p_simple_expr_list(s)
+ return ExprNodes.NewExprNode(pos, arg = args[0])
+
+
#trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
def p_trailer(s, node1):
c_py_buffer_type = CStructOrUnionType("Py_buffer", "struct", None, 1, "Py_buffer")
c_py_buffer_ptr_type = CPtrType(c_py_buffer_type)
+cpp_class_type = CppClassType("cpp_class", "cppclass", None, 1, "cpp_class", [])
+
error_type = ErrorType()
unspecified_type = UnspecifiedType()