Re: Tree Creation
- From: "Dustin Withers" <fadeddata@xxxxxxxxx>
- Date: 30 Sep 2006 22:21:43 -0700
Pascal Bourguignon wrote:
"Dustin Withers" <fadeddata@xxxxxxxxx> writes:
Hello All,
I'm working on a project to parse EDI documents and I'm learning Lisp
at the same time :) It's not anything that needs to be done quickly (we
are already using an outsourced application) but I would love to use
Lisp in a production environment.
Given this mapping:
(defparameter *850-mapping*
'((("ISA")
(("GS")
(("ST"))
(("BEG"))
(("CSH"))
(("DTM"))
(("N1"))
(("PO1")
(("CTP"))
(("PID"))
(("PO4")))
(("CTT")))
(("SE"))
(("GE")))
(("IEA"))))
This defines a grammar (it might be useful to put it in a more
grammar-like form thought).
What would be a more grammar-like form? EDI documents (ASCX12) have two
delimters, a segment and an element delimiter. The first "element" of
the segment is the name of the segment. Each subsequent element, up to
the next segment, is sequentially referenced (BEG01, BEG02, etc...).
The document itself contains no relationship data. I'm trying to
figure out what a more verbose mapping would be. Rainer Joswigs DSL
example uses character indexes of the rows and his mapping is very
simple and straightforward. I don't know what other information I could
include in the mapping that would make it more of a grammar definition.
Should I use CL-PPCRE to define the grammar? Currently I'm using
SPLIT-SEQUENCE to break the document into a list representation.
What might be a good direction for me to head in if I want to turn the
semi-parsed document into:
Therefore I would write a parser generator from the grammar specified.
--
__Pascal Bourguignon__ http://www.informatimago.com/
"Logiciels libres : nourris au code source sans farine animale."
Thanks for the help on this,
-dustin
.
- Follow-Ups:
- Re: Tree Creation
- From: Pascal Bourguignon
- Re: Tree Creation
- References:
- Tree Creation
- From: Dustin Withers
- Re: Tree Creation
- From: Pascal Bourguignon
- Tree Creation
- Prev by Date: Re: Javascript Lisp editor
- Next by Date: Re: Implementor: what to read?
- Previous by thread: Re: Tree Creation
- Next by thread: Re: Tree Creation
- Index(es):
Relevant Pages
|
Loading