Mercurial > hg > Members > shinya > pyrect
changeset 16:100efeeb2ad9
remove unnecessary variable "s_local" in cTranslator.
author | Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 05 Jul 2010 06:25:44 +0900 |
parents | 104ee9208b17 |
children | 5ff3f1efa76a |
files | src/cTranslator.py src/cTranslator.pyc src/cbcTranslator.pyc src/dfareg.pyc src/grep_translator.pyc src/reg2llvm.pyc src/translator.pyc |
diffstat | 7 files changed, 3 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cTranslator.py Mon Jul 05 03:27:38 2010 +0900 +++ b/src/cTranslator.py Mon Jul 05 06:25:44 2010 +0900 @@ -59,18 +59,13 @@ }\n\n""") def emit_switch(self, case, default=None): - if self.cg.type == "NFA": - sLocal = "s_local" - else: - sLocal = "s" - - self.emit("\tswitch(*%s++) {\n" % (sLocal)) + self.emit("\tswitch(s++) {\n") for input, nextStates in case.iteritems(): if input != '': self.emit("\t\tcase '%s': \n" % (input)) for nextState in nextStates: - self.emit("\t\t\t%s%s(%s);\n" % (self.callType, self.modify_state_name(nextState), sLocal)) + self.emit("\t\t\t%s%s(s);\n" % (self.callType, self.modify_state_name(nextState))) if self.breakStatement != '': self.emit(self.breakStatement+'\n') if default: @@ -83,14 +78,10 @@ if self.debug: self.emit("\tprintf(\"state: %s, input: %%s\\n\", s);\n" % (cur_state)) if self.cg.type == "NFA": - sLocal = "s_local" - self.emit("\tchar* %s = s;\n" % (sLocal)) if '' in transition: epsilon_transition = transition.pop('') for n in epsilon_transition: - self.emit("\t%s%s(%s);\n" % (self.callType, self.modify_state_name(n), sLocal)) - else: - sLocal = "s" + self.emit("\t%s%s(s);\n" % (self.callType, self.modify_state_name(n))) if cur_state in self.cg.accepts: transition['\\0'] = ["accept"]