reduce

File reduce.str
Author Martin Bravenboer <martin.bravenboer@gmail.com>
Since unknown

Removes non-terminals that are not productive or reachable.




Statistics


General
Lines of code 138
Stratego
Module number 1 (100% documented)
Constructor number 0
Overlay number 0
Strategy number 8 (100% documented)
Rule number 0
DynamicRule number 0



Strategy summary


rtg-all-nonterms-in(ATerm nts) Succeeds if all non-terminals in the production are in the specified set of non-terminals reduce.str
rtg-can-be-produced(ATerm nt, ATerm productive, ATerm rhg) Succeeds if the non-terminal can be produced by the rtg given the set of productive non-terminals reduce.str
rtg-check-result Exits when the result doesn't contain any productions or start symbols reduce.str
rtg-collect-nonterms Collect all (not build in) non-terminals in a rhg (or anything else) reduce.str
rtg-productive-nonterms Returns the set of productive non terminals in the rhg reduce.str
rtg-reachable-nonterms Returns the set of reachable non terminals in the rhg reduce.str
rtg-reduce n/a reduce.str
rtg-set-inc-repeat(Strategy s) Repeats s until the current set is no longer being extended reduce.str



Strategy details


ATerm rtg-all-nonterms-in(ATerm nts)
File reduce.str
Author unknown
Since unknown
 

Succeeds if all non-terminals in the production are in the specifiedset of non-terminals.


type ProdRule -> ProdRule

 
ATerm rtg-can-be-produced(ATerm nt, ATerm productive, ATerm rhg)
File reduce.str
Author unknown
Since unknown
 

Succeeds if the non-terminal can be produced by the rtg given the set of productive non-terminals.

FIXME: this strategy seems to use one on a list?



 
ATerm rtg-check-result
File reduce.str
Author unknown
Since unknown
 

Exits when the result doesn't contain any productions or start symbols.


type RTG -> RTG

 
ATerm rtg-collect-nonterms
File reduce.str
Author unknown
Since unknown
 

Collect all (not build in) non-terminals in a rhg (or anything else).


type RTG -> Set(NonTerm)

 
ATerm rtg-productive-nonterms
File reduce.str
Author unknown
Since unknown
 

Returns the set of productive non terminals in the rhg.


type RTG -> Set(NonTerm)

 
ATerm rtg-reachable-nonterms
File reduce.str
Author unknown
Since unknown
 

Returns the set of reachable non terminals in the rhg.


type RTG -> Set(NonTerm)

 
ATerm rtg-reduce
File reduce.str
Author unknown
Since unknown
 

No information available.


type RTG -> RTG

 
ATerm rtg-set-inc-repeat(Strategy s)
File reduce.str
Author unknown
Since unknown
 

Repeats s until the current set is no longer being extended.


type Set(a) -> Set(a)