Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: tools/lexer_generator/dfa.py

Issue 82803003: Experimental parser: add utf8 encoding (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/lexer_generator/code_generator.py ('k') | tools/lexer_generator/nfa.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « tools/lexer_generator/code_generator.py ('k') | tools/lexer_generator/nfa.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698