Hi All,
I know I was adviced by some people on this list to do BER coding / decoding by hand, but I tried to make it run with the stub compiler nontheless.

Needless to say I was not successful :(

I made a pretty simple approach in running the test since I could find no main-class driving the stub compiler I piggy backed on one of the unittestest "CompilerTest" and changed to my grammar instread.

The error I received was

------------- Standard Error -----------------
line 5:1: unexpected token: EXPORTS
------------- ---------------- ---------------

so it choked right at the beginning.

So I wanted to get your advice on whether it's feasible to get the following grammar through the stub-compiler or if it's totally out of scope.

Perhaps there's a better way to run the stub-compiler than from the unit test which would make it more compliant?

Thanks,
/Jesper

MyCompany-EventType {itu-t identified-organization(4) aum(999) event(99)
  version1(1)} DEFINITIONS IMPLICIT TAGS ::=
BEGIN

EXPORTS
  -- general event type
  MyEvent,
    -- data types
    EventID, TimeStamp, EventType, Attributes, Security, SessionID, RelatedID;

-- Unique event number for each request/indication
EventID ::= INTEGER

TimeStamp ::= UTCTime

EventType ::= PrintableString

-- For each event one or more attributes must be set
Attributes ::= SET {
  name   PrintableString,
  value
    CHOICE {binaryValue     [0]  OCTET STRING,
            printableValue  [1]  PrintableString,
            integerValue    [2]  INTEGER,
            booleanValue    [3]  BOOLEAN,
            enumValue       [4]  ENUMERATED {enum1(1), ...
                                             },
            msisdn
              [5]  SEQUENCE {tonNpi  INTEGER(SIZE (1)),
                             number  PrintableString},
            ...}}

-- Secured data
SecData ::= OCTET STRING

-- Secure data type
SecType ::= CHOICE {
  textType  [0]  PrintableString,
  enumType  [1]  ENUMERATED {enum1(1), ...
                             }}

-- Security parameters
Security ::= SEQUENCE {sectype  SecType,
                       secdata  SecData,
                       ...}
-- Session ID
SessionID ::= INTEGER

-- Relative session ID
RelatedID ::= INTEGER

-- The event
MyEvent ::= SEQUENCE {
  -- Mandatory unique eventID
  theEventID     [PRIVATE 0]  EventID,
  -- Mandatory timestamp
  theTimeStamp   [PRIVATE 1]  TimeStamp,
  -- Mandatory event type
  theEventType   [PRIVATE 2]  EventType,
  -- Mandatory attributes depending on event type
  theAttributes  [PRIVATE 3]  SEQUENCE OF Attributes,
  -- Optional security settings
  theSecurity    [PRIVATE 4]  Security OPTIONAL,
  -- Optional session ID
  theSessionid   [PRIVATE 5]  SessionID OPTIONAL,
  -- Optional related ID
  theRelatedid   [PRIVATE 6]  RelatedID OPTIONAL,
  --= For future expansion
  ...}

--
END






Jesper Söderlund
SmartTrust
Årstaängsvägen 19B
100 74 Stockholm
Mobile: +46-70-5749858
Office: +46-8-6859371
Email: jesper.soderlund@smarttrust.com