Class CollectPowers
java.lang.Object
com.singularsys.extensions.rewrite.AbstractRewrite
com.singularsys.extensions.rewrite.CollectPowers
- All Implemented Interfaces:
RewriteRuleI,JepComponent,Serializable
Collect powers together so that
x*x -> x^2 and x^n*x -> x^(n+1).- Author:
- Rich Morris Created on 06-Oct-2004
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(ASTFunNode node, List<Node> children) Rewrites the nodebooleantest(ASTFunNode node, List<Node> children) Returns true if node needs to be rewritten, according to this rule.Methods inherited from class com.singularsys.extensions.rewrite.AbstractRewrite
getLightWeightInstance, init, toString
-
Constructor Details
-
CollectPowers
public CollectPowers()
-
-
Method Details
-
test
Description copied from interface:RewriteRuleIReturns true if node needs to be rewritten, according to this rule. -
apply
Description copied from interface:RewriteRuleIRewrites the node- Throws:
ParseException
-