| 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 12 matching lines...) Expand all Loading... |
| 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 import os | 28 import os |
| 29 import sys | 29 import sys |
| 30 import jinja2 | 30 import jinja2 |
| 31 from copy import deepcopy | 31 from copy import deepcopy |
| 32 from dfa import Dfa | 32 from dfa import Dfa |
| 33 from automaton import Term | 33 from term import Term |
| 34 from transition_keys import TransitionKey | 34 from transition_key import TransitionKey |
| 35 | 35 |
| 36 class CodeGenerator: | 36 class CodeGenerator: |
| 37 | 37 |
| 38 def __init__(self, | 38 def __init__(self, |
| 39 rule_processor, | 39 rule_processor, |
| 40 minimize_default = True, | 40 minimize_default = True, |
| 41 inline = True, | 41 inline = True, |
| 42 switching = True, | 42 switching = True, |
| 43 debug_print = False, | 43 debug_print = False, |
| 44 log = False): | 44 log = False): |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 412 |
| 413 return template.render( | 413 return template.render( |
| 414 start_node_number = 0, | 414 start_node_number = 0, |
| 415 debug_print = self.__debug_print, | 415 debug_print = self.__debug_print, |
| 416 default_action = default_action, | 416 default_action = default_action, |
| 417 dfa_states = dfa_states, | 417 dfa_states = dfa_states, |
| 418 jump_table = self.__jump_table, | 418 jump_table = self.__jump_table, |
| 419 encoding = encoding.name(), | 419 encoding = encoding.name(), |
| 420 char_type = char_type, | 420 char_type = char_type, |
| 421 upper_bound = encoding.primary_range()[1]) | 421 upper_bound = encoding.primary_range()[1]) |
| OLD | NEW |