def v_Function(self, func, ctx=None): ctx = self.Context(ctx) for arg in func.GetArguments(): ctx.Add(arg.GetName(), arg.GetLocation()) with Errors.CompileExceptionToErrorHandler(self.errorHandler, self.__onError): self.v_Visit(func.GetBody(), ctx)
def v_Expression(self, expr, ctx=None): if isinstance(expr, ast.ArrayExpression): with Errors.CompileExceptionToErrorHandler(self.errorHandler): self._ValidateArrayExpression(expr) expr.AcceptVisitor(self)
def __VisitLoop(self, stmt, ctx): ctx += 1 with Errors.CompileExceptionToErrorHandler(self.errorHandler): stmt.AcceptVisitor(self, ctx) ctx -= 1
def v_IfStatement(self, ifStatement, ctx=None): ctx = self.Context(ctx) with Errors.CompileExceptionToErrorHandler(self.errorHandler, self.__onError): ifStatement.AcceptVisitor(self, ctx)
def v_StructureDefinition(self, sd, ctx=None): ctx = self.Context() with Errors.CompileExceptionToErrorHandler(self.errorHandler, self.__onError): sd.AcceptVisitor(self, ctx)
def v_Function(self, f, ctx=None): with Errors.CompileExceptionToErrorHandler(self.errorHandler): self._ValidateFunction(f)