340 std::list<file_entry>::iterator file_iterator=
file_list.begin();
345 string filename=entry.first;
352 if(file_language.size()==0)
361 unsigned int period_pos=file_language.find(
".");
362 string base_language=file_language.substr(0,period_pos);
364 f=fopen(filename.c_str(),
"r");
367 cerr <<
"Couldn't open " << filename << endl;
372 cerr <<
"Processing " << filename;
381 (base_language==
"c++") ||
385 cerr <<
" as C/C++ (" << file_language <<
")"
388 CLexer theLexer(&in);
389 ANTLRTokenBuffer thePipe(&theLexer);
391 CParser theParser(&thePipe);
394 theParser.init(filename,file_language);
407 theParser.traceGuessOption(-1);
412 #endif // CC_INCLUDED
414 else if(base_language==
"java")
416 cerr <<
" as Java" << endl;
418 JLexer theLexer(&in);
419 ANTLRTokenBuffer thePipe(&theLexer);
421 JParser theParser(&thePipe);
422 theParser.init(filename,file_language);
423 theParser.traceGuessOption(-1);
424 theParser.compilationUnit();
427 #endif // JAVA_INCLUDED
429 else if(base_language==
"ada")
431 cerr <<
" as Ada" << endl;
433 ALexer theLexer(&in);
434 ANTLRTokenBuffer thePipe(&theLexer);
436 AdaPrser theParser(&thePipe);
437 theParser.init(filename,file_language);
438 theParser.traceGuessOption(-1);
439 theParser.goal_symbol();
442 #endif // ADA_INCLUDED
443 else if(base_language==
"")
445 cerr <<
" - no parseable language identified";
449 cerr <<
"Unexpected language " << base_language.c_str()
450 <<
" (" << file_language.c_str()
451 <<
") for file " << filename.c_str() << endl;
ANTLRToken currentLexerToken
static string getFileLanguage(const string &filename)
std::pair< string, string > file_entry
std::list< file_entry > file_list