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

Questions a propos de Centaur



Bonjour,

Je travaille dans un projet ESPRIT II a L'INRIA Lorraine sur les
aspets du development des environement de speification, et je suis
tenu a utilise CENTAUR (version 1 avec LeLisp 15.22) pour implanter la
partie parsing/edition. Il est prevu de programmer un propre interface
pour l'editeur, or il faut "custommiser" largement ce qui est decrit
dans la troisieme partie du Manual Centaur (The Core).

L'exemple donne' dans le Centaur Tutorial (The Crust) est bien joli
mais ne va guere tres loin, et je me sort tres mal de la description
donne'e dans "The Core". 

Je me permets donc de vous poser de temps en temps quelques questions
et remarques sur ce qui m'arrive en programmant avec Centaur. Voici en
deja trois :

1.) Comment puis-je recuperer l'objet du menu qui s'affiche quand on
    appelle Centaur (je suppose qu'il existe une variable ... ).
    Pareille pour les fenetres d'editions que je cre' dans une
    session en appuyant sur le bouton "Editor" du menu ? 

2.) N'y a-t-il pas moyen en Le Lisp de changer la facon de laquelle
    sont imprime' les objets, c-a-d. qc. du genre 

			#<ctedit "Fol.metal">

    au lieu de :

#<ctedit 0 0 #:image:translation:#[0 0 #:image:buffer:#[((((funcall 2 ((
FUNC_NAME ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 
metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 metavariable) (#[Fol
0 ((((comment_s * ((COMMENT ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((
COMMENT ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 
metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 metavariable) (#[Fol
0 ((((comment_s * ((COMMENT ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((
COMMENT ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 
metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 metavariable) (& . 
22)) ((comment 0 string) (& . 23))) (2 . #[Fol 0 (&) (&) (& & &) (-1 . &) (0 .
&) 24 (&) t () () () ()]) . 3)) (#[Fol 0 (((& &) (& &) (& &) (& &) (& &) (& &)
(& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) 
(& &) (& &) (& &) (& &) (& &) (& &))) (((& & . 1) (& & . 2) (& & . 3) (& & . 4
) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & . 10) (& & . 11))) ((
(meta 0 metavariable) (& . 22)) ((comment 0 string) (& . 23)) ((comment_s * &)
(& . 24))) (-1 . #[(& &) () (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (&
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& 
&) (& &) (& &)]) (0 . #[() (& & . 1) (& & . 2) (& & . 3) (& & . 4) (& & . 5) (
& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & . 10) (& & . 11)]) 24 ((#[g159 
tree structure & () & ()] #[g158 tree structure & () & ()] #[g157 tree 
structure & () & ()] #[postfix tree tree & & & &] #[prefix tree tree & & & &])
) t () () () ()] . 24)) ((comment 0 string) (#[Fol 0 (((& &) (& &) (& &) (& &)
(& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) 
(& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &))) (((& & . 1) (& & . 2) (& & .
3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & . 10) (& &
. 11))) (((meta 0 metavariable) (& . 22)) ((comment 0 string) (& . 23)) ((
comment_s * &) (& . 24))) (-1 . #[(& &) () (& &) (& &) (& &) (& &) (& &) (& &)
(& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) 
(& &) (& &) (& &) (& &) (& &)]) (0 . #[() (& & . 1) (& & . 2) (& & . 3) (& & .
4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & . 10) (& & . 11)]) 
24 ((#[g159 tree structure & () & ()] #[g158 tree structure & () & ()] #[g157 
tree structure & () & ()] #[postfix tree tree & & & &] #[prefix tree tree & & 
& &])) t () () () ()] . 23)) ((meta 0 metavariable) (#[Fol 0 (((& &) (& &) (& 
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& 
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &))) (((& & . 1) (& & . 
2) (& & . 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & 
. 10) (& & . 11))) (((meta 0 metavariable) (& . 22)) ((comment 0 string) (& . 
23)) ((comment_s * &) (& . 24))) (-1 . #[(& &) () (& &) (& &) (& &) (& &) (& &
) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &
) (& &) (& &) (& &) (& &) (& &) (& &)]) (0 . #[() (& & . 1) (& & . 2) (& & . 3
) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & . 10) (& & 
. 11)]) 24 ((#[g159 tree structure & () & ()] #[g158 tree structure & () & ()]
#[g157 tree structure & () & ()] #[postfix tree tree & & & &] #[prefix tree 
tree & & & &])) t () () () ()] . 22)) ((var_name 0 name) (#[Fol 0 (((& &) (& &
) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &
) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &))) (((& & . 1) (&
& . 2) (& & . 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (
& & . 10) (& & . 11))) (((meta 0 metavariable) (& . 22)) ((comment 0 string) (
& . 23)) ((comment_s * &) (& . 24))) (-1 . #[(& &) () (& &) (& &) (& &) (& &) 
(& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) 
(& &) (& &) (& &) (& &) (& &) (& &) (& &)]) (0 . #[() (& & . 1) (& & . 2) (& &
. 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & . 10) (&
& . 11)]) 24 ((#[g159 tree structure & () & ()] #[g158 tree structure & () & (
)] #[g157 tree structure & () & ()] #[postfix tree tree & & & &] #[prefix tree
tree & & & &])) t () () () ()] . 21)) ((pred_name 0 name) (#[Fol 0 (((& &) (& 
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& 
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &))) (((& & . 1) (
& & . 2) (& & . 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9)
(& & . 10) (& & . 11))) (((meta 0 metavariable) (& . 22)) ((comment 0 string) 
(& . 23)) ((comment_s * &) (& . 24))) (-1 . #[(& &) () (& &) (& &) (& &) (& &)
(& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) 
(& &) (& &) (& &) (& &) (& &) (& &) (& &)]) (0 . #[() (& & . 1) (& & . 2) (& &
. 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & . 10) (&
& . 11)]) 24 ((#[g159 tree structure & () & ()] #[g158 tree structure & () & (
)] #[g157 tree structure & () & ()] #[postfix tree tree & & & &] #[prefix tree
tree & & & &])) t () () () ()] . 20)) ((func_name 0 name) (#[Fol 0 (((& &) (& 
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& 
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &))) (((& & . 1) (
& & . 2) (& & . 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9)
(& & . 10) (& & . 11))) (((meta 0 metavariable) (& . 22)) ((comment 0 string) 
(& . 23)) ((comment_s * &) (& . 24))) (-1 . #[(& &) () (& &) (& &) (& &) (& &)
(& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) 
(& &) (& &) (& &) (& &) (& &) (& &) (& &)]) (0 . #[() (& & . 1) (& & . 2) (& &
. 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & . 10) (&
& . 11)]) 24 ((#[g159 tree structure & () & ()] #[g158 tree structure & () & (
)] #[g157 tree structure & () & ()] #[postfix tree tree & & & &] #[prefix tree
tree & & & &])) t () () () ()] . 19)) ((identifier 0 name) (#[Fol 0 (((& &) (&
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& 
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &))) (((& & . 1) (
& & . 2) (& & . 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9)
(& & . 10) (& & . 11))) (((meta 0 metavariable) (& . 22)) ((comment 0 string) 
(& . 23)) ((comment_s * &) (& . 24))) (-1 . #[(& &) () (& &) (& &) (& &) (& &)
(& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) 
(& &) (& &) (& &) (& &) (& &) (& &) (& &)]) (0 . #[() (& & . 1) (& & . 2) (& &
. 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9) (& & . 10) (&
& . 11)]) 24 ((#[g159 tree structure & () & ()] #[g158 tree structure & () & (
)] #[g157 tree structure & () & ()] #[postfix tree tree & & & &] #[prefix tree
tree & & & &])) t () () () ()] . 18)) ((constant 0 string) (#[Fol 0 (((& &) (&
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& 
&) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &) (& &))) (((& & . 1) (
& & . 2) (& & . 3) (& & . 4) (& & . 5) (& & . 6) (& & . 7) (& & . 8) (& & . 9)
(& & . 10) (& & . 11))) (((meta 0 metavariable) (& . 22)) ((comment 0 string) 
(& . 23)) ((comment_s * &) (& . 24))) (-1 . #[(& &) () (& &) (& &) (& &) (& &)
(& &) (& &) (& &) (& &) (& &) (& &) (& &) (& ...>


    (on depit d'un printer a la Common Lisp, peut etre que vous
    connaissez du moins un moyen de restreindre les ravages que ca fait
    sur l'ecran ... )


3.) Je definis une fonction 

     (defun {Fol}:parse (file)
       (let ((parsed-tree ({parser}:tree file ({name}:formalism 'Fol) ".")))
	 (if parsed-tree 'ok 'no)))

    Si le parseur se plante a cause d'une erreur syntaxique il me sort
    sur l'ecran qc. comme le suivant: 

? ({Fol}:parse "test1.Fol")

SYNTAX ERROR detected at line 1
** toplevel : echappement indefini : (parse (test1.Fol #[Fol 0 ((((comment_s *
((COMMENT ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 
metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 metavariable) (#[Fol
0 ((((comment_s * ((COMMENT ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((
COMMENT ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 
metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 metavariable) (#[Fol
0 ((((comment_s * ((COMMENT ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((
COMMENT ((meta 0 metavariable) (#[Fol 0 ((((comment_s * ((COMMENT ((meta 0 
metavariable) (#[Fol 0 ((((comment_s * ((COMMENT (& &) (& &)) (2 . #[Fol 0 & &
...   (vous devinez la suite)

    Quelle serait donc le meilleur moyen de recuperer la seule ligne
    qui contient vraiment une information utilisable (la premiere), en
    supprimant la decharge informatique qui la suit ?


	En esperant de ne pas vous avoir pose' des questions insolubles 

						Guido Bosch

--------------------
Guido BOSCH
CRIN/INRIA-Lorraine
Campus scientifique, B.P. 239            
54506 Vandoeuvre-les-Nancy CEDEX       	
Tel.: (+33) 83.91.20.00 ext. 3058      	
Fax.: (+33) 83.41.30.79                	
email: bosch@loria.crin.fr