001 // GraphLab Project: http://graphlab.sharif.edu 002 // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology 003 // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/ 004 005 package graphlab.plugins.commandline.parsers; 006 007 import bsh.Interpreter; 008 import graphlab.plugins.commandline.Shell; 009 010 011 /** 012 * @author Mohammad Ali Rostami 013 * @email ma.rostami@yahoo.com 014 */ 015 016 //overload_multiply(a1,a2) 017 public class OperatorParser extends DefaultParser { 018 public OperatorParser(Interpreter interpreter, Shell shell) { 019 super(shell); 020 } 021 } 022 023 /* public OperatorParser(Interpreter interpreter , BSHFile file) { 024 super(interpreter); 025 try { 026 interpreter.source(file.getAbsolutePath()); 027 } catch (IOException e) { 028 e.printStackTrace(); 029 } catch (EvalError evalError) { 030 evalError.printStackTrace(); 031 } 032 } 033 034 public void add(BSHFile file) 035 { 036 try { 037 interpreter.source( file.getAbsolutePath()); 038 } catch (IOException e) { 039 e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. 040 } catch (EvalError evalError) { 041 evalError.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. 042 } 043 } 044 045 public String parse(String s) 046 { 047 String previous = ""; 048 for(int i=0;i < s.length();i++) 049 { 050 if(s.charAt(i) == '*') 051 { 052 int number = 0; 053 for(int j=i; j >= 0; j--) 054 { 055 if(s.charAt(j) == ' ') 056 { 057 058 } 059 } 060 } 061 062 previous = ""; 063 } 064 return super.parse(s); 065 } 066 } 067 */