java2python icon indicating copy to clipboard operation
java2python copied to clipboard

AttributeError: 'NoneType' object has no attribute 'type'

Open xiaoxiaoAurora opened this issue 5 years ago • 5 comments

Hello~ run the coomand: python2 j2py CoNLLStreamExtractor.java

Returned the following bug:

line 103:11 no viable alternative at input u'void'
line 103:11 no viable alternative at input u'void'
line 111:45 no viable alternative at input u'>'
line 186:8 no viable alternative at input u'List'
line 186:8 no viable alternative at input u'List'
line 186:43 mismatched input u'(' expecting SEMI
Traceback (most recent call last):
  File "j2py", line 259, in <module>
    sys.exit(runMain(configScript(sys.argv[1:])))
  File "j2py", line 57, in runMain
    return runOneOrMany(options)
  File "j2py", line 83, in runOneOrMany
    return runTransform(options)
  File "j2py", line 128, in runTransform
    transformAST(tree, config)
  File "D:\Python\python27\lib\site-packages\java2python\compiler\__init__.py", line 36, in transformAST
    for node in selector.walk(tree):
  File "D:\Python\python27\lib\site-packages\java2python\lang\selector.py", line 68, in walk
    for item in self.walk(child):
  File "D:\Python\python27\lib\site-packages\java2python\lang\selector.py", line 68, in walk
    for item in self.walk(child):
  File "D:\Python\python27\lib\site-packages\java2python\lang\selector.py", line 65, in walk
    for item in self(tree):
  File "D:\Python\python27\lib\site-packages\java2python\lang\selector.py", line 163, in __call__
    if tree.token.type == self.key:
AttributeError: 'NoneType' object has no attribute 'type'

Best wishes and good luck to you!

xiaoxiaoAurora avatar Jan 14 '20 02:01 xiaoxiaoAurora

I met the same problem.

YyHou avatar Mar 14 '20 08:03 YyHou

hi have you solve the problem?

zhouyang430 avatar May 12 '20 10:05 zhouyang430

hi have you solve the problem?

No, I haven't.

xiaoxiaoAurora avatar May 18 '20 10:05 xiaoxiaoAurora

i have the same probleme

leaderiop avatar Feb 14 '22 20:02 leaderiop

Please I have the same problem, has it been resolved

bunmalik avatar Jun 12 '22 09:06 bunmalik