1 package org.simantics.scl.compiler.elaboration.expressions;
3 import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;
4 import org.simantics.scl.compiler.types.Type;
6 public class Assignment {
7 public Expression pattern;
8 public Expression value;
10 public Assignment(Expression pattern, Expression value) {
11 if(Type.NULL_CHECKS) {
13 throw new NullPointerException();
15 throw new NullPointerException();
17 this.pattern = pattern;
21 public Assignment replace(ReplaceContext context) {
22 Expression newPattern = pattern.replaceInPattern(context);
23 Expression newValue = value.replace(context);
24 return new Assignment(newPattern, newValue);
27 public void setLocationDeep(long loc) {
28 pattern.setLocationDeep(loc);
29 value.setLocationDeep(loc);
32 public void forVariables(VariableProcedure procedure) {
33 value.forVariables(procedure);