Search in sources :

Example 1 with ASNParser

use of com.beanit.asn1bean.compiler.parser.ASNParser in project jasn1 by openmuc.

the class Compiler method getJavaModelFromAsn1File.

private static AsnModel getJavaModelFromAsn1File(String inputFileName) throws Exception {
    AsnModel model = new AsnModel();
    try (InputStream stream = new BufferedInputStream(Files.newInputStream(Paths.get(inputFileName)))) {
        ASNLexer lexer = new ASNLexer(stream);
        ASNParser parser = new ASNParser(lexer);
        parser.module_definitions(model);
    }
    return model;
}
Also used : AsnModel(com.beanit.asn1bean.compiler.model.AsnModel) BufferedInputStream(java.io.BufferedInputStream) BufferedInputStream(java.io.BufferedInputStream) InputStream(java.io.InputStream) ASNLexer(com.beanit.asn1bean.compiler.parser.ASNLexer) ASNParser(com.beanit.asn1bean.compiler.parser.ASNParser)

Aggregations

AsnModel (com.beanit.asn1bean.compiler.model.AsnModel)1 ASNLexer (com.beanit.asn1bean.compiler.parser.ASNLexer)1 ASNParser (com.beanit.asn1bean.compiler.parser.ASNParser)1 BufferedInputStream (java.io.BufferedInputStream)1 InputStream (java.io.InputStream)1