Untitled

 avatar
huuductu
plain_text
2 years ago
916 B
1
Indexable
Never
class NFA:
    # def __init__(self):
    #     self.Q = ''
    #     self.sigma = ''
    #     self.delta = ''
    #     self.q0 = ''
    #     self.f = ''

    # def __init__(self,Q,sigma,delta,q0,f):
    #     self.Q = Q
    #     self.sigma = sigma
    #     self.delta = delta
    #     self.q0 = q0
    #     self.f = f

    def readJSON(self,nfaFileName):
        import json
        with open(nfaFileName, 'r') as file:
            nfaJson = json.load(file)
        self.Q = nfaJson['Q']
        self.sigma = nfaJson['sigma']
        self.delta = nfaJson['delta']
        self.q0 = nfaJson['q0']
        self.f = nfaJson['f']
    
    def process(self,s):
        print(s)

    def input(self):
        nfaFileName = input()
        self.readJSON(nfaFileName)
        print(self.Q)
    	print(self.sigma)
    	print(self.q0)
    	print(self.q3)
	
test = NFA()
test.input()