how to refer to class methods in a class variable being a call table list
I am trying to set up a call table referring to class methods but I cannot find the appropriate languade solution. # class instruction table for assembler # class variable instrList contains instruction, # followed by a reference to a class function/method that return the size class Instr(): instrList=[ ["DATA", self.data_l], ["EQU", self.nul_l], ["LDK" , self.two_l], ["LDKL", self.four_l], ] def __init__(self): sorted(self.instrList) for instr in instrList: print(instr) def size(self, line): # here come code that finds the matching entry in the instrList # and then call entry[1](line[3]) to r
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.