[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Pbs avec centaur
Bonjour,
Je viens d'installer Centaur sur mon syste`me (station Sun Elc avec
SunOs4.1.3). J'essais de faire tourner l'exemple Exp fournis dans le
tutorial et j'ai les proble`mes suivants:
Pour compiler la spe'cification metal du parser, cela est fait dans le
directory ou` a e'te' lance' Centaur.
Quand j'ai ge'ne're' un parser avec 'ctmake allmetal' je ne peux pas
lire un fichier .Exp. Quand je demande de le lire, il ne se passe rien
(pas de message dans la fene^tre ou` j'ai lance' centaur.
Je joins un re'capitulatif des fichiers cre'es ainsi que des diectory
ou` ils sont
Merci d'avance pour votre aide,
Philippe Bazet.
e-mail: cri@ensmp.fr
%% ~/.centaur.rdb
Centaur.UserFormalism: (Exp)
Centaur.Exp.Database.UserDefaults: Centaur/tables/Exp/syntax/Exp.rdb
%% ------------------------------------------------------------------
%% ~/Centaur/tables/Exp/syntax/Exp.rdb
Centaur.Exp.Root: user
Centaur.Exp.Location: Centaur/tables/Exp/syntax/metal
Centaur.Exp.Mode: std
Centaur.Exp.SyntaxManager.Syntax.Root: user
Centaur.Exp.SyntaxManager.Syntax.Location: Centaur/tables/Exp/syntax/metal
Centaur.Exp.SyntaxManager.Syntax.Hostname: montsegur
%% ------------------------------------------------------------------
%% ~/Centaur/tables/Exp/syntax/metal/Buildfile
LANGUAGE=Exp
all: allmetal
#include /export/local/sun4/Centaur/centaur/tables/metal/Buildmetal
%% ------------------------------------------------------------------
%% ~/Centaur/tables/Exp/syntax/metal/Exp.tokens a` partir de
%% ~/Centaur/tables/Exp/syntax/metal/Exp.tokens.x
1i\
%{\
/*\
This file is a sed script to be applied to the file defining the non\
generic tokens. It should define all the generic ones whose definition\
can't be specified in METAL. It could also define some macros and sizes\
of LEX that may be needed.\
*/\
%}\
%S waitdata entrypoint sentences comment\
%%\
<comment>.* {fprintf(yyout,"-1\\n%d\\n%s\\n",yyleng,yytext); }\
<sentences,comment>\\n {BEGIN sentences; fputs("-2\\n",yyout); }\
<sentences,comment>[ \\t] ;\
$a\
<sentences>[A-Z][A-Z0-9]* return(ID);\
<sentences>[0-9][0-9]* return(INTEGER);\
<sentences>. {fputs("-3\\n",yyout); fputs(yytext,yyout); putc('\n',yyout); }
%% ------------------------------------------------------------------
%% ~/Centaur/tables/Exp/examples/test4.Exp
[VAR] TOTO
%% ------------------------------------------------------------------
%%~/Centaur/tables/Exp/syntax/metal/Exp.metal
definition of Exp is
rules
<axiom> ::= <exp_s> ;
<exp_s>
<exp_s> ::= <exp> ;
exp_s-list ((<exp>))
<exp_s> ::= <exp_s> ";" <exp> ;
exp_s-post (<exp_s>,<exp>)
<exp> ::= <variable> ":=" <exp> ;
assign (<variable>,<exp>)
<exp> ::= <factor> ;
<factor>
<exp> ::= <exp> "+" <factor> ;
plus (<exp>,<factor>)
<exp> ::= <exp> "-" <factor> ;
minus (<exp>,<factor>)
<factor> ::= <unary> ;
<unary>
<factor> ::= <factor> "*" <unary> ;
prod (<factor>,<unary>)
<unary> ::= <term> ;
<term>
<unary> ::= "-" <term> ;
uminus(<term>)
<term> ::= <variable> ;
<variable>
<term> ::= <int> ;
<int>
<term> ::= "(" <exp> ")" ;
<exp>
<variable> ::= %ID ;
variable-atom (%ID)
<int> ::= %INTEGER ;
litteralint-atom (%INTEGER)
abstract syntax
exp_s -> EXP + ... ;
assign -> VAR EXP ;
plus -> EXP EXP ;
minus -> EXP EXP ;
prod -> EXP EXP ;
uminus -> EXP ;
variable -> implemented as IDENTIFIER ;
litteralint -> implemented as STRING ;
EXP_S ::= exp_s ;
EXP ::= assign plus minus prod variable litteralint uminus;
VAR ::= variable ;
LITTERALINT ::= litteralint ;
rules
<axiom> ::= "[EXP_S]" <exp_s> ;
<exp_s>
<axiom> ::= "[EXP]" <exp> ;
<exp>
<axiom> ::= "[VAR]" <variable> ;
<variable>
end definition
%% ------------------------------------------------------------------