Commit 12996505 authored by sarah.grebing's avatar sarah.grebing

Merge branch 'luonng_variableAssignment' into 'master'

Luonng variable assignment

See merge request !27
parents 36832366 19df8932
Pipeline #38416 passed with stages
in 2 minutes and 22 seconds
...@@ -211,7 +211,7 @@ public interface ASTTraversal<T> extends Visitor<T> { ...@@ -211,7 +211,7 @@ public interface ASTTraversal<T> extends Visitor<T> {
} }
@Override @Override
default T visit(DerivableCase derivableCase){ default T visit(DerivableCase derivableCase) {
derivableCase.getExpression().accept(this); derivableCase.getExpression().accept(this);
derivableCase.getBody().accept(this); derivableCase.getBody().accept(this);
return null; return null;
......
...@@ -414,8 +414,7 @@ public class TransformAst implements ScriptLanguageVisitor<Object> { ...@@ -414,8 +414,7 @@ public class TransformAst implements ScriptLanguageVisitor<Object> {
Expression pattern = (Expression) ctx.derivableExpression.accept(this); Expression pattern = (Expression) ctx.derivableExpression.accept(this);
((DerivableCase) cs).setExpression(pattern); ((DerivableCase) cs).setExpression(pattern);
pattern.setParent(cs); pattern.setParent(cs);
} else } else {
{
cs = new GuardedCaseStatement(); cs = new GuardedCaseStatement();
Expression<ParserRuleContext> guard = (Expression<ParserRuleContext>) ctx.expression().accept(this); Expression<ParserRuleContext> guard = (Expression<ParserRuleContext>) ctx.expression().accept(this);
((GuardedCaseStatement) cs).setGuard(guard); ((GuardedCaseStatement) cs).setGuard(guard);
......
...@@ -7,13 +7,13 @@ import lombok.NoArgsConstructor; ...@@ -7,13 +7,13 @@ import lombok.NoArgsConstructor;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
public class DerivableCase extends CaseStatement{ public class DerivableCase extends CaseStatement {
private Expression expression; private Expression expression;
public DerivableCase(Statements copy, Expression copy1) { public DerivableCase(Statements copy, Expression copy1) {
super(copy); super(copy);
this.expression=copy1; this.expression = copy1;
} }
@Override @Override
......
...@@ -43,7 +43,9 @@ import lombok.Setter; ...@@ -43,7 +43,9 @@ import lombok.Setter;
public class MatchExpression extends Expression<ScriptLanguageParser.MatchPatternContext> { public class MatchExpression extends Expression<ScriptLanguageParser.MatchPatternContext> {
//private Signature signature = new Signature(); //private Signature signature = new Signature();
private Expression pattern; private Expression pattern;
@Deprecated @Getter @Setter @Deprecated
@Getter
@Setter
private boolean isDerivable = false; private boolean isDerivable = false;
@Deprecated @Deprecated
private Expression derivableTerm; private Expression derivableTerm;
......
...@@ -148,8 +148,6 @@ public class KeyInterpreter extends Interpreter<KeyData> { ...@@ -148,8 +148,6 @@ public class KeyInterpreter extends Interpreter<KeyData> {
} }
@Override @Override
public Object visit(LetStatement let) { public Object visit(LetStatement let) {
enterScope(let); enterScope(let);
......
...@@ -123,6 +123,9 @@ public class KeyData { ...@@ -123,6 +123,9 @@ public class KeyData {
return programStatementsLabel; return programStatementsLabel;
} }
public void getVarAssignment() {
}
public Goal getGoal() { public Goal getGoal() {
return goal; return goal;
......
...@@ -67,7 +67,7 @@ public class ProofScriptCommandBuilder implements CommandHandler<KeyData> { ...@@ -67,7 +67,7 @@ public class ProofScriptCommandBuilder implements CommandHandler<KeyData> {
State<KeyData> state = interpreter.getCurrentState(); State<KeyData> state = interpreter.getCurrentState();
//multiple goals exist //multiple goals exist
if(state.getGoals().size() > 1) { if (state.getGoals().size() > 1) {
throw new IllegalStateException("Multiple open goals: Please use a selector."); throw new IllegalStateException("Multiple open goals: Please use a selector.");
/* /*
//TODO: Utils showWarning //TODO: Utils showWarning
......
...@@ -62,7 +62,7 @@ public class KeYMatcher implements MatcherApi<KeyData> { ...@@ -62,7 +62,7 @@ public class KeYMatcher implements MatcherApi<KeyData> {
Proof proof = kd.getData().getProof(); Proof proof = kd.getData().getProof();
TermValue tv = (TermValue) pattern.getData(); TermValue tv = (TermValue) pattern.getData();
Term term = tv.getTerm(); Term term = tv.getTerm();
if(term == null) { if (term == null) {
Services services = kd.getData().getProof().getServices(); Services services = kd.getData().getProof().getServices();
try { try {
term = new TermBuilder(services.getTermFactory(), services).parseTerm(tv.getTermRepr()); term = new TermBuilder(services.getTermFactory(), services).parseTerm(tv.getTermRepr());
...@@ -96,10 +96,10 @@ public class KeYMatcher implements MatcherApi<KeyData> { ...@@ -96,10 +96,10 @@ public class KeYMatcher implements MatcherApi<KeyData> {
if (isDerivable) { if (isDerivable) {
//find the open goal node //find the open goal node
Goal toSet= null; Goal toSet = null;
if(goalList.head().node().isClosed()){ if (goalList.head().node().isClosed()) {
toSet = goalList.tail().head(); toSet = goalList.tail().head();
} else{ } else {
toSet = goalList.head(); toSet = goalList.head();
} }
KeyData kdataNew = new KeyData(kd.getData(), toSet); KeyData kdataNew = new KeyData(kd.getData(), toSet);
......
...@@ -34,7 +34,7 @@ public class KeyMatcherDerivableTest { ...@@ -34,7 +34,7 @@ public class KeyMatcherDerivableTest {
System.out.println(proof); System.out.println(proof);
// Assert.assertNotNull(a); // Assert.assertNotNull(a);
Assert.assertEquals(1, proof.getSubtreeGoals(proof.root()).size()); Assert.assertEquals(1, proof.getSubtreeGoals(proof.root()).size());
} }
......
...@@ -148,6 +148,7 @@ public class Interpreter<T> extends DefaultASTVisitor<Object> ...@@ -148,6 +148,7 @@ public class Interpreter<T> extends DefaultASTVisitor<Object>
Variable var = assignmentStatement.getLhs(); Variable var = assignmentStatement.getLhs();
Expression expr = assignmentStatement.getRhs(); Expression expr = assignmentStatement.getRhs();
if (t != null) { if (t != null) {
System.out.println("t = " + t+ var);
node.declareVariable(var, t); node.declareVariable(var, t);
} }
...@@ -160,6 +161,7 @@ public class Interpreter<T> extends DefaultASTVisitor<Object> ...@@ -160,6 +161,7 @@ public class Interpreter<T> extends DefaultASTVisitor<Object>
if (fireVariableAssignmentHook(node, var.getIdentifier(), v)) { if (fireVariableAssignmentHook(node, var.getIdentifier(), v)) {
node.setVariableValue(var, v); node.setVariableValue(var, v);
} }
System.out.println("v = " + v);
node.setVariableValue(var, v); node.setVariableValue(var, v);
} }
} }
...@@ -218,8 +220,8 @@ public class Interpreter<T> extends DefaultASTVisitor<Object> ...@@ -218,8 +220,8 @@ public class Interpreter<T> extends DefaultASTVisitor<Object>
GoalNode<T> selectedGoal = currentStateToMatch.getSelectedGoalNode(); GoalNode<T> selectedGoal = currentStateToMatch.getSelectedGoalNode();
assert currentStateToMatch.getGoals().contains(selectedGoal); assert currentStateToMatch.getGoals().contains(selectedGoal);
Value v = evaluate(pattern); Value v = evaluate(pattern);
if(v.getType() == TypeFacade.ANY_TERM){ if (v.getType() == TypeFacade.ANY_TERM) {
GoalNode<T> newGoalNode= matcherApi.isDerivable(selectedGoal, v); GoalNode<T> newGoalNode = matcherApi.isDerivable(selectedGoal, v);
try { try {
enterScope(derivableCase); enterScope(derivableCase);
...@@ -236,7 +238,7 @@ public class Interpreter<T> extends DefaultASTVisitor<Object> ...@@ -236,7 +238,7 @@ public class Interpreter<T> extends DefaultASTVisitor<Object>
exitScope(derivableCase); exitScope(derivableCase);
} }
} else { } else {
throw new RuntimeException("A derivable expression must contain a term. Received a"+v.getType()); throw new RuntimeException("A derivable expression must contain a term. Received a" + v.getType());
} }
} }
......
...@@ -191,9 +191,9 @@ public class MatchEvaluator extends DefaultASTVisitor<List<VariableAssignment>> ...@@ -191,9 +191,9 @@ public class MatchEvaluator extends DefaultASTVisitor<List<VariableAssignment>>
Operator op = e.getOperator(); Operator op = e.getOperator();
Expression expr = e.getExpression(); Expression expr = e.getExpression();
List<VariableAssignment> exValue = (List<VariableAssignment>) expr.accept(this); List<VariableAssignment> exValue = (List<VariableAssignment>) expr.accept(this);
if(exValue.isEmpty()){ if (exValue.isEmpty()) {
return transformTruthValue(Value.TRUE); return transformTruthValue(Value.TRUE);
}else{ } else {
return transformTruthValue(Value.FALSE); return transformTruthValue(Value.FALSE);
} }
......
...@@ -54,8 +54,8 @@ public class GoalNode<T> { ...@@ -54,8 +54,8 @@ public class GoalNode<T> {
this.id = id; this.id = id;
} }
private GoalNode(int id, GoalNode<T> parent, VariableAssignment ass, T data, boolean isClosed) { private GoalNode(int id, GoalNode<T> parent, VariableAssignment varas, T data, boolean isClosed) {
this(parent, ass, data, isClosed); this(parent, varas, data, isClosed);
this.id = id; this.id = id;
} }
...@@ -64,6 +64,12 @@ public class GoalNode<T> { ...@@ -64,6 +64,12 @@ public class GoalNode<T> {
this.isClosed = isClosed; this.isClosed = isClosed;
this.id = id; this.id = id;
} }
private GoalNode(int id, VariableAssignment ass, T data, boolean isClosed) {
this(data);
this.assignments = ass;
this.isClosed = isClosed;
this.id = id;
}
/** /**
* @param varname * @param varname
...@@ -133,11 +139,13 @@ public class GoalNode<T> { ...@@ -133,11 +139,13 @@ public class GoalNode<T> {
* @return * @return
*/ */
public GoalNode<T> deepCopy() { public GoalNode<T> deepCopy() {
VariableAssignment deepCopy = assignments.deepCopy();
if (parent != null) { if (parent != null) {
VariableAssignment deepCopy = parent.assignments.deepCopy();
return new GoalNode<T>(id, parent.deepCopy(), deepCopy, data, isClosed); return new GoalNode<T>(id, parent.deepCopy(), deepCopy, data, isClosed);
} else { } else {
return new GoalNode<T>(id, data, isClosed);
return new GoalNode<T>(id, deepCopy, data, isClosed);
} }
} }
......
...@@ -129,7 +129,7 @@ public class InteractiveModeController { ...@@ -129,7 +129,7 @@ public class InteractiveModeController {
.filter(keyDataGoalNode -> goalsbeforePrune.contains(keyDataGoalNode.getData().getGoal())) .filter(keyDataGoalNode -> goalsbeforePrune.contains(keyDataGoalNode.getData().getGoal()))
.collect(Collectors.toList()); .collect(Collectors.toList());
if(prunedChildren.size() == 0) { if (prunedChildren.size() == 0) {
//TODO: add Utils.showInfoD //TODO: add Utils.showInfoD
return; return;
} }
...@@ -162,10 +162,10 @@ public class InteractiveModeController { ...@@ -162,10 +162,10 @@ public class InteractiveModeController {
//TODO: buggy cuz allstatements of same node removed //TODO: buggy cuz allstatements of same node removed
//remove statement from cases / script //remove statement from cases / script
Statements statements = (cases.get(pruneNode.parent()) == null)? cases.get(pruneNode) : cases.get(pruneNode.parent()); Statements statements = (cases.get(pruneNode.parent()) == null) ? cases.get(pruneNode) : cases.get(pruneNode.parent());
int i = statements.size()-1; int i = statements.size() - 1;
while(statements.get(i) != pruneStatement && i >= 0) { while (statements.get(i) != pruneStatement && i >= 0) {
statements.remove(i); statements.remove(i);
i--; i--;
} }
...@@ -186,6 +186,7 @@ public class InteractiveModeController { ...@@ -186,6 +186,7 @@ public class InteractiveModeController {
public void stop() { public void stop() {
Events.unregister(this); Events.unregister(this);
//TODO: casesstatement visiten
String c = getCasesAsString(); String c = getCasesAsString();
scriptController.getDockNode(scriptArea).undock(); scriptController.getDockNode(scriptArea).undock();
......
...@@ -2,14 +2,18 @@ package edu.kit.iti.formal.psdbg.gui.controls; ...@@ -2,14 +2,18 @@ package edu.kit.iti.formal.psdbg.gui.controls;
import com.google.common.collect.BiMap; import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap; import com.google.common.collect.HashBiMap;
import edu.kit.iti.formal.psdbg.gui.model.InspectionModel;
import edu.kit.iti.formal.psdbg.interpreter.data.KeyData; import edu.kit.iti.formal.psdbg.interpreter.data.KeyData;
import edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment;
import javafx.beans.property.ObjectProperty; import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleObjectProperty;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.ContextMenu; import javafx.scene.Scene;
import javafx.scene.control.RadioMenuItem; import javafx.scene.control.*;
import javafx.scene.control.Toggle; import javafx.stage.Stage;
import javafx.scene.control.ToggleGroup; import lombok.Setter;
import java.util.function.Function; import java.util.function.Function;
...@@ -20,10 +24,17 @@ public class GoalOptionsMenu extends ContextMenu { ...@@ -20,10 +24,17 @@ public class GoalOptionsMenu extends ContextMenu {
@FXML @FXML
private RadioMenuItem rmiShowSequent, rmiCFL, rmiCFS, rmiBranchLabels, rmiNodeNames, rmiRuleNames; private RadioMenuItem rmiShowSequent, rmiCFL, rmiCFS, rmiBranchLabels, rmiNodeNames, rmiRuleNames;
@FXML
private MenuItem showVarAssignment;
@Setter
private InspectionModel model;
private ObjectProperty<ViewOption> selectedViewOption = new SimpleObjectProperty<>(); private ObjectProperty<ViewOption> selectedViewOption = new SimpleObjectProperty<>();
private BiMap<Toggle, ViewOption> optionMap = HashBiMap.create(6); private BiMap<Toggle, ViewOption> optionMap = HashBiMap.create(6);
public GoalOptionsMenu() { public GoalOptionsMenu() {
Utils.createWithFXML(this); Utils.createWithFXML(this);
...@@ -44,6 +55,27 @@ public class GoalOptionsMenu extends ContextMenu { ...@@ -44,6 +55,27 @@ public class GoalOptionsMenu extends ContextMenu {
}); });
selectedViewOption.setValue(ViewOption.SEQUENT); selectedViewOption.setValue(ViewOption.SEQUENT);
showVarAssignment.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
if(model == null || model.getSelectedGoalNodeToShow() == null) {
Utils.showInfoDialog("Select a goal", "Select a goal", "Please select a goal first.");
return;
}
VariableAssignment var_assignm = model.getSelectedGoalNodeToShow().getAssignments();
Stage stage = new Stage();
stage.setTitle("Variable Assignment");
VariableAssignmentWindow vaw = new VariableAssignmentWindow(var_assignm);
Scene scene = new Scene(vaw);
stage.setScene(scene);
stage.show();
}
});
} }
...@@ -55,9 +87,6 @@ public class GoalOptionsMenu extends ContextMenu { ...@@ -55,9 +87,6 @@ public class GoalOptionsMenu extends ContextMenu {
return selectedViewOption; return selectedViewOption;
} }
public void setSelectedViewOption(ViewOption selectedViewOption) {
this.selectedViewOption.set(selectedViewOption);
}
public enum ViewOption { public enum ViewOption {
BRANCHING(KeyData::getBranchingLabel), BRANCHING(KeyData::getBranchingLabel),
...@@ -67,6 +96,7 @@ public class GoalOptionsMenu extends ContextMenu { ...@@ -67,6 +96,7 @@ public class GoalOptionsMenu extends ContextMenu {
NAME(KeyData::getNameLabel), NAME(KeyData::getNameLabel),
SEQUENT(item -> item.getNode().sequent().toString()); SEQUENT(item -> item.getNode().sequent().toString());
private final Function<KeyData, String> projection; private final Function<KeyData, String> projection;
ViewOption(Function<KeyData, String> toString) { ViewOption(Function<KeyData, String> toString) {
...@@ -77,4 +107,6 @@ public class GoalOptionsMenu extends ContextMenu { ...@@ -77,4 +107,6 @@ public class GoalOptionsMenu extends ContextMenu {
return projection.apply(item); return projection.apply(item);
} }
} }
} }
\ No newline at end of file
...@@ -138,6 +138,8 @@ public class InspectionView extends BorderPane { ...@@ -138,6 +138,8 @@ public class InspectionView extends BorderPane {
Utils.addDebugListener(model.get().currentInterpreterGoalProperty()); Utils.addDebugListener(model.get().currentInterpreterGoalProperty());
Utils.addDebugListener(model.get().highlightedJavaLinesProperty()); Utils.addDebugListener(model.get().highlightedJavaLinesProperty());
goalOptionsMenu.setModel(model.get());
/*TODO redefine CSS bases on selected mode /*TODO redefine CSS bases on selected mode
mode.addListener(o -> { mode.addListener(o -> {
getStyleClass().removeAll( getStyleClass().removeAll(
......
...@@ -25,6 +25,7 @@ import javafx.scene.control.ListView; ...@@ -25,6 +25,7 @@ import javafx.scene.control.ListView;
import javafx.scene.control.TextArea; import javafx.scene.control.TextArea;
import javafx.scene.input.MouseEvent; import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import lombok.Getter;
import org.controlsfx.control.StatusBar; import org.controlsfx.control.StatusBar;
import java.util.HashMap; import java.util.HashMap;
...@@ -40,6 +41,8 @@ public class SequentMatcher extends BorderPane { ...@@ -40,6 +41,8 @@ public class SequentMatcher extends BorderPane {
private final ListProperty<Map<String, MatchPath>> results = new SimpleListProperty<>(this, "results", FXCollections.observableArrayList()); private final ListProperty<Map<String, MatchPath>> results = new SimpleListProperty<>(this, "results", FXCollections.observableArrayList());
//sicht user selected //sicht user selected
private final ObjectProperty<GoalNode<KeyData>> selectedGoalNodeToShow = new SimpleObjectProperty<>(this, "selectedGoalNodeToShow"); private final ObjectProperty<GoalNode<KeyData>> selectedGoalNodeToShow = new SimpleObjectProperty<>(this, "selectedGoalNodeToShow");
@Getter
public GoalOptionsMenu goalOptionsMenu = new GoalOptionsMenu(); public GoalOptionsMenu goalOptionsMenu = new GoalOptionsMenu();
@FXML @FXML
private SequentViewForMatcher sequentView; private SequentViewForMatcher sequentView;
...@@ -97,6 +100,7 @@ public class SequentMatcher extends BorderPane { ...@@ -97,6 +100,7 @@ public class SequentMatcher extends BorderPane {
} }
}); });
} }
private void calculateLookupTable() { private void calculateLookupTable() {
......
...@@ -2,6 +2,7 @@ package edu.kit.iti.formal.psdbg.gui.controls; ...@@ -2,6 +2,7 @@ package edu.kit.iti.formal.psdbg.gui.controls;
import edu.kit.iti.formal.psdbg.gui.model.InspectionModel; import edu.kit.iti.formal.psdbg.gui.model.InspectionModel;
import edu.kit.iti.formal.psdbg.interpreter.data.KeyData; import edu.kit.iti.formal.psdbg.interpreter.data.KeyData;
import edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.event.EventHandler; import javafx.event.EventHandler;
import javafx.fxml.FXML; import javafx.fxml.FXML;
...@@ -18,6 +19,8 @@ public class SequentOptionsMenu extends ContextMenu { ...@@ -18,6 +19,8 @@ public class SequentOptionsMenu extends ContextMenu {
private MenuItem openSequentMatcher; private MenuItem openSequentMatcher;
public SequentOptionsMenu(InspectionModel model) { public SequentOptionsMenu(InspectionModel model) {
Utils.createWithFXML(this); Utils.createWithFXML(this);
this.model = model; this.model = model;
...@@ -31,6 +34,9 @@ public class SequentOptionsMenu extends ContextMenu { ...@@ -31,6 +34,9 @@ public class SequentOptionsMenu extends ContextMenu {
KeyData data = (KeyData) model.getSelectedGoalNodeToShow().getData(); KeyData data = (KeyData) model.getSelectedGoalNodeToShow().getData();
SequentMatcher root1 = new SequentMatcher(data.getProof().getServices()); SequentMatcher root1 = new SequentMatcher(data.getProof().getServices());
root1.getGoalOptionsMenu().setModel(model);
root1.setGoals(model.getGoals()); root1.setGoals(model.getGoals());
root1.setSelectedGoalNodeToShow(model.getSelectedGoalNodeToShow()); root1.setSelectedGoalNodeToShow(model.getSelectedGoalNodeToShow());
root1.getStyleClass().add("sequent-view"); root1.getStyleClass().add("sequent-view");
...@@ -58,6 +64,8 @@ public class SequentOptionsMenu extends ContextMenu { ...@@ -58,6 +64,8 @@ public class SequentOptionsMenu extends ContextMenu {
} }
}); });
} }
......
package edu.kit.iti.formal.psdbg.gui.controls;
import alice.tuprolog.Var;
import edu.kit.iti.formal.psdbg.gui.controls.Utils;
import edu.kit.iti.formal.psdbg.gui.model.InspectionModel;
import edu.kit.iti.formal.psdbg.interpreter.assignhook.DefaultAssignmentHook;
import edu.kit.iti.formal.psdbg.interpreter.data.VariableAssignment;
import edu.kit.iti.formal.psdbg.parser.ast.Variable;
import edu.kit.iti.formal.psdbg.parser.types.Type;
import javafx.beans.Observable;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.TabPane;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.BorderPane;
import lombok.Getter;
import lombok.Setter;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
public class VariableAssignmentWindow extends TabPane {
@FXML
TableView declarative_tableView;
@FXML
TableView special_tableView;
/** Non special Variables that don't start with __ **/
private ObservableList<VariableModel> declarativeModel;
/** Variables that start with __ **/
private ObservableList<VariableModel> specialModel;
public VariableAssignmentWindow(VariableAssignment assignment) {
Utils.createWithFXML(this);
if (assignment != null) {
fillInVariableModelsLists(assignment);
}
declarative_tableView.setEditable(false);
special_tableView.setEditable(false);
//Table Colums for declarative_tableView
TableColumn decl_varCol = new TableColumn("Variable");
TableColumn decl_typeCol = new TableColumn("Type");
TableColumn decl_valCol = new TableColumn("Value");
//Set Colums width proportional to windows with
decl_varCol.prefWidthProperty().bind(declarative_tableView.widthProperty().divide(3));
decl_typeCol.prefWidthProperty().bind(declarative_tableView.widthProperty().divide(3));
decl_valCol.prefWidthProperty().bind(declarative_tableView.widthProperty().divide(3));
decl_varCol.setCellValueFactory(
new PropertyValueFactory<VariableModel,String>("varname")
);
decl_typeCol.setCellValueFactory(
new PropertyValueFactory<VariableModel,String>("vartype")
);
decl_valCol.setCellValueFactory(
new PropertyValueFactory<VariableModel,String>("varval")
);
declarative_tableView.setItems(declarativeModel);
declarative_tableView.getColumns().addAll(decl_varCol, decl_typeCol, decl_valCol);
//Table Colums for special_tableView
TableColumn spec_varCol = new TableColumn("Variable");
TableColumn spec_typeCol = new TableColumn("Type");
TableColumn spec_valCol = new TableColumn("Value");
//Set Colums width proportional to windows with
spec_varCol.prefWidthProperty().bind(special_tableView.widthProperty().divide(3));
spec_typeCol.prefWidthProperty().bind(special_tableView.widthProperty().divide(3));
spec_valCol.prefWidthProperty().bind(special_tableView.widthProperty().divide(3));
spec_varCol.setCellValueFactory(
new PropertyValueFactory<VariableModel,String>("varname")
);