Skip to main content

module lang::php::analysis::NamePaths

rascal-0.43.0
org.rascalmpl.php-analysis-0.3.6

Usage​

import lang::php::analysis::NamePaths;

Dependencies​

import String;
import IO;

function addLibrary​

loc addLibrary(loc l, str library)

loc addLibrary(loc l, str library)

Define name paths, which are equivalent to M3 locs

function cleanString​

str cleanString(str input)

function functionPath​

loc functionPath(str fname, str library="", str namespace="")

loc functionPath(str fname, str library="", str namespace="")

Create name paths for a function, with or without an explicit namespace

function isFunctionPath​

bool isFunctionPath(loc path)

Check to see if the provided path is for a PHP function

function getFunctionName​

str getFunctionName(loc functionPath)

Get the name of the function defined by the path

function closurePath​

loc closurePath(loc closureLoc, str library="", str namespace="")

loc closurePath(loc closureLoc, str library="", str namespace="")

Create name paths for a closure, with or without an explicit namespace

function isClosurePath​

bool isClosurePath(loc path)

Check to see if the provided path is for a PHP closure

function constPath​

loc constPath(str cname, str library="", str namespace="")

loc constPath(str cname, str library="", str namespace="")

Create name paths for a regular constant, with or without an explicit namespace

function isConstPath​

bool isConstPath(loc path)

Check to see if the provided path is for a PHP constant

function getConstName​

str getConstName(loc constPath)

Get the name of the constant defined by the path

function classPath​

loc classPath(str cname, str library="", str namespace="")

loc classPath(str cname, str library="", str namespace="")

Create name paths for a class, with or without an explicit namespace

function interfacePath​

loc interfacePath(str iname, str library="", str namespace="")

loc interfacePath(str iname, str library="", str namespace="")

Create name paths for an interface, with or without an explicit namespace

function traitPath​

loc traitPath(str tname, str library="", str namespace="")

loc traitPath(str tname, str library="", str namespace="")

Create name paths for a trait, with or without an explicit namespace

function methodPath​

loc methodPath(str cname, str mname, str library="", str namespace="")

loc methodPath(str cname, str mname, str library="", str namespace="")

Create name paths for a method, with or without an explicit namespace

function isMethodPath​

bool isMethodPath(loc path)

Check to see if the provided path is for a PHP method

function getMethodClassName​

str getMethodClassName(loc methodPath)

Get the name of the function defined by the path

function getMethodName​

str getMethodName(loc methodPath)

Get the name of the function defined by the path

function fieldPath​

loc fieldPath(str cname, str fname, str library="", str namespace="")

loc fieldPath(str cname, str fname, str library="", str namespace="")

Create name paths for a field, with or without an explicit namespace

function classConstPath​

loc classConstPath(str cname, str constName, str library="", str namespace="")

loc classConstPath(str cname, str constName, str library="", str namespace="")

Create name paths for a class constant, with or without an explicit namespace

function isClassConstPath​

bool isClassConstPath(loc path)

Check to see if the provided path is for a PHP class constant

function getClassConstInfo​

tuple[str className, str constName] getClassConstInfo(loc constPath)

Get the name of the class and constant defined by the path

function getClassConstClassName​

str getClassConstClassName(loc constPath)

Get the name of the class containing the constant defined by the path

function getClassConstName​

str getClassConstName(loc constPath)

Get the name of the constant defined by the path

function scriptPath​

loc scriptPath(str library, str namespace="")

loc scriptPath(str library, str namespace="")

Create name paths for a script, with or without an explicit namespace