示例#1
0
ERR_Location PERR_lowerLocation(PERR_Location pLocation)
{
  PERR_StrCon pFilename = PERR_getLocationFilename(pLocation);
  char *filename = strdup(PERR_lowerStrCon(pFilename));
  ERR_Location location;

  if (PERR_isLocationAreaInFile(pLocation)) {
    PERR_Area pArea = PERR_getLocationArea(pLocation);
    ERR_Area area = PERR_lowerArea(pArea);

    location = ERR_makeLocationAreaInFile(filename, area);
  }
  else {
    location = ERR_makeLocationFile(filename);
  }
  free(filename);
  return location;
}
示例#2
0
/** 
 * Returns the current positional information from the input string.
 * 
 * \param inputString the input string.
 * 
 * \return the current positional information from the input string.
 */
ERR_Location IS_currentPosInfo(InputString inputString) {
  ERR_Location location;
  ERR_Area area;
  
  area = ERR_makeAreaArea(IS_getLinesRead(inputString), 
			  IS_getColumnsRead(inputString), 
			  IS_getLinesRead(inputString),
			  IS_getColumnsRead(inputString), 
			  IS_getNumberOfTokensRead(inputString), 
			  0);

  if (IS_getPath(inputString) == NULL) {
    location = ERR_makeLocationArea(area);
  }
  else {
    location = ERR_makeLocationAreaInFile(IS_getPath(inputString), area);
  }

  return location;
}