1 8 package org.lsmp.djep.vectorJep; 9 10 import org.nfunk.jep.*; 11 import org.lsmp.djep.vectorJep.function.*; 12 import org.lsmp.djep.vectorJep.values.*; 13 import java.util.*; 14 15 22 public class VectorJep extends JEP { 23 24 25 public VectorJep() { 26 super(); 27 28 37 opSet = new VOperatorSet(); 38 this.parser.setInitialTokenManagerState(Parser.NO_DOT_IN_IDENTIFIERS); 39 } 40 41 public void addStandardFunctions() 42 { 43 super.addStandardFunctions(); 44 super.addFunction("ele",new Ele()); 45 } 46 47 48 public VectorJep(JEP j) { 49 super(j); 50 } 51 52 55 public Object evaluate(Node node) throws Exception 56 { 57 Object res = ev.getValue(node,new Vector(),this.getSymbolTable()); 58 if(res instanceof Scaler) 59 return ((Scaler) res).getEle(0); 60 else 61 return res; 62 } 63 64 65 public Object evaluateRaw(Node node) throws Exception 66 { 67 Object res = ev.getValue(node,new Vector(),this.getSymbolTable()); 68 return res; 69 } 70 71 } 72 | Popular Tags |