org.lsmp.djep.matrixJep
Class MatrixPreprocessor

java.lang.Object
  extended by org.lsmp.djep.matrixJep.MatrixPreprocessor
All Implemented Interfaces:
ParserVisitor

public class MatrixPreprocessor
extends java.lang.Object
implements ParserVisitor

This visitor does the majority of preprocessing work. Specifically it

The visitor will return a new Tree.

Author:
Rich Morris Created on 30-Oct-2003

Constructor Summary
MatrixPreprocessor()
           
 
Method Summary
 MatrixNodeI preprocess(Node node, MatrixJep mdjep)
          Main entry point: pre-process a node.
 java.lang.Object visit(ASTConstant node, java.lang.Object data)
          constants
 java.lang.Object visit(ASTFunNode node, java.lang.Object data)
          visit functions and operators
 java.lang.Object visit(ASTStart node, java.lang.Object data)
           
 java.lang.Object visit(ASTVarNode node, java.lang.Object data)
          multi-dimensional differentiable variables
 java.lang.Object visit(SimpleNode node, java.lang.Object data)
           
 MatrixNodeI[] visitChildrenAsArray(Node node, java.lang.Object data)
          Returns an array of matrix nodes which are the results of visiting each child.
 java.lang.Object visitOp(ASTFunNode node, java.lang.Object data)
          operators +,-,*,/
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatrixPreprocessor

public MatrixPreprocessor()
Method Detail

preprocess

public MatrixNodeI preprocess(Node node,
                              MatrixJep mdjep)
                       throws ParseException
Main entry point: pre-process a node.

Parameters:
node - Top node of tree.
mdjep - Reference to MatrixJep instance
Returns:
A new tree with all preprocessing carried out.
Throws:
ParseException

visitChildrenAsArray

public MatrixNodeI[] visitChildrenAsArray(Node node,
                                          java.lang.Object data)
                                   throws ParseException
Returns an array of matrix nodes which are the results of visiting each child.

Throws:
ParseException

visit

public java.lang.Object visit(SimpleNode node,
                              java.lang.Object data)
Specified by:
visit in interface ParserVisitor

visit

public java.lang.Object visit(ASTStart node,
                              java.lang.Object data)
Specified by:
visit in interface ParserVisitor

visit

public java.lang.Object visit(ASTConstant node,
                              java.lang.Object data)
                       throws ParseException
constants

Specified by:
visit in interface ParserVisitor
Throws:
ParseException

visit

public java.lang.Object visit(ASTVarNode node,
                              java.lang.Object data)
                       throws ParseException
multi-dimensional differentiable variables

Specified by:
visit in interface ParserVisitor
Throws:
ParseException

visit

public java.lang.Object visit(ASTFunNode node,
                              java.lang.Object data)
                       throws ParseException
visit functions and operators

Specified by:
visit in interface ParserVisitor
Throws:
ParseException

visitOp

public java.lang.Object visitOp(ASTFunNode node,
                                java.lang.Object data)
                         throws ParseException
operators +,-,*,/

Throws:
ParseException


http://www.singularsys.com/jep Copyright © 2007 Singular Systems