OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env 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 # Creates byte_machines.rl file. Each machine accepts exactly one byte. | 6 # Creates byte_machines.rl file. Each machine accepts exactly one byte. |
7 # | 7 # |
8 # In the name of a machine "0" means "unset bit", "1" means "set bit", "x" or | 8 # In the name of a machine "0" means "unset bit", "1" means "set bit", "x" or |
9 # "X" mean "any bit", other letters are ignored. Prefix "b_" is used as | 9 # "X" mean "any bit", other letters are ignored. Prefix "b_" is used as |
10 # convention to distinguish these autogenerated machines from the hand-written | 10 # convention to distinguish these autogenerated machines from the hand-written |
11 # ones, underscores do not matter and are used to separate bitfields in a byte | 11 # ones, underscores do not matter and are used to separate bitfields in a byte |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 print | 207 print |
208 | 208 |
209 for byte_machine in byte_machines: | 209 for byte_machine in byte_machines: |
210 print ' %s = %s;' % (byte_machine, MatchingBytes(byte_machine)) | 210 print ' %s = %s;' % (byte_machine, MatchingBytes(byte_machine)) |
211 | 211 |
212 print '}%%' | 212 print '}%%' |
213 | 213 |
214 | 214 |
215 if __name__ == '__main__': | 215 if __name__ == '__main__': |
216 main() | 216 main() |
OLD | NEW |