1 package org.simantics.scl.compiler.elaboration.expressions.accessor;
3 import org.simantics.scl.compiler.constants.StringConstant;
4 import org.simantics.scl.compiler.elaboration.expressions.ELiteral;
5 import org.simantics.scl.compiler.elaboration.expressions.Expression;
6 import org.simantics.scl.compiler.elaboration.expressions.VariableProcedure;
7 import org.simantics.scl.compiler.errors.Locations;
9 public class IdAccessor extends FieldAccessor {
10 public final String fieldName;
12 public IdAccessor(String fieldName) {
13 this.fieldName = fieldName;
17 public Expression asExpression() {
18 return new ELiteral(new StringConstant(fieldName));
22 public boolean isVariableId() {
23 return fieldName.equals("variable");
27 public void setLocationDeep(long loc) {
28 if(location == Locations.NO_LOCATION)
33 public void accept(FieldAccessorVisitor visitor) {
38 public void forVariables(VariableProcedure procedure) {