Class ExpandPower
- java.lang.Object
-
- com.singularsys.extensions.rewrite.AbstractRewrite
-
- com.singularsys.extensions.rewrite.ExpandPower
-
- All Implemented Interfaces:
RewriteRuleI,JepComponent,java.io.Serializable
public class ExpandPower extends AbstractRewrite
Expands powers (a+b)^2 -> a^2+2*a*b+b^2- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExpandPower()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Nodeapply(ASTFunNode node, Node[] children)Rewrites the nodebooleantest(ASTFunNode node, 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
-
-
-
-
Method Detail
-
test
public boolean test(ASTFunNode node, Node[] children)
Description copied from interface:RewriteRuleIReturns true if node needs to be rewritten, according to this rule.
-
apply
public Node apply(ASTFunNode node, Node[] children) throws ParseException
Description copied from interface:RewriteRuleIRewrites the node- Throws:
ParseException
-
-