Index: /Code/ModelTranslator/input/testModel.rsf
===================================================================
--- /Code/ModelTranslator/input/testModel.rsf	(revision 81)
+++ /Code/ModelTranslator/input/testModel.rsf	(revision 82)
@@ -1,5 +1,10 @@
 # A small test-model
-# Has 3 variables
+# Has 4 variables and 4 constraints
 Item	a	boolean
 Item	b	boolean
 Item	c	boolean
+Item	d	boolean
+Depends	a	"c && b"
+Depends	b	"!a || c"
+ItemSelects	a	d	"c && b"
+ItemSelects	b	c	"(!d && b) || a"
Index: /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/AbstractReader.java
===================================================================
--- /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/AbstractReader.java	(revision 81)
+++ /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/AbstractReader.java	(revision 82)
@@ -65,5 +65,5 @@
      * @return A boolean {@link DecisionVariableDeclaration} with the specified name.
      */
-    protected final DecisionVariableDeclaration getVariable(String name) {
+    public final DecisionVariableDeclaration getVariable(String name) {
         return getVariable(name, BooleanType.TYPE);
     }
Index: /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFCondition.java
===================================================================
--- /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFCondition.java	(revision 81)
+++ /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFCondition.java	(revision 82)
@@ -2,4 +2,10 @@
 
 import de.uni_hildesheim.sse.model.cst.ConstraintSyntaxTree;
+import de.uni_hildesheim.sse.model.cst.OCLFeatureCall;
+import de.uni_hildesheim.sse.model.cst.Variable;
+import de.uni_hildesheim.sse.model.varModel.datatypes.OclKeyWords;
+import de.uni_hildesheim.sse.trans.in.AbstractReader;
+import de.uni_hildesheim.sse.trans.in.ParserException;
+import de.uni_hildesheim.sse.trans.in.ParserException.ParserExceptionType;
 
 /**
@@ -8,26 +14,145 @@
  * @author Adam Krafczyk
  */
-class RSFCondition {
+abstract class RSFCondition {
 
-    private String variable;
-    private String condition;
+    /**
+     * Returns this condition as a {@link ConstraintSyntaxTree}.
+     * @param reader The reader to get the variables from.
+     * @return A {@link ConstraintSyntaxTree} representing this condition.
+     * @throws ParserException If the conditions contains an operation, that is not supported by the parser.
+     */
+    abstract ConstraintSyntaxTree toConstraintSyntaxTree(AbstractReader reader) throws ParserException;
     
     /**
-     * Creates a condition with the given variable and condition as read from the .rsf file.
-     * @param variable The name of the variable
-     * @param condition The condition as read from the .rsf file
+     * Converts the given variable from a string to a {@link ConstraintSyntaxTree}.
+     * A ! at the beginning will result in a {@link OCLFeatureCall} with NOT.
+     * @param reader The reader to read variable declarations from.
+     * @param var The string representing a variable.
+     * @return The variable as {@link ConstraintSyntaxTree}.
      */
-    RSFCondition(String variable, String condition) {
-        this.variable = variable;
-        this.condition = condition;
+    private ConstraintSyntaxTree getVariable(AbstractReader reader, String var) {
+        ConstraintSyntaxTree result = null;
+        if (var.startsWith("!")) {
+            Variable variable = new Variable(reader.getVariable(var.substring(1)));
+            result = new OCLFeatureCall(variable, OclKeyWords.NOT);
+        } else {
+            result = new Variable(reader.getVariable(var));
+        }
+        return result;
     }
     
     /**
-     * Returns this condition as a {@link ConstraintSyntaxTree}.
-     * It will look like: (variable AND condition) OR (NOT variable AND NOT condition).
-     * @return A {@link ConstraintSyntaxTree} representing this condition.
+     * Converts the condition into a {@link ConstraintSyntaxTree}.
+     * @param reader The reader to get the variables from.
+     * @param condition A string representing the condition as read from a .rsf file.
+     * @return A {@link ConstraintSyntaxTree} representing the condition.
+     * @throws ParserException If the conditions contains an operation, that is not supported by the parser.
+     * 
+     * TODO handle constants.
      */
-    ConstraintSyntaxTree toConstraintSyntaxTree() {
-        return null;
+    protected ConstraintSyntaxTree getConstraintSyntaxTree(AbstractReader reader, String condition)
+        throws ParserException {
+        
+        condition = condition.replace(" ", "");
+        
+        // We assume that ! can only be in front of variables
+        
+        String highestOperand = null;
+        int highestOperandLevel = Integer.MAX_VALUE;
+        int highestOperandPos = -1;
+        int currentLevel = 0;
+        
+        for (int i = 0; i < condition.length(); i++) {
+            char c = condition.charAt(i);
+            switch (c) {
+            case '(':
+                currentLevel++;
+                break;
+            case ')':
+                currentLevel--;
+                break;
+                
+            case '&':
+                if (condition.charAt(i + 1) != '&') {
+                    throw new ParserException(ParserExceptionType.NOT_SUPPORTED_FIELD); // TODO
+                }
+                if (highestOperandLevel > currentLevel) {
+                    highestOperand = OclKeyWords.AND;
+                    highestOperandPos = i;
+                    highestOperandLevel = currentLevel;
+                }
+                i++;
+                break;
+            
+            case '|':
+                if (condition.charAt(i + 1) != '|') {
+                    throw new ParserException(ParserExceptionType.NOT_SUPPORTED_FIELD); // TODO
+                }
+                if (highestOperandLevel > currentLevel) {
+                    highestOperand = OclKeyWords.OR;
+                    highestOperandPos = i;
+                    highestOperandLevel = currentLevel;
+                }
+                i++;
+                break;
+            
+            default:
+                break;
+            }
+        }
+        
+        ConstraintSyntaxTree result = null;
+        
+        if (highestOperandPos == -1) {
+            // we only have a variable
+            result = getVariable(reader, condition);
+        } else {
+            StringBuffer left = new StringBuffer();
+            StringBuffer right = new StringBuffer();
+            split(condition, highestOperandPos, highestOperandLevel, left, right);
+            result = new OCLFeatureCall(getConstraintSyntaxTree(reader, left.toString()), highestOperand,
+                    getConstraintSyntaxTree(reader, right.toString()));
+        }
+        
+        return result;
+    }
+    
+    /**
+     * Splits the given line at the given operand position into a left and right part.
+     * @param line The whole line
+     * @param operandPos The position of the operand in the line
+     * @param operandLevel The logic level of the operand (by counting brackets)
+     * @param left A {@link StringBuffer} where the left side of the operand will be written to
+     * @param right A {@link StringBuffer} where the right side of the operand will be written to
+     */
+    private void split(String line, int operandPos, int operandLevel, StringBuffer left, StringBuffer right) {
+        left.append(line.substring(0, operandPos));
+        right.append(line.substring(operandPos + 2, line.length()));
+        int currentLevel = 0;
+        for (int i = 0; i < left.length(); i++) {
+            char c = left.charAt(i);
+            if ((c == '(' || c == ')') && currentLevel < operandLevel) {
+                left.replace(i, i + 1, "");
+            }
+            if (c == '(') {
+                currentLevel++;
+            }
+            if (c == ')') {
+                currentLevel--;
+            }
+        }
+        currentLevel = 0;
+        for (int i = right.length() - 1; i >= 0; i--) {
+            char c = right.charAt(i);
+            if ((c == '(' || c == ')') && currentLevel < operandLevel) {
+                right.replace(i, i + 1, "");
+            }
+            if (c == ')') {
+                currentLevel++;
+            }
+            if (c == '(') {
+                currentLevel--;
+            }
+        }
     }
     
Index: /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFDependsCondition.java
===================================================================
--- /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFDependsCondition.java	(revision 82)
+++ /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFDependsCondition.java	(revision 82)
@@ -0,0 +1,61 @@
+package de.uni_hildesheim.sse.trans.in.rsf;
+
+import de.uni_hildesheim.sse.model.cst.ConstraintSyntaxTree;
+import de.uni_hildesheim.sse.model.cst.OCLFeatureCall;
+import de.uni_hildesheim.sse.model.cst.Variable;
+import de.uni_hildesheim.sse.model.varModel.DecisionVariableDeclaration;
+import de.uni_hildesheim.sse.model.varModel.datatypes.OclKeyWords;
+import de.uni_hildesheim.sse.trans.in.AbstractReader;
+import de.uni_hildesheim.sse.trans.in.ParserException;
+
+/**
+ * Represents a condition read from a "Depends" line in a .rsf file.
+ * The format looks like this: <br />
+ * <code>
+ * Depends <i>variable</i> <i>condition</i>
+ * </code> <br />
+ * <i>variable</i> can only be true, if <i>condition</i> is true. <br />
+ * {@link RSFCondition#getConstraintSyntaxTreeHack(AbstractReader, String)} will convert it into: <br />
+ * <code>
+ * (<i>variable</i> AND <i>condition</i>) OR (NOT <i>variable</i> AND NOT <i>condition</i>)
+ * </code>
+ * 
+ * @author Adam Krafczyk
+ */
+class RSFDependsCondition extends RSFCondition {
+
+    private String variable;
+    private String condition;
+    
+    /**
+     * Creates a condition with the given variable and condition as read from a "Depends" line in a .rsf file.
+     * @param variable The name of the variable
+     * @param condition The condition as read from the .rsf file
+     */
+    RSFDependsCondition(String variable, String condition) {
+        this.variable = variable;
+        this.condition = condition;
+        // TODO error handling if only on is true?
+        if (this.condition.startsWith("\"") && this.condition.endsWith("\"")) {
+            this.condition = this.condition.substring(1, this.condition.length() - 1);
+        }
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    ConstraintSyntaxTree toConstraintSyntaxTree(AbstractReader reader) throws ParserException {
+        DecisionVariableDeclaration varDecl = reader.getVariable(variable);
+        Variable var = new Variable(varDecl);
+        OCLFeatureCall notVar = new OCLFeatureCall(var, OclKeyWords.NOT);
+        
+        ConstraintSyntaxTree condition = getConstraintSyntaxTree(reader, this.condition);
+        OCLFeatureCall notCondition = new OCLFeatureCall(condition, OclKeyWords.NOT);
+        
+        OCLFeatureCall leftANDCall = new OCLFeatureCall(var, OclKeyWords.AND, condition);
+        OCLFeatureCall rightANDCall = new OCLFeatureCall(notVar , OclKeyWords.AND, notCondition);
+        
+        return new OCLFeatureCall(leftANDCall, OclKeyWords.OR, rightANDCall);
+    }
+    
+}
Index: /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFItemSelectsCondition.java
===================================================================
--- /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFItemSelectsCondition.java	(revision 82)
+++ /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFItemSelectsCondition.java	(revision 82)
@@ -0,0 +1,72 @@
+package de.uni_hildesheim.sse.trans.in.rsf;
+
+import de.uni_hildesheim.sse.model.cst.ConstraintSyntaxTree;
+import de.uni_hildesheim.sse.model.cst.OCLFeatureCall;
+import de.uni_hildesheim.sse.model.cst.Variable;
+import de.uni_hildesheim.sse.model.varModel.DecisionVariableDeclaration;
+import de.uni_hildesheim.sse.model.varModel.datatypes.OclKeyWords;
+import de.uni_hildesheim.sse.trans.in.AbstractReader;
+import de.uni_hildesheim.sse.trans.in.ParserException;
+
+/**
+ * Represents a condition read from a "ItemSelects" line in a .rsf file. <br />
+ * The format looks like this: <br />
+ * <code>
+ * ItemSelects <i>variable</i> <i>selectedVaraible</i> <i>condition</i>
+ * </code> <br />
+ * <i>selectedVaraible</i> has to be set to true, if <i>variable</i> and <i>condition</i> are true. <br />
+ * {@link RSFItemSelectsCondition#getConstraintSyntaxTreeHack(AbstractReader, String)} will convert it to: <br />
+ * <code>
+ * (NOT <i>variable</i> OR NOT <i>condition</i>) OR (<i>variable</i> AND <i>selectedVaraible</i> AND <i>condition</i>)
+ * </code>
+ * @author Adam Krafczyk
+ */
+class RSFItemSelectsCondition extends RSFCondition {
+
+    private String variable;
+    private String selectedVariable;
+    private String condition;
+    
+    /**
+     * Creates a condition with the given variable and condition as read from a "ItemSelects" line in a .rsf file.
+     * @param variable The name of the variable
+     * @param selectedVaraible The name of the variable that is selected
+     * @param condition The condition as read from the .rsf file
+     */
+    RSFItemSelectsCondition(String variable, String selectedVaraible, String condition) {
+        this.variable = variable;
+        this.selectedVariable = selectedVaraible;
+        // TODO error handling if only on is true?
+        if (this.selectedVariable.startsWith("\"") && this.selectedVariable.endsWith("\"")) {
+            this.selectedVariable = this.selectedVariable.substring(1, this.selectedVariable.length() - 1);
+        }
+        this.condition = condition;
+        // TODO error handling if only on is true?
+        if (this.condition.startsWith("\"") && this.condition.endsWith("\"")) {
+            this.condition = this.condition.substring(1, this.condition.length() - 1);
+        }
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    ConstraintSyntaxTree toConstraintSyntaxTree(AbstractReader reader) throws ParserException {
+        DecisionVariableDeclaration varDecl = reader.getVariable(variable);
+        Variable var = new Variable(varDecl);
+        OCLFeatureCall notVar = new OCLFeatureCall(var, OclKeyWords.NOT);
+        
+        // TODO can selectedVariable be a condition?
+        DecisionVariableDeclaration selectedVarDecl = reader.getVariable(selectedVariable);
+        Variable selectedVar = new Variable(selectedVarDecl);
+        
+        ConstraintSyntaxTree condition = getConstraintSyntaxTree(reader, this.condition);
+        OCLFeatureCall notCondition = new OCLFeatureCall(condition, OclKeyWords.NOT);
+        
+        OCLFeatureCall leftOR = new OCLFeatureCall(notVar, OclKeyWords.OR, notCondition);
+        OCLFeatureCall rightAND1 = new OCLFeatureCall(var, OclKeyWords.AND, selectedVar);
+        OCLFeatureCall rightAND2 = new OCLFeatureCall(rightAND1, OclKeyWords.AND, condition);
+        
+        return new OCLFeatureCall(leftOR, OclKeyWords.OR, rightAND2);
+    }
+    
+}
Index: /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFReader.java
===================================================================
--- /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFReader.java	(revision 81)
+++ /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/rsf/RSFReader.java	(revision 82)
@@ -104,5 +104,5 @@
             try {
                 Constraint constraint = new Constraint(model);
-                constraint.setConsSyntax(condition.toConstraintSyntaxTree());
+                constraint.setConsSyntax(condition.toConstraintSyntaxTree(this));
                 model.add(constraint);
             } catch (CSTSemanticException e) {
@@ -140,5 +140,5 @@
                 case "Default":
                     // Default value in [2], condition in [3]
-                    // TODO: read condition?
+                    // TODO: read condition? I guess not...
                     break;
                 case "HasPrompts":
@@ -147,9 +147,9 @@
                 case "ItemSelects":
                     // other variable in [2], condition in [3]
-                    // TODO: read condition?
+                    conditions.add(new RSFItemSelectsCondition(itemName, columns[2], columns[3]));
                     break;
                 case "Depends":
                     // condition in [2]
-                    conditions.add(new RSFCondition(itemName, columns[3]));
+                    conditions.add(new RSFDependsCondition(itemName, columns[2]));
                     break;
                 case "Choice":
@@ -169,3 +169,4 @@
         }
     }
+    
 }
Index: /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/in/rsf/RSFReaderTest.java
===================================================================
--- /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/in/rsf/RSFReaderTest.java	(revision 81)
+++ /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/in/rsf/RSFReaderTest.java	(revision 82)
@@ -7,4 +7,6 @@
 import org.junit.Test;
 
+import de.uni_hildesheim.sse.model.cst.DebugConstraintTreeVisitor;
+import de.uni_hildesheim.sse.model.varModel.Constraint;
 import de.uni_hildesheim.sse.model.varModel.Project;
 import de.uni_hildesheim.sse.model.varModel.filter.ConstraintFinder;
@@ -35,8 +37,12 @@
         
         ConstraintFinder cFinder = new ConstraintFinder(project);
-        Assert.assertEquals(0, cFinder.getConstraints().size()); // TODO
+        Assert.assertEquals(4, cFinder.getConstraints().size());
+        
+//        for (Constraint c : cFinder.getConstraints()) {
+//            c.getConsSyntax().accept(new DebugConstraintTreeVisitor());
+//        }
         
         DeclarationFinder varFinder = new DeclarationFinder(project, FilterType.ALL, null);
-        Assert.assertEquals(3, varFinder.getVariableDeclarations(VisibilityType.ALL).size());
+        Assert.assertEquals(4, varFinder.getVariableDeclarations(VisibilityType.ALL).size());
     }
     
