Class TypeSystemUtil


  • public class TypeSystemUtil
    extends Object
    Common methods for all implementation of ITypeSystem
    • Constructor Detail

      • TypeSystemUtil

        public TypeSystemUtil()
    • Method Detail

      • installInitTypeUserMethodParam

        public static void installInitTypeUserMethodParam​(Module module,
                                                          TypeSystemMode mode)
        Computes final state for Method parameters
        Parameters:
        module - processing module, can't be null
        mode - current TypeSystemMode, cannot be null
      • installInitTypeUserMethodParam

        public static void installInitTypeUserMethodParam​(Method method,
                                                          TypeSystemMode mode)
        Computes final state for Method parameters
        Parameters:
        method - processing method, can't be null
        mode - current TypeSystemMode, cannot be null
      • getAllVariableForBlock

        public static Collection<Variable> getAllVariableForBlock​(Block block)
        Gets all variable for Block
        Parameters:
        block - part of BSL model
        Returns:
        list of Variable
      • findAllInnerObjectByClassifier

        public static <T extends org.eclipse.emf.ecore.EObject> List<T> findAllInnerObjectByClassifier​(List<org.eclipse.emf.ecore.EObject> allContent,
                                                                                                       org.eclipse.emf.ecore.EClass eClass,
                                                                                                       Class<T> clazz)
        Find objects by their class an eClass
        Parameters:
        allContent - all processing objects
        eClass - EClass
        clazz - Class
        Returns:
        list of needed EObjects
      • filterInnerObject

        public static <T extends org.eclipse.emf.ecore.EObject> List<T> filterInnerObject​(Collection<Object> allObjects,
                                                                                          Class<T> clazz)
        Filters objects by their type
        Parameters:
        allObjects -
        clazz - type of needed objects
        Returns:
        list of needed objects
      • getCollectionElementTypes

        public static Collection<TypeItem> getCollectionElementTypes​(Iterable<TypeItem> types,
                                                                     org.eclipse.emf.ecore.EObject context)
        Gets all collection element types
        Parameters:
        types - types for getting collection element types, cannot be null
        context - context EObject for resolving types, cannot be null
      • computeCommentTypes

        public static Collection<TypeItem> computeCommentTypes​(org.eclipse.emf.ecore.EObject expressionBeforeComment,
                                                               org.eclipse.xtext.scoping.IScope typeScope,
                                                               org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                                               org.eclipse.xtext.naming.IQualifiedNameConverter qualifiedNameConverter,
                                                               BslMultiLineCommentDocumentationProvider commentProvider,
                                                               boolean oldFormatComment)
        Computes TypeItems described in comment after Built-In language model object in the same line. Code examples:
        •  Procedure example()
               ...
               someVariable = someFunction(); //TypeName - description
               ...
           EndProcedure
           
        •  ...
           Var someModuleVariable;
          
           Var moduleVariableWithTypes; //TypeName - description
           ...
           
        Parameters:
        expressionBeforeComment - Built-In language model object for find comment after it in the same line, cannot be null
        typeScope - actual TypeItems IScope, cannot be null
        scopeProvider - actual IScopeProvider for getting platform and configuration objects for comment content, cannot be null
        qualifiedNameConverter - actual IQualifiedNameConverter, cannot be null
        commentProvider - actual BslMultiLineCommentDocumentationProvider for read comment content, cannot be null
        oldFormatComment - true if comment in old format, false in new format
        Returns:
        collection of TypeItems described in comment, never null
      • computeCommentTypes

        public static Collection<TypeItem> computeCommentTypes​(org.eclipse.emf.ecore.EObject expressionBeforeComment,
                                                               org.eclipse.xtext.nodemodel.INode blockNode,
                                                               org.eclipse.xtext.scoping.IScope typeScope,
                                                               org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                                               org.eclipse.xtext.naming.IQualifiedNameConverter qualifiedNameConverter,
                                                               BslMultiLineCommentDocumentationProvider commentProvider,
                                                               boolean oldFormatComment)
        Computes TypeItems described in comment after Built-In language model object in the same line. Code examples:
        •  Procedure example()
               ...
               someVariable = someFunction(); //TypeName - description
               ...
           EndProcedure
           
        •  ...
           Var someModuleVariable;
          
           Var moduleVariableWithTypes; //TypeName - description
           ...
           
        Parameters:
        expressionBeforeComment - Built-In language model object for find comment after it in the same line, cannot be null
        blockNode - INode of Block which contains expressionBeforeComment, cannot be null
        typeScope - actual TypeItems IScope, cannot be null
        scopeProvider - actual IScopeProvider for getting platform and configuration objects for comment content, cannot be null
        qualifiedNameConverter - actual IQualifiedNameConverter, cannot be null
        commentProvider - actual BslMultiLineCommentDocumentationProvider for read comment content, cannot be null
        oldFormatComment - true if comment in old format, false in new format
        Returns:
        collection of TypeItems described in comment, never null