Skip to content

Commit

Permalink
Added empty file check and new output header to report input symbol s…
Browse files Browse the repository at this point in the history
…tream statistics if desired. Resolves issue #2
  • Loading branch information
jackwadden committed Apr 4, 2017
1 parent 21178f4 commit de1de91
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions src/main.cpp
Expand Up @@ -368,14 +368,41 @@ int main(int argc, char * argv[]) {
simulate = false;
}

// Parse automata input file or input from command line
input = parseInputStream(simulate, input_string, &size, argv, optind);
// Parse Input
if(!quiet){

cout << "|------------------------|" << endl;
cout << "| Parsing Input |" << endl;
cout << "|------------------------|" << endl;

if(!input_string && simulate){
cout << "Reading input stream from file: " << argv[optind] << endl;
}

}


if(simulate){
// Parse automata input file or input from command line
input = parseInputStream(simulate, input_string, &size, argv, optind);

if(size < 1){
cout << "WARNING: Input file is empty! Refusing to simulate..." << endl;
simulate = false;
}else{
cout << " Found " << size << " input symbols." << endl;
}
}

if(!quiet){
cout << endl;
}

// Build automata
if(!quiet){

cout << "|------------------------|" << endl;
cout << "| Parsing |" << endl;
cout << "| Parsing ANML |" << endl;
cout << "|------------------------|" << endl;

cout << "Building automata from file: " << fn << endl;
Expand Down

0 comments on commit de1de91

Please sign in to comment.