module lang::php::util::LocUtils
rascal-0.40.17
php-analysis-0.2.4
Usage
import lang::php::util::LocUtils;
Source code
http://github.com/cwi-swat/php-analysis/blob/main/src/main/rascal/lang/php/util/LocUtils.rsc
Dependencies
import Exception;
import String;
import List;
import Set;
import IO;
data RuntimeException
data RuntimeException
= UnavailableLoc(str unavailablePath)
;
An exception representing the case where a location is not a valid location in the system.
data Branch
data Branch
= root(set[Branch] branches)
| branch(str name, set[Branch] branches)
| file(str name, loc at)
;
function buildBranch
Branch buildBranch(loc l)
function buildSiteTree
Branch buildSiteTree(loc baseLoc)
function pathParts
list[str] pathParts(loc l, loc baseLoc)
function findStartingBranch
tuple[Branch match, list[Branch] parents] findStartingBranch(Branch b, list[str] parts, list[Branch] parents = [ ])
function walkBranches
loc walkBranches(Branch br, list[Branch] parents, str pathexp)
function calculateLoc
loc calculateLoc(set[loc] possibleLocs, loc baseLoc, loc rootLoc, str path, bool pathMayBeChanged = true, list[str] ipath = [], bool checkFS = false)
loc calculateLoc(loc baseLoc, loc rootLoc, str path, Branch site, bool pathMayBeChanged = true, list[str] ipath = [])
Calculate the actual location of a path given as a string.