plugger.py
changeset 348 054fbf1ae0f8
parent 338 e19c78831d41
child 350 a3a5561bde1d
equal deleted inserted replaced
347:2ba1aea5c70d 348:054fbf1ae0f8
   891             # IEC2C compiler generate a list of located variables : LOCATED_VARIABLES.h
   891             # IEC2C compiler generate a list of located variables : LOCATED_VARIABLES.h
   892             location_file = open(os.path.join(self._getBuildPath(),"LOCATED_VARIABLES.h"))
   892             location_file = open(os.path.join(self._getBuildPath(),"LOCATED_VARIABLES.h"))
   893             # each line of LOCATED_VARIABLES.h declares a located variable
   893             # each line of LOCATED_VARIABLES.h declares a located variable
   894             lines = [line.strip() for line in location_file.readlines()]
   894             lines = [line.strip() for line in location_file.readlines()]
   895             # This regular expression parses the lines genereated by IEC2C
   895             # This regular expression parses the lines genereated by IEC2C
   896             LOCATED_MODEL = re.compile("__LOCATED_VAR\((?P<IEC_TYPE>[A-Z]*),(?P<NAME>[_A-Za-z0-9]*),(?P<DIR>[QMI])(?:,(?P<SIZE>[XBWD]))?,(?P<LOC>[,0-9]*)\)")
   896             LOCATED_MODEL = re.compile("__LOCATED_VAR\((?P<IEC_TYPE>[A-Z]*),(?P<NAME>[_A-Za-z0-9]*),(?P<DIR>[QMI])(?:,(?P<SIZE>[XBWDL]))?,(?P<LOC>[,0-9]*)\)")
   897             for line in lines:
   897             for line in lines:
   898                 # If line match RE, 
   898                 # If line match RE, 
   899                 result = LOCATED_MODEL.match(line)
   899                 result = LOCATED_MODEL.match(line)
   900                 if result:
   900                 if result:
   901                     # Get the resulting dict
   901                     # Get the resulting dict