1 package org.simantics.scl.compiler.elaboration.expressions.visitors;
3 import org.simantics.scl.compiler.elaboration.expressions.EAsPattern;
4 import org.simantics.scl.compiler.elaboration.expressions.EVariable;
5 import org.simantics.scl.compiler.elaboration.expressions.StandardExpressionVisitor;
6 import org.simantics.scl.compiler.elaboration.expressions.VariableProcedure;
8 public class ForVariablesUsesVisitor extends StandardExpressionVisitor {
9 VariableProcedure procedure;
11 public ForVariablesUsesVisitor(VariableProcedure procedure) {
12 this.procedure = procedure;
16 public void visit(EVariable expression) {
17 if(expression.variable != null)
18 procedure.execute(expression.location, expression.variable);
21 public void visit(EAsPattern expression) {
22 expression.pattern.accept(this);
23 procedure.execute(expression.eVar.location, expression.var);