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(char accessSeparator, String fieldName) {
13 super(accessSeparator);
14 this.fieldName = fieldName;
18 public Expression asExpression() {
19 return new ELiteral(new StringConstant(fieldName));
23 public boolean isVariableId() {
24 return fieldName.equals("variable");
28 public void setLocationDeep(long loc) {
29 if(location == Locations.NO_LOCATION)
34 public void accept(FieldAccessorVisitor visitor) {
39 public void forVariables(VariableProcedure procedure) {