path

File path.str
Author Eric Bouwers
Since unknown

Module containing strategies to handle the paths in PHP.




Statistics


General
Lines of code 185
Stratego
Module number 1 (100% documented)
Constructor number 0
Overlay number 0
Strategy number 12 (100% documented)
Rule number 5 (20% documented)
DynamicRule number 0



Strategy summary


add-dir(Strategy get-dir, ATerm path) Add a directory to a path path.str
find-file-in-directory(Strategy add-prefix, ATerm filename) we do not use the defined 'find-in-path' because we always want to work with the full path to a file path.str
get-path-separator Takes an _absolute_ path and determines the path separator path.str
get-php-direcory(ATerm dir) Retrieves a path from the configuration table path.str
is-php-relative Determine wheter or not a path is relative path.str
normalize-path Normalizes an _absolute_ path to the normalized path path.str
path-to-list Parses a path to a list of directories path.str
php-directory-config-name(ATerm dir) Wrapes a directory within "php-" and "-directory" path.str
repeat-until-fixpoint(Strategy s) Repeats an application of a strategy until the strategy has no effect anymore path.str
set-php-direcory(ATerm dir, ATerm path) Saves a path to the configuration table path.str
split-at-bang Splits a string at every backslash path.str
split-at-char(ATerm chr) Splits a string at every occurence of a given character path.str

Rule summary


CharSplitExit n/a path.str
CharSplitInit(ATerm chr) n/a path.str
CharSplitNext n/a path.str
once-filter-this-and-before(Strategy s) This strategy filters 2 elements from a list of the second element satisfies a given strategy path.str
once-filter-this-and-before(Strategy s) n/a path.str



Strategy details


ATerm add-dir(Strategy get-dir, ATerm path)
File path.str
Author unknown
Since unknown
 
Parameters
Strategy get-dir get-dir The strategy that builds the dir to add
ATerm path path The path to which the dir should be added

Add a directory to a path.



 
ATerm find-file-in-directory(Strategy add-prefix, ATerm filename)
File path.str
Author unknown
Since unknown
 

we do not use the defined 'find-in-path' because we always want to work with the full path to a file.



 
ATerm get-path-separator
File path.str
Author unknown
Since unknown
 

Takes an _absolute_ path and determines the path separator.


type String -> String

 
ATerm get-php-direcory(ATerm dir)
File path.str
Author unknown
Since unknown
 
Parameters
ATerm dir dir The name of the path

Retrieves a path from the configuration table.



 
ATerm is-php-relative
File path.str
Author unknown
Since unknown
 

Determine wheter or not a path is relative. Apath is php-relative if it starts with a '.'


type String -> String

 
ATerm normalize-path
File path.str
Author unknown
Since unknown
 

Normalizes an _absolute_ path to the normalized path. That means thatall occurences of '.' are just stripped away and that every occurenceof '..' is removed together with the directory right before it.This will give the path to the same file without walking around.The strategy only works with an absolute path!


type String -> String

 
ATerm path-to-list
File path.str
Author unknown
Since unknown
 

Parses a path to a list of directories


type String -> List(String)

 
ATerm php-directory-config-name(ATerm dir)
File path.str
Author unknown
Since unknown
 

Wrapes a directory within "php-" and "-directory"



 
ATerm repeat-until-fixpoint(Strategy s)
File path.str
Author unknown
Since unknown
 
Parameters
Strategy s strategy to be applied

Repeats an application of a strategy until the strategy hasno effect anymore.


type ATerm -> ATerm

 
ATerm set-php-direcory(ATerm dir, ATerm path)
File path.str
Author unknown
Since unknown
 
Parameters
ATerm dir dir The name to be used in the storage
ATerm path path The path to save

Saves a path to the configuration table.



 
ATerm split-at-bang
File path.str
Author unknown
Since unknown
 

Splits a string at every backslash


type String -> List(String)

 
ATerm split-at-char(ATerm chr)
File path.str
Author unknown
Since unknown
 
Parameters
ATerm chr chr Number of the character to split at

Splits a string at every occurence of a given character.


type String -> List(String)

 

Rule details


ATerm once-filter-this-and-before(Strategy s)
File path.str
Author unknown
Since unknown
 
Parameters
Strategy s Strategy that should be satisfied

This strategy filters 2 elements from a list of the secondelement satisfies a given strategy. It does this once.


type List(a) -> List(a)