-package org.simantics.scl.compiler.elaboration.expressions;\r
-\r
-import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;\r
-import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator;\r
-import org.simantics.scl.compiler.types.Type;\r
-\r
-public class Assignment {\r
- public Expression pattern;\r
- public Expression value;\r
- \r
- public Assignment(Expression pattern, Expression value) {\r
- if(Type.NULL_CHECKS) {\r
- if(pattern == null)\r
- throw new NullPointerException();\r
- if(value == null)\r
- throw new NullPointerException();\r
- }\r
- this.pattern = pattern;\r
- this.value = value;\r
- }\r
-\r
- public Assignment replace(ReplaceContext context) {\r
- Expression newPattern = pattern.replaceInPattern(context);\r
- Expression newValue = value.replace(context);\r
- return new Assignment(newPattern, newValue);\r
- }\r
-\r
- public void decorate(ExpressionDecorator decorator) {\r
- pattern = pattern.decorate(decorator);\r
- value = value.decorate(decorator);\r
- }\r
-\r
- public void setLocationDeep(long loc) {\r
- pattern.setLocationDeep(loc);\r
- value.setLocationDeep(loc);\r
- }\r
-\r
- public void forVariables(VariableProcedure procedure) {\r
- value.forVariables(procedure);\r
- }\r
-}\r
+package org.simantics.scl.compiler.elaboration.expressions;
+
+import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;
+import org.simantics.scl.compiler.types.Type;
+
+public class Assignment {
+ public Expression pattern;
+ public Expression value;
+
+ public Assignment(Expression pattern, Expression value) {
+ if(Type.NULL_CHECKS) {
+ if(pattern == null)
+ throw new NullPointerException();
+ if(value == null)
+ throw new NullPointerException();
+ }
+ this.pattern = pattern;
+ this.value = value;
+ }
+
+ public Assignment replace(ReplaceContext context) {
+ Expression newPattern = pattern.replaceInPattern(context);
+ Expression newValue = value.replace(context);
+ return new Assignment(newPattern, newValue);
+ }
+
+ public void setLocationDeep(long loc) {
+ pattern.setLocationDeep(loc);
+ value.setLocationDeep(loc);
+ }
+}