Comments (7)
Thanks Ilya! Looks like there's a pretty simple mechanical translation from the fancy syntax.
from asn1ate.
Error reporting in asn1ate is terrible, but the line number usually gives a hint. Near line 218 I found this:
EndApplicationMessage ::= SEQUENCE {
endApplication-Message-id ISO14827-MESSAGE.&id,
endApplication-Message-msg ISO14827-MESSAGE.&MessageBody
}
The &
syntax is not supported by the parser (yet), so if you can phrase that with simpler mechanisms, it might work.
Development of asn1ate is driven mostly by my own needs, so I might not get to this within any reasonable timeframe.
from asn1ate.
thank for answer.
I have question.
it is ASN.1 Information Objects (X.681)
you have support plan?
GENERAL-PROCEDURE ::= CLASS { &Message, &Reply OPTIONAL, &Error OPTIONAL, &id PrintableString UNIQUE }
I think this is a memory pointer.
In Python, can I use it?
Give me a little hint.
I do not have good idea
Sorry
My English is not good enough.
I always thank you.
from asn1ate.
I'd would like to support parsing all of ASN.1, and code-generation for elements that have a reasonable representation in pyasn1. But I realistically don't have time to work on more uncommon features unless I happen to need them for my own projects.
Patches are of course always welcome!
from asn1ate.
Hello,
I wonder if I stumble on the same problem with "&", e.g. for DMI-EXTENSION .&id and
DMI-EXTENSION .&Value in
identifier DMI-EXTENSION .&id ( {
,
...} ) ,
I got the task to build a decoder for PS CDR files according to the 3GPP specs Rel 10 and beyond. Therefore I downloaded from "http://www.3gpp.org/ftp/specs/archive/32_series/32.298/ASN.1/" one of their ASN compilations and tried to compile the files GenericChargingDataTypes.EXP or GPRSChargingDataTypes.EXP using asn1ate.py.
32298-e20 ASN1.zip
It always stops with error, e.g.
python pyasn1gen.py "c:\Users\maja\32298-e20 ASN1\GPRSChargingDataTypes.EXP"
Traceback (most recent call last):
File "pyasn1gen.py", line 588, in
sys.exit(main(sys.argv[1:]))
File "pyasn1gen.py", line 574, in main
parse_tree = parser.parse_asn1(asn1def)
File "C:\Program Files\Python2.7.13\lib\site-packages\asn1ate\parser.py", line
40, in parse_asn1
parse_result = grammar.parseString(asn1_definition)
File "C:\Program Files\Python2.7.13\lib\site-packages\pyparsing.py", line 1632
, in parseString
raise exc
pyparsing.ParseException: Expected "END" (at char 383), (line:13, col:23)
python pyasn1gen.py "c:\Users\maja\Test Automation\32298-e20 ASN1\GenericChargingDataTypes.EXP"
Traceback (most recent call last):
File "pyasn1gen.py", line 588, in
sys.exit(main(sys.argv[1:]))
File "pyasn1gen.py", line 574, in main
parse_tree = parser.parse_asn1(asn1def)
File "C:\Program Files\Python2.7.13\lib\site-packages\asn1ate\parser.py", line
40, in parse_asn1
parse_result = grammar.parseString(asn1_definition)
File "C:\Program Files\Python2.7.13\lib\site-packages\pyparsing.py", line 1632
, in parseString
raise exc
pyparsing.ParseException: Expected "END" (at char 2170), (line:65, col:24)
I found in the testdata/public/ a Huawei CS CDR and thought/hoped that you found a way to compile the 3GPP ASN files for pyasn1.
Kind regards,
Maja
from asn1ate.
Hello Maja,
Unfortunately I still don't have support for the &
syntax (and I don't yet understand what it's used for, and how it might translate into pyasn1.) I'm spending a couple of days working on asn1ate now, so I might get to this before the week is over.
The more you can tell me about the semantics of &
and the expected output, the easier this will be for me.
The ASN.1 files under testdata/public are just examples I've found published on the web, and things that would be great if asn1ate could handle, e.g. LDAP, Kerberos, etc. I haven't had a chance to implement everything required for them yet.
from asn1ate.
Hi Kim,
Take a look at the RFC-6025 -- it's about how to convert X.680 syntax into X.208 one.
Just my 2c. ;)
from asn1ate.
Related Issues (20)
- Fail to parse Kerberos ASN.1 HOT 17
- output missing size constaint HOT 6
- multi-module asn files don't work HOT 8
- default vales for enums need to be strings HOT 4
- Support for CLASS ... WITH SYNTAX ... HOT 6
- to support Brace value notation assignment HOT 4
- Emits invalid python for `BOOLEAN true` HOT 1
- Failure parsing minimal example with VisibleString HOT 3
- restricted_integer_type range constraint HOT 2
- Parsing Error: pyparsing.ParseException: Expected "DEFINITIONS" HOT 5
- resolve imported type declarations HOT 1
- KeyError: if the type is in another module. HOT 2
- single value and range constraint with both '..' and '|' HOT 3
- KeyError EXTERNAL HOT 6
- asn1ate generates incorrect code for DefaultedNamedType
- Feauture Request for 0.6.1: Parsing DEFAULT with structure HOT 1
- interdependent asn1 files to py files HOT 2
- asn1ate needs wheels HOT 9
- PyParsing issue (and work-around) HOT 4
- ParseException: Expected Keyword 'DEFINITIONS', found 'AUTOMATIC' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asn1ate.