/** * Creates a new tree field only constructor {@code AFieldExp TAG=field} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param object_ the {@link PExp} node for the {@code object} child of this {@link AFieldExp} node * @param memberName_ the {@link ILexNameToken} node for the {@code memberName} child of this {@link AFieldExp} node * @param field_ the {@link ILexIdentifierToken} node for the {@code field} child of this {@link AFieldExp} node */ public AFieldExp(ILexLocation location_, PExp object_, ILexNameToken memberName_, ILexIdentifierToken field_) { super(null,location_); this.setObject(object_); this.setMemberName(memberName_); this.setField(field_); }
/** * Creates a new complete constructor {@code AFieldExp} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param object_ the {@link PExp} node for the {@code object} child of this {@link AFieldExp} node * @param memberName_ the {@link ILexNameToken} node for the {@code memberName} child of this {@link AFieldExp} node * @param field_ the {@link ILexIdentifierToken} node for the {@code field} child of this {@link AFieldExp} node */ public AFieldExp(PType type_, ILexLocation location_, PExp object_, ILexNameToken memberName_, ILexIdentifierToken field_) { super(type_,location_); this.setObject(object_); this.setMemberName(memberName_); this.setField(field_); }
public static PExp newAFieldExp(PExp object, ILexIdentifierToken field) { AFieldExp result = new AFieldExp(); result.setLocation(object.getLocation()); result.setObject(object); result.setField(field); result.getField().getLocation().executable(true); return result; }
public static AFieldExp newAFieldExp(PExp object, ILexNameToken field) { AFieldExp result = new AFieldExp(); result.setLocation(object.getLocation()); result.setObject(object); result.setField(new LexIdentifierToken(field.getName(), field.getOld(), field.getLocation())); result.setMemberName(field); result.getField().getLocation().executable(true); return result; }
@Override public PExp caseAFieldStateDesignator(AFieldStateDesignator node) throws AnalysisException { // pack this with the output of the visitor recursive calls. PExp value = node.getObject().apply(this); AFieldExp fieldExp = new AFieldExp(); fieldExp.setObject(value.clone()); fieldExp.setField(node.getField().clone()); // Not 100% sure these 2 match fieldExp.setMemberName(node.getObjectfield().clone()); fieldExp.setType(node.getType().clone()); return fieldExp; }