Class ConstraintSyntaxTree

    • Constructor Detail

      • ConstraintSyntaxTree

        public ConstraintSyntaxTree()
    • Method Detail

      • accept

        public abstract void accept​(IConstraintTreeVisitor visitor)
        Visiting method for the visitor.
        This method is used for saving this model element.
        Parameters:
        visitor - The visitor, which should save this model element.
      • inferDatatype

        public abstract IDatatype inferDatatype()
                                         throws CSTSemanticException
        Infers the datatype of the subtree represented by this object.
        Returns:
        the data type
        Throws:
        CSTSemanticException - Will be thrown if parameters of (sub-) trees do not fit together.
      • getContainedType

        public IDatatype getContainedType()
        Returns the data type explicitly contained in this syntax tree. This is typically a constant value which contains a meta value, i.e. a type expression.
        Returns:
        the contained type or null if there is none
      • getAttributesCount

        public int getAttributesCount()
        Returns the number of attributes.
        Specified by:
        getAttributesCount in interface IAttributeAccess
        Returns:
        the number of attributes
      • getAttribute

        public Attribute getAttribute​(int index)
        Returns a specific attribute.
        Specified by:
        getAttribute in interface IAttributeAccess
        Parameters:
        index - the index of the attribute
        Returns:
        the attribute
        Throws:
        java.lang.IndexOutOfBoundsException - if index<0 || index>=getAttributesCount()
      • getAttribute

        public Attribute getAttribute​(java.lang.String name)
        Returns a specific attribute.
        Specified by:
        getAttribute in interface IAttributeAccess
        Parameters:
        name - the name of the attribute
        Returns:
        the attribute (or null if not found)
      • isSemanticallyEqual

        public boolean isSemanticallyEqual​(ConstraintSyntaxTree otherTree)
        Checks whether this ConstraintSyntaxTree is semantically equal to another ConstraintSyntaxTree. Attention:This method is not fully supported by all operations and sub classes.
        Parameters:
        otherTree - Another cst to check whether it is semantically equal to this cst.
        Returns:
        true if both trees are semantically equal, false otherwise.
      • getName

        public java.lang.String getName()
        Returns the name of the constraint syntax tree (in case if it is used as a named argument).
        Returns:
        the name, may be null for none