| 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 19 matching lines...) Expand all Loading... |
| 30 from transition_keys import TransitionKey | 30 from transition_keys import TransitionKey |
| 31 | 31 |
| 32 class Action(object): | 32 class Action(object): |
| 33 | 33 |
| 34 def __init__(self, entry_action, match_action, precedence = -1): | 34 def __init__(self, entry_action, match_action, precedence = -1): |
| 35 for action in [entry_action, match_action]: | 35 for action in [entry_action, match_action]: |
| 36 if action == None: | 36 if action == None: |
| 37 continue | 37 continue |
| 38 assert type(action) == TupleType and len(action) | 38 assert type(action) == TupleType and len(action) |
| 39 assert action[0] != None | 39 assert action[0] != None |
| 40 assert entry_action or match_action |
| 40 self.__entry_action = entry_action | 41 self.__entry_action = entry_action |
| 41 self.__match_action = match_action | 42 self.__match_action = match_action |
| 42 self.__precedence = precedence | 43 self.__precedence = precedence |
| 43 | 44 |
| 44 def entry_action(self): | 45 def entry_action(self): |
| 45 return self.__entry_action | 46 return self.__entry_action |
| 46 | 47 |
| 47 def match_action(self): | 48 def match_action(self): |
| 48 return self.__match_action | 49 return self.__match_action |
| 49 | 50 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 node [shape = doublecircle, style=unfilled]; %s | 178 node [shape = doublecircle, style=unfilled]; %s |
| 178 node [shape = circle]; | 179 node [shape = circle]; |
| 179 %s | 180 %s |
| 180 %s | 181 %s |
| 181 } | 182 } |
| 182 ''' % (start_shape, | 183 ''' % (start_shape, |
| 183 start_number, | 184 start_number, |
| 184 " ".join(terminals), | 185 " ".join(terminals), |
| 185 "\n".join(edge_content), | 186 "\n".join(edge_content), |
| 186 "\n".join(node_content)) | 187 "\n".join(node_content)) |
| OLD | NEW |