Skip to content

Commit

Permalink
style!: Rename print_to_DOT() to print_to_dot() for easier typing and…
Browse files Browse the repository at this point in the history
… consistency
  • Loading branch information
Adda0 committed Jul 12, 2024
1 parent 19a706a commit f8e527d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Further, you can add transitions in form of tripple `(state_from, symbol, target
You can verify the state of your automaton by generating the automaton in `.dot` format.

```cpp
aut.print_to_DOT(std::cout);
aut.print_to_dot(std::cout);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ output = new mata_nfa.ofstream(output_file.encode('utf-8'))
# ^-- creates new ofstream
# ^-- you need to encode the Python string to utf-8
try:
self.thisptr.get().print_to_DOT(dereference(output))
self.thisptr.get().print_to_dot(dereference(output))
# ^-- call the function with the ofstream
finally:
# ^-- this assures that the `output` will be cleaned
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/libmata/nfa/nfa.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ cdef extern from "mata/nfa/nfa.hh" namespace "mata::nfa":
StateSet post(StateSet&, Symbol)
State add_state()
State add_state(State)
void print_to_DOT(ostream)
void print_to_dot(ostream)
CNfa& trim(StateRenaming*)
CNfa& concatenate(CNfa&)
CNfa& unite_nondet_with(CNfa&)
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/libmata/nfa/nfa.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ cdef class Nfa:
cdef mata_nfa.ofstream* output
output = new mata_nfa.ofstream(output_file.encode('utf-8'))
try:
self.thisptr.get().print_to_DOT(dereference(output))
self.thisptr.get().print_to_dot(dereference(output))
finally:
del output

Expand All @@ -646,7 +646,7 @@ cdef class Nfa:
output_stream = new mata_nfa.stringstream("".encode('ascii'))
cdef string result
try:
self.thisptr.get().print_to_DOT(dereference(output_stream))
self.thisptr.get().print_to_dot(dereference(output_stream))
result = output_stream.str()
finally:
del output_stream
Expand Down
2 changes: 1 addition & 1 deletion examples/example01-simple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ int main() {
aut.delta.add(0, 0, 2);
aut.delta.add(1, 1, 3);

aut.print_to_DOT(std::cout);
aut.print_to_dot(std::cout);
}
2 changes: 1 addition & 1 deletion examples/example02-determinize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ int main() {
aut.delta.add(4, 'c', 8);

Nfa determ{ determinize(aut) };
determ.print_to_DOT(std::cout);
determ.print_to_dot(std::cout);
}
2 changes: 1 addition & 1 deletion examples/example05-parsing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ int main(int argc, char *argv[]) {
}


aut.print_to_DOT(std::cout);
aut.print_to_dot(std::cout);
return EXIT_SUCCESS;
}
4 changes: 2 additions & 2 deletions include/mata/nfa/nfa.hh
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@ public:
*
* @return automaton in DOT format
*/
std::string print_to_DOT() const;
std::string print_to_dot() const;
/**
* @brief Prints the automaton to the output stream in DOT format
*/
void print_to_DOT(std::ostream &output) const;
void print_to_dot(std::ostream &output) const;
/**
* @brief Prints the automaton in mata format
*
Expand Down
6 changes: 3 additions & 3 deletions src/nfa/nfa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,13 @@ bool Nfa::is_acyclic() const {
return acyclic;
}

std::string Nfa::print_to_DOT() const {
std::string Nfa::print_to_dot() const {
std::stringstream output;
print_to_DOT(output);
print_to_dot(output);
return output.str();
}

void Nfa::print_to_DOT(std::ostream &output) const {
void Nfa::print_to_dot(std::ostream &output) const {
output << "digraph finiteAutomaton {" << std::endl
<< "node [shape=circle];" << std::endl;

Expand Down

0 comments on commit f8e527d

Please sign in to comment.