CAMOBAP
CAMOBAP

Reputation: 5657

Abstract language for code generation java and c

I'm working on a native android application which has both .c and .java code. And sometimes I want to use the same emumerations so I have both

on native side

enum _enum_1 {
    VALUE_1 = 0,
    VALUE_2 = 1
};

typedef enum _enum_1 enum_1;

on java side

public enum Enum1 {
    VALUE_1,
    VALUE_2
}

My question is, is there an abstract language to describe enums/classes/structs which can be used to generate a code for java and c languages?

Upvotes: 0

Views: 82

Answers (1)

SKi
SKi

Reputation: 8501

ASN.1 (Abstract Syntax Notation One) is one quite ofter used abstract language. The wiki page contains links to different java and C generators for ASN.1 .

There quite big list of similar interface description language listed in this page.

Upvotes: 1

Related Questions