1 package org.simantics.scl.compiler.elaboration.expressions;
3 import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;
4 import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator;
5 import org.simantics.scl.compiler.types.Type;
7 public class Assignment {
8 public Expression pattern;
9 public Expression value;
11 public Assignment(Expression pattern, Expression value) {
12 if(Type.NULL_CHECKS) {
14 throw new NullPointerException();
16 throw new NullPointerException();
18 this.pattern = pattern;
22 public Assignment replace(ReplaceContext context) {
23 Expression newPattern = pattern.replaceInPattern(context);
24 Expression newValue = value.replace(context);
25 return new Assignment(newPattern, newValue);
28 public void decorate(ExpressionDecorator decorator) {
29 pattern = pattern.decorate(decorator);
30 value = value.decorate(decorator);
33 public void setLocationDeep(long loc) {
34 pattern.setLocationDeep(loc);
35 value.setLocationDeep(loc);
38 public void forVariables(VariableProcedure procedure) {
39 value.forVariables(procedure);