<-- Go back to GrantB.net

This project is super dead!

If you want to use or fork this Parserator tool, go ahead.

No license is needed, no warranties are provided. Do whatever you want.

But there is no support. (I don't even remember Perl anymore.)

Real talk, guys: I'm super-shocked that people still ask me about this.

For context, here's a timeline:

I haven't used this since 2007. I haven't updated it since 2009. I don't even remember Perl anymore, and will never re-learn it.

But someone asked nicely, so I'm returning it to the internet.

But I cannot help you. This project is so far in my past that I barely remember it. I wish you the best of luck.

-Grant Birchmeier, Jan 7 2020

You want the tgz archive. (This README is also in the archive.)

ASN1 Parserator

The handy ASN1-to-HTML generator tool.
Written when I was with Motorola. I'm rather proud of it, even though there are a few ugly bits.
It converts textual ASN1 specification into easy-to-browse HTML, and is specialized for the UMTS 25.331 and 36.331 specs.
In other words, it turns this into this.

I was thinking about making some improvements, then they laid me off.
I kept a copy as there's a lot of code in here I may re-use someday.
There is no Motorola proprietary info in this program.

Also, I'd like to note that if I ever write a script of this scope again, I'm using Python or something else. Perl's object oriented conventions are crap.

All code by Grant Birchmeier, http://grantb.net
Now supports LTS 36.331!
Thanks to Suwrat for his help.

Contents

How to use
File list
Revision history
Implementation details
Stuff that should be done

How to use:

It's real simple:

$> parserate.pl <html_outputfilename> <asn1_inputfilename>

File list:

README.htmlThis file
parserate.plParserator's launcher script
ASN1tokenizer.pmComponent that transforms ASN1 input into tokens
ASN1Token.pmData class
IEreader.pmComponent that transforms the token list into an internal representation of the ASN1 structures
DefinitionContent.pmData class - one is created for every ASN1 defintion
ASN1Struct.pmData class - every ASN1 structure becomes one of these
SequenceContent.pmData class - for ASN1 SEQUENCE structure data
ChoiceContent.pmData class - for ASN1 CHOICE structure data
HTMLprinter.pmComponent that generates HTML from the internal ASN1 structural representation
asn1-style.cssHTML style sheet (HTMLprinter copies this directly into the HTML output)
BooleanTF.pmdefines TRUE/FALSE constants
testfiles/directory containing sample inputs and drivers for testing

Revision history:


Implementation details:

Parserator consists of three main components as follows. Each component feeds its output into the next:
1. ASN1tokenizer - reads in the ASN1 text and converts it to a list of tokens
2. IEreader - processes the list of tokens from ASN1tokenizer to create an internal representation of all ASN1 structures
3. HTMLprinter - processes the result of IEreader to print out the HTML file

The above process might seem over-elaborate. It might be simpler to create the HTML without first converting to an internal representation, but Parserator's design allows it to be adapted to other purposes in the future. The internal representation created by the IEreader component can be used for other things. For instance, we could easily create a C-code printer to take the place of the HTMLprinter. Or we could create a tool that could traverse the internal representation to find all paths to a given IE.


Stuff that should be done:

This section used to be called "Todo list", but I no longer work in telecom and have no intention of going back and doing these. Anyone who wants to take over this project is welcome to.

The current output of the script is quite good. Most TODOs are under-the-hood improvements, or cosmetic fixes to HTML output in the special cases where the spec is... "funny".