def parse_declaration_type(self, typeAST):
        """
        Required.

        Currently supported:
        Types are: Boolean, Float, Int, File, String, and Array[subtype].
        OptionalTypes are: Boolean?, Float?, Int?, File?, String?, and Array[subtype]?.

        Python is not typed, so we don't need typing except to identify type: "File",
        which Toil needs to import, so we recursively travel down to the innermost
        type which will tell us if the variables are files that need importing.

        :param typeAST:
        :return:
        """
        if isinstance(typeAST, wdl_parser.Terminal):
            return typeAST.source_string
        elif isinstance(typeAST, wdl_parser.Ast):
            if typeAST.name == 'Type':
                return self.parse_declaration_type(typeAST.attr('subtype'))
            elif typeAST.name == 'OptionalType':
                return self.parse_declaration_type(typeAST.attr('innerType'))
            else:
                raise NotImplementedError
        elif isinstance(typeAST, wdl_parser.AstList):
            for ast in typeAST:
                # TODO only ever seen one element lists.
                return self.parse_declaration_type(ast)
def parse_declaration_type ( self , typeAST ) : if isinstance ( typeAST , wdl_parser . Terminal ) : return typeAST . source_string elif isinstance ( typeAST , wdl_parser . Ast ) : if typeAST . name == 'Type' : return self . parse_declaration_type ( typeAST . attr ( 'subtype' ) ) elif typeAST . name == 'OptionalType' : return self . parse_declaration_type ( typeAST . attr ( 'innerType' ) ) else : raise NotImplementedError elif isinstance ( typeAST , wdl_parser . AstList ) : for ast in typeAST : return self . parse_declaration_type ( ast )
Required.

        Currently supported:
        Types are: Boolean, Float, Int, File, String, and Array[subtype].
        OptionalTypes are: Boolean?, Float?, Int?, File?, String?, and Array[subtype]?.

        Python is not typed, so we don't need typing except to identify type: "File",
        which Toil needs to import, so we recursively travel down to the innermost
        type which will tell us if the variables are files that need importing.

        :param typeAST:
        :return: