views:

383

answers:

4

I must produce a reconnaissor automat of SPDH protocol .

SPDH defines the structure of request and response messages exchanged between an electronic payment terminal and the server of the bank

The specifications of this protocol are described in this document : http://www.trauco.com/docs/SPDH-specification_070212.pdf

I specified the following grammar for this protocol:

Frame           : = header fids etx ;

header          : = fields ;

fields          : = field fields | epsilon ;

field           : = string | number ;


fids            : = fid FieldSeparator fids | epsilon ;

fid             : = exp | subfids ;

exp             : = string | number| whitespace ;

subfids         : = exp RecordSeparator subfids |epsilon ;

whitespace      : = space whitespace | epsilon ;

space           : = ' ' ;

string          : = letter string | digits string | '-' string | period string |epsilon ;


FieldSeparator  : = period | epsilon ;

RecordSeparator : = '!'| epsilon    ;

number          : = digits number | epsilon    ;

digits          : = '0'|'1'|...|'8'| '9'    ;

letter          : = 'a'|...|'z'|'A'|...|'Z'    ;

period          : = '.'              ;

etx             : = 'ETX'| epsilon  ;

I need some help to conceive my application and to implement my grammar.

thank you

A: 

Hi,

Johannes Weiß
yes I've specified the grammar but if it's wrong , I want to know your suggestions to correct it.I'll use J2EE as platform.I have to develop all the application I won't use a parser generator.
So can you help me to conceive this application?!
why won't you use a parser generator? Writing parsers yourself is very error-prone. Using or not using a parser generator has nothing to do with "developing all the application on yourself".
Johannes Weiß
A: 

Because I won't create a compiler. I have just to break up the frame into fields. I have in second step to save all fields in a data base.

A: 

Try creating a state diagram of the frame. Maybe the first time you wown't get it right but this way you will get a better understanding of the frame strucuture.

I would give you a hand but the link provided is not accessible for me. Please email the file or send an alternative link.

A: 

Thanks iuli, but how can I email you the file?