Mercurial > hg > Members > shinya > pyrect
changeset 100:6aab6b1038f0
bug-fix
author | Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 12 Dec 2010 23:14:05 +0900 |
parents | e327e93aeb3a |
children | 5e509a9c951c |
files | pyrect/translator/grep_translator.py |
diffstat | 1 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/pyrect/translator/grep_translator.py Sun Dec 12 23:09:19 2010 +0900 +++ b/pyrect/translator/grep_translator.py Sun Dec 12 23:14:05 2010 +0900 @@ -70,7 +70,7 @@ self.filter = False if not self.filter_only: - for state in self.cg.transition.iterkeys(): + for state in self.fa.transition.iterkeys(): self.emit("void %s(%s);" % (self.state_name(state), self.interface)) self.emit() @@ -96,11 +96,11 @@ self.emit("accept(%s);" % self.args) elif self.filter_prefix: self.emit("buf++;") - self.emit("%s(%s);" % (self.state_name(self.cg.start), self.args)) + self.emit("%s(%s);" % (self.state_name(self.fa.start), self.args)) else: self.emit("beg = get_line_beg(buf, beg);") self.emit("buf = beg;") - self.emit("%s(%s);" % (self.state_name(self.cg.start), self.args)) + self.emit("%s(%s);" % (self.state_name(self.fa.start), self.args)) self.emit("UCHARP get_line_beg(UCHARP p, UCHARP beg);", 2) self.emiti("void bmh_filter(%s) {" % self.interface) @@ -146,11 +146,11 @@ self.emit("accept(%s);" % self.args) elif self.filter_prefix: self.emit("buf+%d;" % l) - self.emit("%s(%s);" % (self.state_name(self.cg.start) ,self.args)) + self.emit("%s(%s);" % (self.state_name(self.fa.start) ,self.args)) else: self.emit("beg = get_line_beg(buf, beg);") self.emit("buf = beg;") - self.emit("%s(%s);" % (self.state_name(self.cg.start), self.args)) + self.emit("%s(%s);" % (self.state_name(self.fa.start), self.args)) self.emit("UCHARP get_line_beg(UCHARP p, UCHARP beg);", 2) @@ -211,7 +211,7 @@ self.emit( "goto ret;") self.demit( "}") self.demit( "} while((buf += %d) <= end_);" % min_len) - self.emit( "ret: return %s(%s);" % (self.state_name(self.cg.start) , self.args)) + self.emit( "ret: return %s(%s);" % (self.state_name(self.fa.start) , self.args)) self.demit("}", 2) def emit_driver(self): @@ -219,7 +219,7 @@ if self.filter: self.emit( "%s(%s);" % (self.filter + "_filter", self.args)) else: - self.emit( "%s(%s);" % (self.state_name(self.cg.start), self.args)) + self.emit( "%s(%s);" % (self.state_name(self.fa.start), self.args)) self.emit( "return;") self.demit("}", 2) return @@ -253,7 +253,7 @@ self.emiti("switch(*buf++) {") for case, next_ in case.iteritems(): self.trans_stmt.emit(case, self.state_name(next_)) - if default == self.state_name(self.cg.start) and self.skip_boost: + if default == self.state_name(self.fa.start) and self.skip_boost: self.emit("default: return booster(%s);" % self.args) else: self.emit("default: return %s(%s);" % (default, self.args)) @@ -264,7 +264,7 @@ self.emiti("void %s(%s) {" % (self.state_name(cur_state), self.interface)) - if cur_state in self.cg.accepts: + if cur_state in self.fa.accepts: self.emit( "return accept(beg, buf-1, end);") self.demit("}", 2) return @@ -272,11 +272,11 @@ if transition.has_key(AnyChar()): default = self.state_name(transition.pop(AnyChar())) else: - default = self.state_name(self.cg.start) + default = self.state_name(self.fa.start) - if self.table_lookup and (cur_state == self.cg.start or \ + if self.table_lookup and (cur_state == self.fa.start or \ self.state_name(cur_state) == default): - if self.skip_boost and default == self.state_name(self.cg.start): + if self.skip_boost and default == self.state_name(self.fa.start): default = "booster" tbl = dict() for eol in self.eols: