org.lsmp.djep.rewrite
Class CollectPowers
java.lang.Object
org.lsmp.djep.rewrite.AbstractRewrite
org.lsmp.djep.rewrite.CollectPowers
- All Implemented Interfaces:
- RewriteRuleI
public class CollectPowers
- extends AbstractRewrite
Collect powers together so that x*x -> x^2 and x^n*x -> x^(n+1).
- Author:
- Rich Morris
Created on 06-Oct-2004
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectPowers
public CollectPowers(XJep xj)
test
public boolean test(ASTFunNode node,
Node[] children)
- Description copied from interface:
RewriteRuleI
- Returns 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:
RewriteRuleI
- Rewrites the node
- Throws:
ParseException
Copyright © 2014. All rights reserved.