Class FieldAccessExpression


  • public class FieldAccessExpression
    extends Expression
    Represents a field access.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • FieldAccessExpression

        public FieldAccessExpression()
        Constructor for serialization.
      • FieldAccessExpression

        public FieldAccessExpression​(FieldDescriptor field)
                              throws VilException
        Creates a static field access expression.
        Parameters:
        field - the field to access
        Throws:
        VilException - in case that a static access cannot be done
      • FieldAccessExpression

        public FieldAccessExpression​(VariableDeclaration variable,
                                     FieldDescriptor field)
                              throws VilException
        Creates a field access expression.
        Parameters:
        variable - the variable
        field - the field to access
        Throws:
        VilException - in case that a static access cannot be done
      • FieldAccessExpression

        public FieldAccessExpression​(FieldAccessExpression nested,
                                     FieldDescriptor field)
        Creates a nested field access expression.
        Parameters:
        nested - the nested expression (innermost created by the other constructor)
        field - the field to access
    • Method Detail

      • getField

        public FieldDescriptor getField()
        Returns the field.
        Returns:
        the field
      • inferType

        public TypeDescriptor<?> inferType()
                                    throws VilException
        Description copied from class: Expression
        Infers the type of this expression including the type of the contained sub-expressions.
        Specified by:
        inferType in class Expression
        Returns:
        the type of this expression
        Throws:
        VilException - in case that inferring the type fails
      • accept

        public java.lang.Object accept​(IExpressionVisitor visitor)
                                throws VilException
        Description copied from class: Expression
        Visits the expression.
        Specified by:
        accept in class Expression
        Parameters:
        visitor - the visitor
        Returns:
        the result of visiting this expression (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • isMetaAccess

        public boolean isMetaAccess()
        Returns whether the field itself or the value of the field expression shall be considered during execution.
        Returns:
        true if the field itself shall be considered, false if the evaluation of the field expression shall be considered
      • enableMetaAccess

        public void enableMetaAccess()
        Switches from evaluating the field expression (default) to evaluating the field itself.