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

Re: Problems with CENTAUR




In article <38024@sophia.inria.fr>, Thierry.Gautier@irisa.fr (Thierry Gautier) writes:

|> We are currently beginning using CENTAUR, and, not surprisingly, I think,
|> we meet some problems.
|> (we use CENTAUR 1.1) :

May I urge you to use the last version of Centaur ? In particular if you start
using Centaur. We have not enough man-power to maintain many versions of the
system, and it will be must easier for us to help you if you use a recent
version.

|> How to attach PASCAL comments in the trees ?
|> (they have defined a PASCAL grammar with METAL).

There is nothing special to do. Just to write the proper input file for lex
(L.tokens). Here is an exemple for a langage with comments starting with "/*"
and endding with "*/"

...
%S waitdata entrypoint sentences comment\
%%\
<comment>([^*\\n]|"*"*[^*/\\n])*"*"*"*/"   {yytext[yyleng -2]= 0; \
         fprintf(yyout,"-1\\n%d\\n%s\\n",yyleng-2,yytext);\
         BEGIN sentences; };\
<comment>([^*\\n]|"*"*[^*/\\n])*   {fprintf(yyout,"-1\\n%d\\n%s\\n",yyleng,yytext); }\
<comment>"*/"   {BEGIN sentences; };\
<comment>\\n {fputs("-2\\n",yyout); }\
<sentences>\\n {BEGIN sentences; fputs("-2\\n",yyout); }\
<sentences,comment>[ \\t] ;\

$a\
<sentences>"/*"						{BEGIN comment; };\
...

|> How to use some VTP primitives : adopt, restore and save ?

I would like to know more precisely what you want to do with
VTP primitives.

VTP primitives are very low level. It is advisable to use higher level
primitives instead of the corresponding VTP primitives when possible.
This is the case when you want to modify a tree: use primitives on
variables (4.2 p.13 of the "path manual"), not VTP directly
(in this case {variable}:insert is a better idea than {tree}:adopt).
However, VTP primitives are ok when you want to build an abstract
syntax tree (with {tree}:make and {decor}:annotation).

To write and read polish files,  there are two (undocumented) functions:
(#:inter:store-polish tree fullpathname) to write a polish file,
(#:inter:load-file fullpathname) to load a polish file. This last function
returns a list containing (tree name directory).

If you want to save annotations, dont forget to set the 'sauver flag
(see {decor}:controle).

-- 
Send contributions and compliments to centaur@sophia.inria.fr. Registration
and administrative matters should be sent to centaur-request@sophia.inria.fr.
+---------------------------------------------------------------------------+
|     Thierry Despeyroux      | email: Thierry.Despeyroux@sophia.inria.fr   |
| I.N.R.I.A. Sophia-Antipolis | phone: +33 93 65 77 07 fax: +33 93 65 77 66 |
+---------------------------------------------------------------------------+