OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 | 6 |
7 """Generates C equivalent of the DFA defined in a dot file for the decoder test. | 7 """Generates C equivalent of the DFA defined in a dot file for the decoder test. |
8 | 8 |
9 Reads the dot file from stdin and writes the output to stdout. | 9 Reads the dot file from stdin and writes the output to stdout. |
10 | 10 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 print '}' | 226 print '}' |
227 print | 227 print |
228 print 'uint16_t start_state = {0};'.format(start_state) | 228 print 'uint16_t start_state = {0};'.format(start_state) |
229 print | 229 print |
230 print 'uint16_t NumStates() { return %d; }' % (max_state + 1) | 230 print 'uint16_t NumStates() { return %d; }' % (max_state + 1) |
231 | 231 |
232 | 232 |
233 if __name__ == '__main__': | 233 if __name__ == '__main__': |
234 sys.exit(Main()) | 234 sys.exit(Main()) |
OLD | NEW |