Mercurial > hg > CbC > old > CbC_scripts
changeset 10:eec116fe2387
default meta connection
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 15 Sep 2015 17:41:47 +0900 |
parents | 185d545a9a8e |
children | 09470e372dda |
files | meta_connector/meta_connect_test_name.c meta_connector/meta_connector_name.py |
diffstat | 2 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/meta_connector/meta_connect_test_name.c Mon Sep 14 14:56:49 2015 +0900 +++ b/meta_connector/meta_connect_test_name.c Tue Sep 15 17:41:47 2015 +0900 @@ -34,7 +34,7 @@ __code code1(struct Allocate* allocate) { allocate->size = sizeof(long); allocate->next = Code2; - goto meta(context, Allocator); + goto allocator(); } __code code1_stub(struct Context* context) {
--- a/meta_connector/meta_connector_name.py Mon Sep 14 14:56:49 2015 +0900 +++ b/meta_connector/meta_connector_name.py Tue Sep 15 17:41:47 2015 +0900 @@ -56,14 +56,16 @@ file.write('{0:s}(struct Context* context, {1:s}'.format(splited[0],splited[1])) elif not isMetaOrStub and regexed_l is not None and re.search(r"^ *goto",l): callee_name = regexed_l.group(0).rstrip('(') - if meta_search(lines, callee_name): + if callee_name.startswith('meta_'): + file.write(l) + else: file.write("/*-- connected by script */\n") file.write('// '+l) - file.write("goto {0:s}(context, {1:s}, {2:s});\n".format('meta_'+caller_name,\ - l.split('(')[1].rsplit(')')[0],\ - callee_name.capitalize())) - else: - file.write(l) + args = l.split('(')[1].rsplit(')')[0].strip() + args = args + ',' if args else '' + meta_name = 'meta_'+caller_name if meta_search(lines, callee_name) else 'meta' + file.write("goto {0:s}(context, {1:s} {2:s});\n".format(meta_name, args,\ + callee_name.capitalize())) else: file.write(l)