Class Expression

    • Constructor Detail

      • Expression

        protected Expression​(CFG cfg,
                             CodeLocation location)
        Builds an untyped expression happening at the given source location, that is its type is Untyped.INSTANCE.
        Parameters:
        cfg - the cfg that this expression belongs to
        location - the location where the expression is defined within the program
      • Expression

        protected Expression​(CFG cfg,
                             CodeLocation location,
                             Type staticType)
        Builds a typed expression happening at the given source location.
        Parameters:
        cfg - the cfg that this expression belongs to
        location - the location where this expression is defined within the program
        staticType - the static type of this expression
    • Method Detail

      • getStaticType

        public final Type getStaticType()
        Yields the static type of this expression.
        Returns:
        the static type of this expression
      • getMetaVariables

        public java.util.Collection<Identifier> getMetaVariables()
        Yields the meta variables that are generated by the evaluation of this expression. These should be removed as soon as the values computed by those gets out of scope (e.g., popped from the stack). The returned collection will be filled while evaluating this expression semantics, thus invoking this method before computing the semantics will yield an empty collection. Variables added here should represent stack values that cannot be re-computed at a later time (e.g., call return values).
        Returns:
        the meta variables
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Statement
      • setParentStatement

        public final void setParentStatement​(Statement st)
        Sets the Statement that contains this expression.
        Parameters:
        st - the containing statement
      • getParentStatement

        public final Statement getParentStatement()
        Yields the Statement that contains this expression, if any. If this method returns null, than this expression is used as a command: it is the root statement of a node in the cfg, and its returned value is discarded.
        Returns:
        the statement that contains this expression, if any
      • getRootStatement

        public final Statement getRootStatement()
        Yields the outer-most Statement containing this expression, that is used as a node in the cfg. If this expression is used a command, then this method return this. If this expression is a Call built as a resolved version of an UnresolvedCall uc, then uc.getRootStatement() is returned.
        Returns:
        the outer-most statement containing this expression, or this
      • getStatementEvaluatedBefore

        public Statement getStatementEvaluatedBefore​(Statement other)
        Description copied from class: Statement
        Yields the Statement that precedes the given one, assuming that other is contained into this statement. If this method returns null, then other is the first expression evaluated when this statement is evaluated.
        Overrides:
        getStatementEvaluatedBefore in class Statement
        Parameters:
        other - the other statement
        Returns:
        the previous statement, or null
      • getStatementEvaluatedAfter

        public Statement getStatementEvaluatedAfter​(Statement other)
        Description copied from class: Statement
        Yields the Statement that follows the given one, assuming that other is contained into this statement. If this method returns null, then other is the last expression evaluated when this statement is evaluated.
        Overrides:
        getStatementEvaluatedAfter in class Statement
        Parameters:
        other - the other statement
        Returns:
        the next statement, or null