Subject: reading a text file ..

From: Daniel Gross <[email-masked]>
Date: Mon, 6 Mar 2000 21:46:30 -0800

Hi all,

After a long time i am writing a prolog program again, but encountered some 
problems, which i think, are due to not knowing how to approach things 
properly.

Following is a sample template of text i wish to parse into prolog, and 
represent as facts.

Token SerializedViewObject_0_1
    IN SerializedObject
    WITH
        attribute, type
             : "OME.GraphicView$GVERecord"
        attribute
            x : 323
        attribute
            y : 301
        attribute
            ID : 1
END

SimpleClass IStarRoleElement
    IN OMEInstantiableClass, IStarActorElementClass
    ISA IStarActorElement
    WITH
        attribute, imagesize
            height : 80
        attribute, imagesize
            width : 80
        attribute, imagename
             : "Role.gif"
        attribute, name
             : "Role"
END

In order to make my life easy (i thought) i read in line by line and 
translate each line into a prolog clause. I managed to do all the work just 
when i wish to translate Comma seperated lists of into lists.i found it 
quite complicated. Is there a simple way to do that. In general is there an 
easy way to parse such structures into prolog facts.

appreciating any response

Daniel