[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug with polish I/O ?




 Dear Centaur fan,

 I have a problem with polish files containing annotated trees. 

 The situation:
  I want to annotate trees in a formalism (let's call it PLANEUR) with
trees in other formalisms. Furthermore, I want the annotating to
contain tree in any formalism. So, I have defined an intermediate
language (let's call it PRODUIT) which contains only technical
operators (a terminal node  "fragment -> implemented as TREE" and a
list node for such terminals). So, my annotations have the following
structure:
   PLANEUR_node ^fragment_list[fragment -> TREE-in-any-formalism]

 The problem:
 When I try to restore a polish file containing several such
annotation, I get the error "** = : can't compute (_undef_ 0)". A
strange thing is that restoring a tree with a single annotation works
fine. As far as I understand the trace of the fonction "polishread",
the problem seems that Centaur confuses the formalism of the
annotation (PRODUIT) and the formalism of the tree contained in the
"fragment" node.

 The code I wrote :

Metal definition:

--  Definition des noeuds de syntaxe abstraite pour 
-- la partie produit. Il n'y a bien sur pas de syntaxe concrete

definition of PRODUIT is

  abstract syntax

  fragment -> implemented as TREE;
  fragment_list -> FRAGMENT *...;
  ref_tache -> implemented as INTEGER;
  fusion -> REF_TACHE FRAGMENTS;

  FRAGMENT ::= fragment;
  FRAGMENTS ::= FRAGMENT fragment_list;
  REF_TACHE ::= ref_tache;

end definition
(Note : I never used ref_tache and fusion)

Annotation declaration :

;;; annotatation : prod_schema : schema instancie de produit associe a une
;;; resolution. Cette annotation est permanente et doit etre sauvegardee
   (setq decor ({tree}:new_decor 'prod_schema {tree} 
                   ({name}:formalism 'PLANEUR)))
   ({decor}:set-phylum decor ({name}:phylum 'EVERY
                               ({name}:formalism 'PRODUIT)))
;                               ({name}:formalism 'ISETL)))

   ({decor}:controle decor 'visible t)
   ({decor}:controle decor 'sauver t)
   ({decor}:controle decor 'copier t)
   ({decor}:controle decor 'prefixe t)

(defvar :decor-prod_schema ({name}:decor 'prod_schema {tree}
                            ({name}:formalism 'PLANEUR)))


Annotation setting:

(de :met-isetl (ctedit)
; fonction tres temporaire pour mettre la version de resolution 
; selectionnee dans l'etat actif. Doit disparaitre lorsque des fonctions 
; d'edition plus "normales" auront ete implantees
  (let ((tree (car (send 'tree+ (send 'find-selection ctedit '{current}))))
        (planeur ({name}:formalism 'PLANEUR))
        (fragment 
           ({tree}:make ({name}:operator 'fragment_list  :produit)
             ({tree}:make ({name}:operator 'fragment :produit)))
        )
       )
    (ifn ({operator}:equal ({tree}:operator tree)
                          ({name}:operator 'version :planeur))
     (print "Attention, vous n'etes pas sur une version")
         ({tree}:atom_replace ({tree}:down fragment 1)
           ({tree}:copy
              ({variable}:root 
                ({ctedit}:subject ({editor-view}:object :isetl-ctview))))
           {tree})
;     ({tree}:adopt 
     ({decor}:annotation 
         :decor-prod_schema
         ({tree}:down tree 2)
          fragment
;         ({tree}:copy ({variable}:root 
;                       ({ctedit}:subject ({editor-view}:object :isetl-ctview))))
;         "prod_schema"
         {tree}
     )
;    ({decor}:annotation essai-decor tree
;              "(1 2 3)" {string})
    )
  )
)

(note: the code indicates I have had several tentatives)

 So what's wrong ?????

P.S. Everything works fine with my code, except restore/save in
polish.

  Jean-Pierre


==============================================================================
Jean-Pierre JACQUOT        CRIN (Centre de Recherche en Informatique de Nancy)
e-mail: jacquot@loria.fr
post:   CRIN   B.P. 239   F-54506 Vandoeuvre-les-Nancy Cedex   FRANCE
phone:  +33  83.59.20.16
fax:    +33  83.41.30.79
==============================================================================