예제 #1
0
    def VisitFunctionDefInstantiation(self, o, **kwargs):
        import neurounits
        if type(o.function_def) == neurounits.ast.astobjects.BuiltInFunction:

            if o.function_def.funcname == "pow":
                p0_rhs = self.visit(o.parameters['base'].rhs_ast)
                p1_rhs = self.visit(o.parameters['exp'].rhs_ast)
                r = "%s(%s,%s)" % (o.function_def.funcname, p0_rhs, p1_rhs)
                return r

            else:
                assert len(o.parameters) == 1
                p0_rhs = self.visit(o.parameters.values()[0].rhs_ast)
                r = "%s(%s)" % (o.function_def.funcname, p0_rhs)
                return r
        elif type(o.function_def) == neurounits.ast.astobjects.FunctionDef:
            #params = ",".join( self.visit(p.rhs_ast,varnames=varnames, varunits=varunits,**kwargs) for p in o.parameters.values()  )
            #func_call = "%s(%s)"%( varnames[o.function_def].raw_name, params)
            print 'T', [type(p.rhs_ast) for p in o.parameters.values()]
            params = ",".join(
                self.visit(p.rhs_ast) for p in o.parameters.values())
            func_call = "%s(%s)" % (o.function_def.funcname.replace(
                ".", "__"), params)
            return func_call
        else:
            panic()
예제 #2
0
    def VisitFunctionDefInstantiation(self, o, **kwargs):
        import neurounits
        if type(o.function_def) == neurounits.ast.astobjects.BuiltInFunction:

            if o.function_def.funcname == "pow":
                p0_rhs = self.visit(o.parameters['base'].rhs_ast)
                p1_rhs = self.visit(o.parameters['exp'].rhs_ast)
                r = "%s(%s,%s)"%( o.function_def.funcname, p0_rhs, p1_rhs  )
                return r

            else:
                assert len(o.parameters) == 1
                p0_rhs = self.visit(o.parameters.values()[0].rhs_ast)
                r = "%s(%s)"%( o.function_def.funcname, p0_rhs )
                return r
        elif type(o.function_def) == neurounits.ast.astobjects.FunctionDef:
            #params = ",".join( self.visit(p.rhs_ast,varnames=varnames, varunits=varunits,**kwargs) for p in o.parameters.values()  )
            #func_call = "%s(%s)"%( varnames[o.function_def].raw_name, params)
            print 'T',  [ type(p.rhs_ast) for p in o.parameters.values()]
            params = ",".join( self.visit(p.rhs_ast) for p in o.parameters.values()  )
            func_call = "%s(%s)"%( o.function_def.funcname.replace(".","__"), params)
            return func_call
        else:
            panic()
예제 #3
0
 def VisitEqnAssignmentByRegime(self, o, **kwargs):
     panic()
예제 #4
0
 def VisitFunctionDefInstantiationParater(self, o, **kwargs):
     panic()
예제 #5
0
 def VisitFunctionDef(self, o, **kwargs):
     panic()
예제 #6
0
 def VisitAssignedVariable(self, o, **kwargs):
     panic()
예제 #7
0
 def VisitStateVariable(self, o, **kwargs):
     panic()
예제 #8
0
 def VisitEqnTimeDerivative(self, o, **kwargs):
     panic()
예제 #9
0
 def VisitOnEventStateAssignment(self, o, **kwargs):
     panic()
예제 #10
0
 def VisitOnEvent(self, o, **kwargs):
     panic()
예제 #11
0
 def VisitEqnSet(self, o, **kwargs):
     panic()
 def VisitBoolNot(self, o, **kwargs):
     panic()
 def VisitBoolOr(self, o, **kwargs):
     panic()
 def VisitBoolAnd(self, o, **kwargs):
     panic()
예제 #15
0
 def VisitOnEvent(self, o, **kwargs):
     panic()
예제 #16
0
 def VisitOnEventStateAssignment(self, o, **kwargs):
     panic()
예제 #17
0
 def VisitEqnTimeDerivative(self, o, **kwargs):
     panic()
예제 #18
0
 def VisitEqnAssignment(self, o, **kwargs):
     panic()
예제 #19
0
 def VisitEqnAssignment(self, o, **kwargs):
     panic()
예제 #20
0
 def VisitParameter(self, o, **kwargs):
     panic()
예제 #21
0
 def VisitStateVariable(self, o, **kwargs):
     panic()
예제 #22
0
 def VisitSuppliedValue(self, o, **kwargs):
     panic()
예제 #23
0
 def VisitParameter(self, o, **kwargs):
     panic()
예제 #24
0
 def VisitAssignedVariable(self, o, **kwargs):
     panic()
예제 #25
0
 def VisitSuppliedValue(self, o, **kwargs):
     panic()
예제 #26
0
 def VisitFunctionDef(self, o, **kwargs):
     panic()
예제 #27
0
 def VisitEqnSet(self, o, **kwargs):
     panic()
예제 #28
0
 def VisitFunctionDefInstantiationParater(self, o, **kwargs):
     panic()
예제 #29
0
 def VisitTimeDerivativeByRegime(self, o, **kwargs):
     panic()