Commit 7610efe4 authored by Matthew Dawson's avatar Matthew Dawson
Browse files

First run full integration.

Matlab -> CVC output is now fully handled by the java app.  Currently
requires some manual setup, but once done everything just works from the
gui.  Some extra output needs work still.


git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/branches/TableTool_javization@9653 57e6efec-57d4-0310-aeb1-a6c144bb1a8b
parent 4fe511e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ package ca.mcmaster.cas.matlab2smt;
 *
 * @author matthew
 */
interface MatlabExpression {
public interface MatlabExpression {
    VariableType type();
    
    String getCVC3Output();
+5 −2
Original line number Diff line number Diff line
@@ -10,15 +10,18 @@ package ca.mcmaster.cas.matlab2smt;
 */
enum MatlabOperation {
    Addition("+"),
    GreaterThen(">");
    GreaterThen(">"),
    Equals("=");

    static MatlabOperation getOpForSymbol(String text) {
        if(text.equals("+")) {
                return Addition;
        } else if(text.equals(">")) {
                return GreaterThen;
        } else if(text.equals("==")) {
                return Equals;
        } else {
                throw new IllegalArgumentException("No such matlab operation defined!");
                throw new IllegalArgumentException("No such matlab operation defined (" + text + ")!");
        }
    }

+6 −6
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@ import org.antlr.v4.runtime.tree.ParseTreeWalker;
 *
 * @author matthew
 */
public class MatlabParser {
    MatlabParser(VariableParser variableListing, String matlabCode) {
final public class MatlabParser {
    public MatlabParser(VariableParser variableListing, String matlabCode) {
        m_variableParser = variableListing;
        parseMatlabCode(matlabCode);
    }
@@ -56,7 +56,7 @@ public class MatlabParser {
        walker.walk(listener, tree);
    }
    
    MatlabExpression getRootExpression() {
    public MatlabExpression getRootExpression() {
        return m_rootExpression;
    }
    
@@ -298,7 +298,7 @@ public class MatlabParser {
    
    }
    
    MatlabExpression m_rootExpression;
    int m_level = 0, m_exprLevel = 0;
    VariableParser m_variableParser;
    private MatlabExpression m_rootExpression;
    private int m_level = 0, m_exprLevel = 0;
    private VariableParser m_variableParser;
}