#NEWLINE# def parseDefFile( defFile ) : #NEWLINE# #INDENT# '\n  Parses the given DEF file string and returns all found ordinals.\n    \n  @param defFile:                 DEF file text\n    \n  @return: A list of found function and ordinal pairs\n  ' #NEWLINE# functions = [ ] #NEWLINE# ordinals = [ ] #NEWLINE# for ( match , pos , l ) in functionOrdinal . scanString ( defFile ) : #NEWLINE# #INDENT# if ( match . ordinal in ordinals ) : #NEWLINE# #INDENT# raise ValueError ( ( 'The ordinal %d is assigned to multiple functions.' % match . ordinal ) ) #NEWLINE# #UNINDENT# ordinals . append ( match . ordinal ) #NEWLINE# functions . append ( ( match . name , match . ordinal ) ) #NEWLINE# #UNINDENT# return functions