I would like to use datascript to parse the Java
serialization format produced by
java.io.ObjectOutputStream. I think, it is not possible to
specify this format with the current datascript
language. The main problems are the following:
1. The parse process needs data that is not read from the
stream, but provided by the application context.
2. The parse process needs to extract information from
already parsed data to proceed.
The latter problem could be solved by adding user-defined
functions to the datascript specification that do the
extraction of the information from the context. Functions
are required to be state-less.
Examples are the getType(), getElementType() and
getInheritanceDepth() functions in the attached
serialization format definition.
The first problem could be solved by adding oracles to the
datascript language. Oracles are like functions, but they
are not required to be state-less. An oracle acts as an
additional data-source for data that is not parsed, but
provided by the application. Oracles are required to be
asked by the datascript parser in exacly the same order,
whether data is read selectively or not.
Examples are the newHandle() and doReset() oracles in
the attached serialization format definition.
Example format definition for parsing Java serialization format
Parser fix plus build definitions for the serialization example
Logged In: YES
user_id=29238
The (striped) serialization format does no longer compile
with the current CVS version, because of a
NullPointerException. It does compile with the version
cvs update -D "2003/06/12"
if the parser patch that fixes the
StringIndexOutOfBoundsException is applied. The atached file
serialization.patch does include this and additionally
provides build.xml definitions for the serialization example.