#NEWLINE# def _get_sources_package( self , target ) : #NEWLINE# #INDENT# parents = set ( [ os . path . dirname ( source ) for source in target . sources_relative_to_source_root ( ) ] ) #NEWLINE# if ( len ( parents ) != 1 ) : #NEWLINE# #INDENT# raise self . AmbiguousPackageError ( 'Antlr sources in multiple directories, cannot infer package. Please set package member in antlr target.' ) #NEWLINE# #UNINDENT# return parents . pop ( ) . replace ( '/' , '.' )