-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <bits/stdc++.h> | ||
#include "../automata/dfa/DeterministicFiniteAutomata.h" | ||
#include "../automata/ndfa/NotDeterministicFiniteAutomata.h" | ||
#include "../parser/Parser.h" | ||
using namespace std; | ||
|
||
const string filename = "TP/testing/input.txt"; | ||
|
||
int main() { | ||
ifstream file(filename); // Abrir el archivo | ||
Parser parser = *new Parser(); | ||
|
||
if (!file.is_open()) { // Verificar si el archivo se abrió correctamente | ||
cerr << "No se pudo abrir el archivo." << endl; | ||
return -1; | ||
} | ||
|
||
string line; | ||
|
||
if (!getline(file, line)) { // Leer la primera línea | ||
cerr << "No se pudo leer la primera línea." << endl; | ||
return -1; | ||
} | ||
if(!Parser::validateFirstLine(line)){ | ||
cerr << "Formato invalido del archivo." << endl; | ||
return -1; | ||
} | ||
|
||
while (getline(file, line)) { | ||
parser.fileManagement(line); | ||
} | ||
|
||
file.close(); | ||
|
||
//NotDeterministicFiniteAutomata nda = parser.getNDA(); | ||
//nda.show(); //TODO: IMPLEMENTAR | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
digraph{ | ||
inic[shape=point]; | ||
inic -> 0; | ||
10 -> 11 [label = "1"]; | ||
11 -> 11 [label = "2"]; | ||
11 -> 12 [label = "2"]; | ||
11 -> 13 [label = "1"]; | ||
13 -> 13 [label = "-1"]; | ||
12[shape=doublecircle]; | ||
} |