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

Add a Parser / Compiler for ASN.1 Files #3

Open
2 of 3 tasks
ChadSikorra opened this issue Oct 12, 2018 · 3 comments
Open
2 of 3 tasks

Add a Parser / Compiler for ASN.1 Files #3

ChadSikorra opened this issue Oct 12, 2018 · 3 comments
Labels
enhancement New feature or request work in progress

Comments

@ChadSikorra
Copy link
Contributor

ChadSikorra commented Oct 12, 2018

It would be very handy to have a compiler capable of parsing ASN.1 files to PHP classes. And then using those PHP classes to build the requisite ASN.1 data structures to be encoded. Or take an encoded ASN.1 data structure and translate that to the PHP classes that were built.

I also have a need for general ASN.1 parsing in the SNMP library for MIBs to pick apart the generated AST (a subset anyway). This requires a parser based off X.680, and several other components:

  • Create a Lexer / Tokenizer for ASN.1 syntax based on X.680
  • Create a parser / AST generator from the tokenization
  • Create a compiler for translating to / from PHP classes based on the parsed ASN.1.
@ChadSikorra
Copy link
Contributor Author

Making lots of progress on this. I can successfully parse several ASN.1 modules, such as the LDAP, SNMP, and Kerberos definition files from their RFCs. If I had to guess, I probably have 65% of the X.680 doc covered from a parsing perspective. Still lots of work to be done and reorganization of the code I have so far.

@ChadSikorra
Copy link
Contributor Author

X.680 doc parsing is essentially complete (minus a few minor things that aren't commonly used). Working on the X.681, X.682, X.683 parsing.

@ChadSikorra
Copy link
Contributor Author

I have started to pick this back up. There is still much to do, but it now resolves references,, loads imports automatically, and even has some macro support so I can use this for MIB parsing. I need to focus on more tests soon to have something releasable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work in progress
Projects
None yet
Development

No branches or pull requests

1 participant