Information Object Class (ASN.1) - The WITH SYNTAX Clause

The WITH SYNTAX Clause

The WITH SYNTAX clause is effectively a tiny grammar language used to express ways of syntactic definitions of Information Objects.

Consider the following example:

OPERATION ::= CLASS { &opcode INTEGER UNIQUE, &InvocationParsType, &ResponseParsAndResultType, &ExceptionList ERROR OPTIONAL } WITH SYNTAX { OPCODE &opcode REQUEST ARGUMENTS &InvocationParsType RESPONSE ARGUMENTS &ResponseParsAndResultType }

Enclosure in square brackets means optionality of syntactic constructs contained in .

Optionality can be nested.

Tokens all in capital mean keywords, tokens starting with & mean productions requiring substitution of the corresponding entity in place of the token (ASN.1 value, type, or Information Object Set, either instance or reference thereof), depending on the Information Object Class to which this field refers.

Now what we would have otherwise been written as:

getCustomersNum OPERATION ::= { &operationCode get-customers-num-op-type-code, &InvocationParsType Get-customers-num-req-pars-type, &ResponseParsAndResultType Get-customers-num-ind-pars-type, &ExceptionList { wrong-product | wrong-department } }

in the presence of the WITH SYNTAX clause can be rewritten as follows:

getCustomersNum OPERATION ::= { OPCODE get-customers-num-op-type-code, REQUEST ARGUMENTS Get-customers-num-req-pars-type, RESPONSE ARGUMENTS Get-customers-num-ind-pars-type, -- according to BNF in the WITH SYNTAX clause, the following line can be omitted ERRORS { wrong-product | wrong-department } }

To fully understand the grammar concept behind the WITH SYNTAX clause, imagine we wrote our OPERATION Information Object Class definition as follows:

OPERATION ::= CLASS { &opcode INTEGER UNIQUE, &InvocationParsType, &ResponseParsAndResultType, &ExceptionList ERROR OPTIONAL } WITH SYNTAX { &opcode &InvocationParsType &ResponseParsAndResultType }

Then a corresponding Information Object instance for the definition above is to be defined as follows:

getCustomersNum OPERATION ::= { get-customers-num-op-type-code Get-customers-num-req-pars-type Get-customers-num-ind-pars-type { wrong-product | wrong-department } }

Read more about this topic:  Information Object Class (ASN.1)

Famous quotes containing the word clause:

    Long ago I added to the true old adage of “What is everybody’s business is nobody’s business,” another clause which, I think, more than any other principle has served to influence my actions in life. That is, What is nobody’s business is my business.
    Clara Barton (1821–1912)