| OLD | NEW |
| 1 # Copyright 2013 the V8 project authors. All rights reserved. | 1 # Copyright 2013 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 def transitions_to_multiple_states(self): | 40 def transitions_to_multiple_states(self): |
| 41 return False | 41 return False |
| 42 | 42 |
| 43 def name(self): | 43 def name(self): |
| 44 return self.__name | 44 return self.__name |
| 45 | 45 |
| 46 def action(self): | 46 def action(self): |
| 47 return self.__action | 47 return self.__action |
| 48 | 48 |
| 49 def add_transition(self, key, state): | 49 def add_transition(self, key, state): |
| 50 assert key != None |
| 50 assert not key == TransitionKey.epsilon() | 51 assert not key == TransitionKey.epsilon() |
| 51 assert not self.__transitions.has_key(key) | 52 assert not self.__transitions.has_key(key) |
| 52 self.__transitions[key] = state | 53 self.__transitions[key] = state |
| 53 | 54 |
| 54 def transitions(self): | 55 def transitions(self): |
| 55 return self.__transitions | 56 return self.__transitions |
| 56 | 57 |
| 57 def epsilon_closure_iter(self): | 58 def epsilon_closure_iter(self): |
| 58 return iter([]) | 59 return iter([]) |
| 59 | 60 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 elif len(intersection) <= len(difference): | 385 elif len(intersection) <= len(difference): |
| 385 working_set.add(intersection) | 386 working_set.add(intersection) |
| 386 else: | 387 else: |
| 387 working_set.add(difference) | 388 working_set.add(difference) |
| 388 if old_partitions: | 389 if old_partitions: |
| 389 partitions -= old_partitions | 390 partitions -= old_partitions |
| 390 if new_partitions: | 391 if new_partitions: |
| 391 partitions |= new_partitions | 392 partitions |= new_partitions |
| 392 (start_name, mapping) = self.__create_states_from_partitions(partitions) | 393 (start_name, mapping) = self.__create_states_from_partitions(partitions) |
| 393 return Dfa(self.__dfa.encoding(), start_name, mapping) | 394 return Dfa(self.__dfa.encoding(), start_name, mapping) |
| OLD | NEW |