コード例 #1
0
ファイル: symbol_visitor.py プロジェクト: lilott8/BioScript
    def visitMethodCall(self, ctx: BSParser.MethodCallContext):
        # First see if this method exists.
        method_name = ctx.IDENTIFIER().__str__()
        if method_name not in self.symbol_table.functions.keys():
            raise UndefinedFunction(
                "No function {} defined.".format(method_name))

        args = list()
        if ctx.expressionList():
            args = self.visitExpressionList(ctx.expressionList())
        return method_name, args
コード例 #2
0
    def visitMethodCall(self, ctx: BSParser.MethodCallContext) -> str:
        func = self.symbol_table.functions[ctx.IDENTIFIER().__str__()]

        smt = "; building asserts for method call {} in {}{}".format(
            self.output.name.upper(), self.scope_stack[-1].upper(), self.nl)
        for t in func.types:
            smt += "(assert (= {} true)){}".format(
                self.get_smt_name(self.output, t), self.nl)
        return smt
コード例 #3
0
ファイル: ir_visitor.py プロジェクト: LarsenRidder/BioScript
 def visitMethodCall(self, ctx: BSParser.MethodCallContext):
     method_name = ctx.IDENTIFIER().__str__()
     args = list()
     if ctx.expressionList():
         args = self.visitExpressionList(ctx.expressionList())
     return method_name, args
コード例 #4
0
 def visitMethodCall(self, ctx: BSParser.MethodCallContext):
     function = self.symbol_table.functions[ctx.IDENTIFIER().__str__()]
     return {'name': function.name, 'types': function.types, 'method': True}