typejuggling

File typejuggling.str
Author Eric Bouwers
Since unknown

Strategies that do type juggling.Apply the rules on a PHPPrimitiveType toget a PHPPrimitiveType of the desired type.




Statistics


General
Lines of code 355
Stratego
Module number 1 (100% documented)
Constructor number 0
Overlay number 0
Strategy number 10 (100% documented)
Rule number 38 (15% documented)
DynamicRule number 0



Strategy summary


extract-float-part Extracts the start of a string that can be interperted as an float typejuggling.str
extract-integer-part Extracts the start of a string that can be interperted as an integer typejuggling.str
generic-get-php-array-value Generic type to Array typejuggling.str
get-php-number-value Introduction of pseudo-type number typejuggling.str
take-decimal-part Returns the elements of a list of Chars the correspond to a " typejuggling.str
take-exponent-part Returns the elements of a list of Chars the correspond to a "e" and a sequence of numbers typejuggling.str
take-exponent-part Returns the elements of a list of Chars the correspond to a "E" and a sequence of numbers typejuggling.str
take-negative-part(Strategy s) Matches on the "-" and a givens strategy typejuggling.str
take-positive-part(Strategy s) Matches on the "+" and a givens strategy typejuggling.str
try-take-pos-take-neg(Strategy s) Tries to match element of a list given a strategy typejuggling.str

Rule summary


get-php-array-value Converting to PHPArray see: http://www typejuggling.str
get-php-array-value n/a typejuggling.str
get-php-array-value n/a typejuggling.str
get-php-array-value n/a typejuggling.str
get-php-array-value n/a typejuggling.str
get-php-array-value n/a typejuggling.str
get-php-boolean-value Converting to PHPBoolean typejuggling.str
get-php-boolean-value n/a typejuggling.str
get-php-boolean-value n/a typejuggling.str
get-php-boolean-value n/a typejuggling.str
get-php-boolean-value n/a typejuggling.str
get-php-boolean-value n/a typejuggling.str
get-php-float-value Converting to PHPFloat typejuggling.str
get-php-float-value n/a typejuggling.str
get-php-float-value n/a typejuggling.str
get-php-float-value n/a typejuggling.str
get-php-float-value n/a typejuggling.str
get-php-float-value n/a typejuggling.str
get-php-float-value n/a typejuggling.str
get-php-float-value n/a typejuggling.str
get-php-integer-value Converting to PHPInteger typejuggling.str
get-php-integer-value n/a typejuggling.str
get-php-integer-value n/a typejuggling.str
get-php-integer-value n/a typejuggling.str
get-php-integer-value n/a typejuggling.str
get-php-integer-value n/a typejuggling.str
get-php-integer-value n/a typejuggling.str
get-php-integer-value n/a typejuggling.str
get-php-string-value Converting to PHPString typejuggling.str
get-php-string-value n/a typejuggling.str
get-php-string-value n/a typejuggling.str
get-php-string-value n/a typejuggling.str
get-php-string-value n/a typejuggling.str
get-php-string-value n/a typejuggling.str
get-php-string-value n/a typejuggling.str
take-float-part Takes a list of Chars and extracts the part that can be interpreted as a float typejuggling.str
take-float-part n/a typejuggling.str
take-float-part n/a typejuggling.str



Strategy details


ATerm extract-float-part
File typejuggling.str
Author unknown
Since unknown
 

Extracts the start of a string that can be interperted as anfloat.


type String -> String

 
ATerm extract-integer-part
File typejuggling.str
Author unknown
Since unknown
 

Extracts the start of a string that can be interperted as aninteger.


type String -> String

 
ATerm generic-get-php-array-value
File typejuggling.str
Author unknown
Since unknown
 

Generic type to Array. It will make an array with one indexwith the value the strategy is applied on.


type PHPPrimitiveType -> PHPArray

 
ATerm get-php-number-value
File typejuggling.str
Author unknown
Since unknown
 

Introduction of pseudo-type number. It tries to get a float- or an integervalue. This strategy should be used for everything that is documented withnumber values.



 
ATerm take-decimal-part
File typejuggling.str
Author unknown
Since unknown
 

Returns the elements of a list of Chars the correspondto a "." and a sequence of numbers.


type : List(Char) -> List(Char)

 
ATerm take-exponent-part
File typejuggling.str
Author unknown
Since unknown
 

Returns the elements of a list of Chars the correspondto a "e" and a sequence of numbers.


type : List(Char) -> List(Char)

 
ATerm take-exponent-part
File typejuggling.str
Author unknown
Since unknown
 

Returns the elements of a list of Chars the correspondto a "E" and a sequence of numbers.


type : List(Char) -> List(Char)

 
ATerm take-negative-part(Strategy s)
File typejuggling.str
Author unknown
Since unknown
 

Matches on the "-" and a givens strategy. Build the result asthe "-" and the result of the strategy.


type : List(Char) -> List(Char)

 
ATerm take-positive-part(Strategy s)
File typejuggling.str
Author unknown
Since unknown
 

Matches on the "+" and a givens strategy. Build the result asthe "+" and the result of the strategy.


type : List(Char) -> List(Char)

 
ATerm try-take-pos-take-neg(Strategy s)
File typejuggling.str
Author unknown
Since unknown
 

Tries to match element of a list given a strategy.It first matches on a "+" or a "-".


type : List(Char) -> List(Char)

 

Rule details


ATerm get-php-array-value
File typejuggling.str
Author unknown
Since unknown
 

Converting to PHPArraysee: http://www.php.net/manual/en/language.types.array.php#language.types.array.casting


type PHPPrimitiveType -> PHPArray

 
ATerm get-php-boolean-value
File typejuggling.str
Author unknown
Since unknown
 

Converting to PHPBoolean.see: http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting


type PHPPrimitiveType -> PHPBoolean

 
ATerm get-php-float-value
File typejuggling.str
Author unknown
Since unknown
 

Converting to PHPFloat.see: http://www.php.net/manual/en/language.types.float.php#language.types.float.casting


type PHPPrimitiveType -> PHPFloat

 
ATerm get-php-integer-value
File typejuggling.str
Author unknown
Since unknown
 

Converting to PHPInteger.see: http://www.php.net/manual/en/language.types.integer.php#language.types.integer.casting


type PHPPrimitiveType -> PHPInteger

 
ATerm get-php-string-value
File typejuggling.str
Author unknown
Since unknown
 

Converting to PHPString.see: http://www.php.net/manual/en/language.types.string.php#language.types.string.casting


type PHPPrimitiveType -> PHPString

 
ATerm take-float-part
File typejuggling.str
Author unknown
Since unknown
 

Takes a list of Chars and extracts the part that can be interpreted as afloat. This is an optional list of numbers, an optional point, a list ofnumbers followed by an optional e/E with numbers behind it.(0-9]+ [\.]? [0-9]+? ([eE][0-9]+)?

The rule truncates the rest of the list.


Type : List(Char) -> List(Char)