You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
I have followed the instructions you mention for running the jsketch scripts.
I had an error when I executed the example you wrote and the test cases:
For example, the execution of:
./jsk.sh test/new_ast/Construct.java
produces this error:
AttributeError: 'MethodCallExpr' object has no attribute 'add_bang'
03:18:36 [INFO] java_sk/translator.py:895 => calling: m from Construct
03:18:36 [DEBUG] java_sk/translator.py:927 => scope: f1 F <class 'ast.body.variabledeclarator.VariableDeclarator'>
03:18:36 [DEBUG] java_sk/translator.py:1002 => searching in class: F
03:18:36 [DEBUG] java_sk/translator.py:1009 => potentitals: ['m']
03:18:36 [DEBUG] java_sk/translator.py:1016 => strict_applicable: ['m']
03:18:36 [DEBUG] java_sk/translator.py:1020 => loose_applicable: ['m']
03:18:36 [DEBUG] java_sk/translator.py:1040 => most_specific - name: m, qualifying type: <class 'ast.type.voidtype.VoidType'>, invocation_mode: virtual
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/mypath/java-sketch/java_sk/main.py", line 125, in
sys.exit(translate(**vars(OPT)))
File "/mypath/java-sketch/java_sk/main.py", line 42, in translate
encoder.to_sk()
File "java_sk/encoder.py", line 125, in to_sk
cls_sk = self.gen_cls_sk(cls)
File "java_sk/encoder.py", line 275, in gen_cls_sk
buf.write(self.to_func(m) + os.linesep)
File "java_sk/encoder.py", line 603, in to_func
buf.write(self.tltr.trans(mtd))
File "java_sk/translator.py", line 792, in trans
s.accept(self, **kwargs)
File "/mypath/java-sketch/jskparser/ast/node.py", line 257, in accept
def accept(self, v, **kwargs): v.visit(self, **kwargs)
File "java_sk/visit.py", line 26, in ff
return dispatcher(*args, **kw)
File "java_sk/visit.py", line 44, in call
return d(*args, **kw)
File "java_sk/translator.py", line 210, in visit
n.body.accept(self, **kwargs)
File "/mypath/java-sketch/jskparser/ast/node.py", line 257, in accept
def accept(self, v, **kwargs): v.visit(self, **kwargs)
File "java_sk/visit.py", line 26, in ff
return dispatcher(*args, **kw)
File "java_sk/visit.py", line 44, in call
return d(*args, **kw)
File "java_sk/translator.py", line 277, in visit
s.accept(self, **kwargs)
File "/mypath/java-sketch/jskparser/ast/node.py", line 257, in accept
def accept(self, v, **kwargs): v.visit(self, **kwargs)
File "java_sk/visit.py", line 26, in ff
return dispatcher(*args, **kw)
File "java_sk/visit.py", line 44, in call
return d(*args, **kw)
File "java_sk/translator.py", line 350, in visit
if n.expr: n.expr.accept(self, **kwargs)
File "/mypath/java-sketch/jskparser/ast/node.py", line 257, in accept
def accept(self, v, **kwargs): v.visit(self, **kwargs)
File "java_sk/visit.py", line 26, in ff
return dispatcher(*args, **kw)
File "java_sk/visit.py", line 44, in call
return d(*args, **kw)
File "java_sk/translator.py", line 661, in visit
self.trans_call(n, **kwargs)
File "java_sk/translator.py", line 1044, in trans_call
is_ax2 = callexpr.add_bang
AttributeError: 'MethodCallExpr' object has no attribute 'add_bang'
user1s-MacBook-Pro:java-sketch user1$ java -version
java version "1.8.0_101"
Thanks for your help!
Regards
Matias
The text was updated successfully, but these errors were encountered:
Hello
I have followed the instructions you mention for running the jsketch scripts.
I had an error when I executed the example you wrote and the test cases:
For example, the execution of:
./jsk.sh test/new_ast/Construct.java
produces this error:
AttributeError: 'MethodCallExpr' object has no attribute 'add_bang'
Here the complete log:
user1s-MacBook-Pro:java-sketch user1$ ./jsk.sh test/new_ast/Construct.java
03:18:36 [INFO] /mypath/java-sketch/java_sk/main.py:36 => parsing ['test/new_ast/Construct.java']
03:18:36 [INFO] /mypath/java-sketch/jskparser/jskparser/jskparser.py:32 => parsing file...
03:18:36 [INFO] /mypath/java-sketch/jskparser/jskparser/jskparser.py:36 => generating symbol table...
03:18:36 [INFO] /mypath/java-sketch/jskparser/jskparser/jskparser.py:38 => building class heirarchy...
03:18:36 [INFO] /mypath/java-sketch/java_sk/main.py:41 => encoding to Sketch
03:18:36 [INFO] java_sk/encoder.py:114 => generating Object.sk
03:18:36 [INFO] java_sk/encoder.py:117 => generating meta.sk
03:18:36 [INFO] java_sk/encoder.py:121 => generating cls.sk
03:18:36 [DEBUG] java_sk/translator.py:813 => accessing this.x:10
03:18:36 [DEBUG] java_sk/translator.py:823 => found field: x_A
03:18:36 [DEBUG] java_sk/translator.py:835 => non-static field - type(n.scope): <class 'ast.expr.thisexpr.ThisExpr'>
03:18:36 [DEBUG] java_sk/translator.py:845 => END FIELD ACCESS
03:18:36 [INFO] java_sk/translator.py:895 => calling: m from Construct
03:18:36 [DEBUG] java_sk/translator.py:927 => scope: f1 F <class 'ast.body.variabledeclarator.VariableDeclarator'>
03:18:36 [DEBUG] java_sk/translator.py:1002 => searching in class: F
03:18:36 [DEBUG] java_sk/translator.py:1009 => potentitals: ['m']
03:18:36 [DEBUG] java_sk/translator.py:1016 => strict_applicable: ['m']
03:18:36 [DEBUG] java_sk/translator.py:1020 => loose_applicable: ['m']
03:18:36 [DEBUG] java_sk/translator.py:1040 => most_specific - name: m, qualifying type: <class 'ast.type.voidtype.VoidType'>, invocation_mode: virtual
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/mypath/java-sketch/java_sk/main.py", line 125, in
sys.exit(translate(**vars(OPT)))
File "/mypath/java-sketch/java_sk/main.py", line 42, in translate
encoder.to_sk()
File "java_sk/encoder.py", line 125, in to_sk
cls_sk = self.gen_cls_sk(cls)
File "java_sk/encoder.py", line 275, in gen_cls_sk
buf.write(self.to_func(m) + os.linesep)
File "java_sk/encoder.py", line 603, in to_func
buf.write(self.tltr.trans(mtd))
File "java_sk/translator.py", line 792, in trans
s.accept(self, **kwargs)
File "/mypath/java-sketch/jskparser/ast/node.py", line 257, in accept
def accept(self, v, **kwargs): v.visit(self, **kwargs)
File "java_sk/visit.py", line 26, in ff
return dispatcher(*args, **kw)
File "java_sk/visit.py", line 44, in call
return d(*args, **kw)
File "java_sk/translator.py", line 210, in visit
n.body.accept(self, **kwargs)
File "/mypath/java-sketch/jskparser/ast/node.py", line 257, in accept
def accept(self, v, **kwargs): v.visit(self, **kwargs)
File "java_sk/visit.py", line 26, in ff
return dispatcher(*args, **kw)
File "java_sk/visit.py", line 44, in call
return d(*args, **kw)
File "java_sk/translator.py", line 277, in visit
s.accept(self, **kwargs)
File "/mypath/java-sketch/jskparser/ast/node.py", line 257, in accept
def accept(self, v, **kwargs): v.visit(self, **kwargs)
File "java_sk/visit.py", line 26, in ff
return dispatcher(*args, **kw)
File "java_sk/visit.py", line 44, in call
return d(*args, **kw)
File "java_sk/translator.py", line 350, in visit
if n.expr: n.expr.accept(self, **kwargs)
File "/mypath/java-sketch/jskparser/ast/node.py", line 257, in accept
def accept(self, v, **kwargs): v.visit(self, **kwargs)
File "java_sk/visit.py", line 26, in ff
return dispatcher(*args, **kw)
File "java_sk/visit.py", line 44, in call
return d(*args, **kw)
File "java_sk/translator.py", line 661, in visit
self.trans_call(n, **kwargs)
File "java_sk/translator.py", line 1044, in trans_call
is_ax2 = callexpr.add_bang
AttributeError: 'MethodCallExpr' object has no attribute 'add_bang'
user1s-MacBook-Pro:java-sketch user1$ java -version
java version "1.8.0_101"
Thanks for your help!
Regards
Matias
The text was updated successfully, but these errors were encountered: