@ -26,41 +26,36 @@ namespace Cxxi
{
{
library = new Library ( options . OutputNamespace , options . LibraryName ) ;
library = new Library ( options . OutputNamespace , options . LibraryName ) ;
var parserOptions = new ParserOptions
{
Library = library ,
Verbose = false ,
IncludeDirs = options . IncludeDirs
} ;
Console . WriteLine ( "Parsing code..." ) ;
Console . WriteLine ( "Parsing code..." ) ;
foreach ( var file in options . Headers )
var headers = new List < string > ( ) ;
{
transform . SetupHeaders ( headers ) ;
string path ;
try
foreach ( var header in headers )
{
ParseHeader ( header ) ;
path = Path . GetFullPath ( file ) ;
}
foreach ( var header in options . Headers )
catch ( ArgumentException )
ParseHeader ( header ) ;
{
Console . WriteLine ( "Invalid path '" + file + "'." ) ;
continue ;
}
}
var module = new TranslationUnit ( path ) ;
void ParseHeader ( string file )
parserOptions . FileName = path ;
{
var parserOptions = new ParserOptions
{
Library = library ,
Verbose = false ,
IncludeDirs = options . IncludeDirs ,
FileName = file
} ;
if ( ! ClangParser . Parse ( parserOptions ) )
if ( ! ClangParser . Parse ( parserOptions ) )
{
{
Console . WriteLine ( " Could not parse '" + file + "'." ) ;
Console . WriteLine ( " Could not parse '" + file + "'." ) ;
continue ;
return ;
}
}
Console . WriteLine ( " Parsed '" + file + "'." ) ;
Console . WriteLine ( " Parsed '" + file + "'." ) ;
}
}
}
public void ProcessCode ( )
public void ProcessCode ( )
{
{