Class Identifier

    • Constructor Detail

      • Identifier

        protected Identifier​(Type staticType,
                             java.lang.String name,
                             boolean weak,
                             CodeLocation location)
        Builds the identifier.
        Parameters:
        staticType - the static type of this expression
        name - the name of the identifier
        weak - whether or not this identifier is weak, meaning that it should only receive weak assignments
        location - the code location of the statement that has generated this identifier
      • Identifier

        protected Identifier​(Type staticType,
                             java.lang.String name,
                             boolean weak,
                             Annotations annotations,
                             CodeLocation location)
        Builds the identifier.
        Parameters:
        staticType - the static type of this expression
        name - the name of the identifier
        weak - whether or not this identifier is weak, meaning that it should only receive weak assignments
        annotations - the annotations of this identifier
        location - the code location of the statement that has generated this identifier
    • Method Detail

      • getName

        public java.lang.String getName()
        Yields the name of this identifier.
        Returns:
        the name
      • isWeak

        public boolean isWeak()
        Yields whether or not this identifier is weak. Weak identifiers should only receive weak assignments, that is, the value of the identifier after the assignment should be the least upper bound between its old value and the fresh value being assigned. With strong identifiers instead, the new value corresponds to the freshly provided value.
        Returns:
        true if this identifier is weak, false otherwise
      • getAnnotations

        public Annotations getAnnotations()
        Yields the annotations of this identifier.
        Returns:
        the annotations of this identifier
      • addAnnotation

        public void addAnnotation​(Annotation ann)
        Adds an annotation to the annotations of this identifier.
        Parameters:
        ann - the annotation to be added
      • lub

        public Identifier lub​(Identifier other)
                       throws SemanticException
        Yields the least upper bounds between two identifiers.
        Parameters:
        other - the other identifier
        Returns:
        the least upper bounds between two identifiers.
        Throws:
        SemanticException - if this and other are not equal.