Refactored ASTGenerator #3
|
@ -357,20 +357,23 @@ class AstGenerator:
|
||||||
self.current_ast_element = parent
|
self.current_ast_element = parent
|
||||||
|
|
||||||
def generate_unary(self, op, op_type=ANY_TYPE):
|
def generate_unary(self, op, op_type=ANY_TYPE):
|
||||||
|
"""
|
||||||
|
@brief Generate a unary operation
|
||||||
|
|
||||||
|
@param op_type: the type of the expression
|
||||||
|
"""
|
||||||
parent = self.current_ast_element
|
parent = self.current_ast_element
|
||||||
args = [
|
args = [
|
||||||
("op", op),
|
("op", op),
|
||||||
("type", op_type),
|
("type", op_type),
|
||||||
]
|
]
|
||||||
element = build_xml_element(args, name=GAZ_UNARY_OPERATOR_TAG)
|
self.make_element(GAZ_UNARY_OPERATOR_TAG, args)
|
||||||
self.current_ast_element.append(element)
|
|
||||||
self.current_ast_element = element
|
|
||||||
|
|
||||||
self.generate_xhs(GAZ_RHS_TAG, op_type)
|
self.generate_xhs(GAZ_RHS_TAG, op_type)
|
||||||
|
|
||||||
self.current_ast_element = parent
|
self.current_ast_element = parent
|
||||||
|
|
||||||
def generate_routine_call(self):
|
def generate_routine_call(self): # we should generate a test case with arbitrary number of args
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def generate_conditional(self):
|
def generate_conditional(self):
|
||||||
|
|
Loading…
Reference in a new issue