You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Jesper Söderlund <Je...@smarttrust.com> on 2005/05/19 17:35:08 UTC

Stub compiler...

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


Re: Stub compiler...

Posted by "Alan D. Cabrera" <ad...@toolazydogs.com>.
On 5/20/2005 7:45 PM, Jean-Luc Wasmer wrote:

> Alan D. Cabrera wrote:
>
>> On 5/19/2005 11:35 AM, Jesper Söderlund wrote:
>>
>> The stub compiler is not complete and represents my good intentions.
>
>
> what would have been a good answer to my question 
> (http://mail-archives.apache.org/mod_mbox/directory-dev/200504.mbox/%3c426D3E21.9070503@lists.wasmer.ca%3e)

That is totally my fault and I'm very sorry.  I've been swampped w/ work 
the past month.


Regards,
Alan



Re: Stub compiler...

Posted by Jean-Luc Wasmer <jl...@lists.wasmer.ca>.
Alan D. Cabrera wrote:

> On 5/19/2005 11:35 AM, Jesper Söderlund wrote:
>
> The stub compiler is not complete and represents my good intentions.

what would have been a good answer to my question 
(http://mail-archives.apache.org/mod_mbox/directory-dev/200504.mbox/%3c426D3E21.9070503@lists.wasmer.ca%3e)

JL

Re: Stub compiler...

Posted by "Alan D. Cabrera" <ad...@toolazydogs.com>.
On 5/19/2005 11:35 AM, Jesper Söderlund wrote:

> 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?
>
The stub compiler is not complete and represents my good intentions.

Seriously, we welcome anyone who is remotely interested in helping out 
w/ this.


Regards,
Alan