Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParseException: Expected Keyword 'DEFINITIONS', found 'AUTOMATIC' #75

Open
skorzan opened this issue Dec 28, 2021 · 1 comment
Open

Comments

@skorzan
Copy link

skorzan commented Dec 28, 2021

What's wrong?

PS C:\users\user\appdata\local\programs\python\python310\lib\site-packages\asn1ate> python pyasn1gen.py asn_def.asn
Traceback (most recent call last):
  File "C:\users\user\appdata\local\programs\python\python310\lib\site-packages\asn1ate\pyasn1gen.py", line 649, in <module>
    sys.exit(main())
  File "C:\users\user\appdata\local\programs\python\python310\lib\site-packages\asn1ate\pyasn1gen.py", line 629, in main
    modules = build_semantic_model(parse_tree)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 36, in build_semantic_model
    root.append(_create_sema_node(token))
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 926, in _create_sema_node
    return Module(token.elements)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 276, in __init__
    self.assignments = [_create_sema_node(token) for token in assignments.elements]
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 276, in <listcomp>
    self.assignments = [_create_sema_node(token) for token in assignments.elements]
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 932, in _create_sema_node
    return TypeAssignment(token.elements)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 440, in __init__
    self.type_decl = _create_sema_node(type_decl)
  File "C:\Users\skorzan\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 948, in _create_sema_node
    return _create_sema_node(token.elements[0])
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 960, in _create_sema_node
    return SequenceType(token.elements)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 503, in __init__
    super(SequenceType, self).__init__(elements)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 473, in __init__
    self.components = [_create_sema_node(token)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 473, in <listcomp>
    self.components = [_create_sema_node(token)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\asn1ate\sema.py", line 994, in _create_sema_node
    raise Exception('Unknown token type: %s' % token.ty)
Exception: Unknown token type: ComponentTypeDefault
PS C:\users\user\appdata\local\programs\python\python310\lib\site-packages\asn1ate>
@kimgr
Copy link
Owner

kimgr commented Dec 31, 2021

The title no longer agrees with the backtrace in the description. I guess the asn.1 syntax was fixed?

It looks like you're running into #74. Try an older version of pyparsing as a workaround, it's fixed on pyparsing mainline, but I don't think it's been released yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants