Related articles |
---|
Finding the correct tool. Dale.K.Pennington@boeing.com (Dale Pennington) (2002-03-21) |
From: | "Dale Pennington" <Dale.K.Pennington@boeing.com> |
Newsgroups: | comp.compilers |
Date: | 21 Mar 2002 21:45:13 -0500 |
Organization: | The Boeing Company |
Keywords: | parse, question |
Posted-Date: | 21 Mar 2002 21:45:13 EST |
Folks,
This is not technically compiler work, but the problem is close
enough that I thought parser generator tools would be useful.
We are passing binary messages over the network using a rather
compilated message definition scheme (hence the hope to be able and do
a parser for it). The input stream in this case is a stream of
bits. Depending on the current state of the message parsing, the size
of the next item (in bits) is known. Since the size of the next item
is based on the current parser state, I assume this means a context
sensitive grammar, hence not amenable to a yacc type parser
generator.
Also, each item has specific validity rules that need to be checked,
as well as rules that relate different field (i.e If Field Type 2 was
in the message, Field Type 9 should not be). Finally, once we can
decode OK, we also want to be able to go in the other direction as
well (encode).
I know I can represent the parsing/decoding sequence as a finite state
machine, and manually implement it, but it would be a real bear. Does
anyone know a good tool for generating this ?
Thanks,
Dale Pennington
[You might be able to get away with a context free grammar feeding back to
a hand-written lexer that carves up the input into chunks of suitable
length. I did this some years ago for Fortran 77, which has an awful
lexical structure since spaces don't count except sometimes, but the
parser grammar's not bad once you have the tokens. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.