Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
[smartthings-infrastructure.git] / Extractor / ExtractorScript.py
index 97b6bff9e9d51414459e73b54eb546612c4589db..27abbc1044d509823a7ce91f2316f8aa99ae41f6 100644 (file)
@@ -47,8 +47,10 @@ def ExtractFunctions(F, appName):
        while (Temp != "EOF"):
                if (Temp == "def" or Temp == "private"):
                        Temp = GetToken(F)
+                       if (Temp == "def" or Temp == "private"):
+                               Temp = GetToken(F)
                        NameofFunc = Temp
-                       if (GetToken(F) != "="): #We have a function to create object for
+                       if (GetToken(F) == "("): #We have a function to create object for
                                if (appName == "App1"):
                                        extractedFunctionsApp1.write("//Global Object for functions in subscribe method!\n")    
                                        extractedFunctionsApp1.write("def %s = this.&" % NameofFunc)
@@ -96,7 +98,6 @@ def ExtractFunctions(F, appName):
        AnalyzePhysicalInteraction(app1Capabilities, app2Capabilities)
        AnalyzePhysicalInteraction(app2Capabilities, app1Capabilities)
 
-               
 
 def AnalyzeCapabilities(Temp, appName, F):
                        #Illuminance related
@@ -418,7 +419,12 @@ def CheckIfOnlyTouchEvents():
                        onlyTouchEvents = False
        if onlyTouchEvents is True and app1Subscribe is True and app2Subscribe is True:
                raise Exception("\n\nDirect-Direct Interaction detected: we are skipping this pair...\n\n")
+<<<<<<< HEAD
+
+
+=======
                
+>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c
 #Extract objects to call functions from App1
 F1 = open("Extractor/App1/App1.groovy", "r")
 extractedFunctionsApp1 = open("Extractor/App1/extractedFunctionsApp1.groovy", "w+")
@@ -477,7 +483,10 @@ extractorFile.close()
 Extractor.close()
 F2.close()
 os.system("groovy -classpath lib/jpf.jar Extractor/extractorFile.groovy")
+<<<<<<< HEAD
+=======
 
 
+>>>>>>> e378d6a65b25030f8914dc97f04b81ddff351d9c