1 package org.simantics.scl.compiler.internal.elaboration.matching;
\r
4 import org.simantics.scl.compiler.elaboration.expressions.Expression;
\r
7 Expression[] patterns;
\r
10 public Row(Expression[] patterns, Expression value) {
\r
11 this.patterns = patterns;
\r
15 public Row replace(int columnToReplace, Expression[] substitution) {
\r
16 Expression[] newPatterns = new Expression[patterns.length-1+substitution.length];
\r
18 for(int i=0;i<columnToReplace;++i)
\r
19 newPatterns[j++] = patterns[i];
\r
20 for(int i=0;i<substitution.length;++i)
\r
21 newPatterns[j++] = substitution[i];
\r
22 for(int i=columnToReplace+1;i<patterns.length;++i)
\r
23 newPatterns[j++] = patterns[i];
\r
24 return new Row(newPatterns, value);
\r