1 # CONFIGURATION MANAGEMENT OF EDF VERSION
2 # ======================================================================
3 # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
4 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
5 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
6 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
7 # (AT YOUR OPTION) ANY LATER VERSION.
9 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
10 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
11 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
12 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
14 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
15 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
16 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
19 # ======================================================================
22 Ce fichier définit une table de tags à utiliser avec le package
23 mxTextTools pour décoder un fichier au format Asterv5.
25 XXX Ce fichier doit etre corrigé pour incorporer deux modifications
26 réalisées dans la version V1_1p1 d'EFICAS
28 from TextTools import *
31 __version__="$Name: V7_main $"
32 __Id__="$Id: tables.tag,v 1.2.62.1 2013-01-24 14:25:23 pnoyret Exp $"
35 err0='ERR0 , erreur non identifiee : '
36 err1='ERR1 , arguments commande errones : '
37 err2='ERR2 , parenthese obligatoire : '
38 err3='ERR3 , point virgule obligatoire : '
39 err4='ERR4 , ":" obligatoire avant mot cle : '
40 err5='ERR5 , mot cle facteur ou arg obligatoire : '
41 err6='ERR6 , identificateur obligatoire : '
42 err7='ERR7 , mot cle facteur errone : '
43 err8='ERR8 , signe = ou ( attendu : '
44 err9='ERR9 , ( attendue : '
45 err10='ERR10 , vexpr attendue : '
46 err11='ERR11 , ) attendue : '
48 ERRORS=(err0,err1,err2,err3,err4,err5,err6,err7,err8,err9,
51 white_set=set(whitespace)
53 delim=" ();:=,!&*/%\n"
65 AllIn ' \t\n\r' F:next
73 'comments' = Table is:
74 IsInSet white_set F:next T:<blancs>
77 AllNotIn '\n\r' F:next
80 AllInSet white_set F:next
81 Is '%' F:MatchOk T:<comment>
83 t_commespaces = Table is:
84 IsInSet white_set F:next T:<blancs>
87 AllNotIn '\n\r' F:next
90 AllInSet white_set F:next
91 Is '%' F:MatchOk T:<comment>
94 'comments' = Table is:
97 AllNotIn '\n\r' F:next
98 AllIn '\n\r' F:next T:<debut>
99 AllInSet white_set F:next T:<debut>
104 AllIn alpha+'_'+number F:MatchOk
106 t_identificateur = Table is:
108 AllIn alpha+'_'+number F:MatchOk
110 t_identmc = Table is:
112 AllIn alpha+'_'+number F:next
113 None = Table t_commespaces F:next
119 AllIn alpha+'_'+number F:MatchOk
126 Word "''" F:next T:<loop>
127 Is "'" F:MatchFail T:MatchOk
133 IsIn number F:MatchFail T:<decimal>
135 IsIn number F:MatchFail
140 <exposant> # si pas exposant termine number trouve
141 IsIn 'deDE' F:MatchOk
143 AllIn number F:MatchFail T:MatchOk
149 IsIn number F:MatchFail T:<decimal>
151 IsIn number F:MatchFail
156 <exposant> # si pas exposant termine number trouve
157 IsIn 'deDE' F:MatchOk
159 AllIn number F:MatchFail T:MatchOk
163 "RI" = Word 'RI' F:<mp>
165 t_number F:MatchFail # ce n est pas un complexe
166 commespaces F:next # a partir d ici c est un complexe => produire erreurs
169 t_number F:MatchFail T:MatchOk
171 "MP" = Word 'MP' F:MatchFail
173 t_number F:MatchFail # ce n est pas un complexe
174 commespaces F:next # a partir d ici c est un complexe => produire erreurs
177 t_number F:MatchFail T:MatchOk
179 err7 = Table t_err F:MatchFail T:MatchOk
181 # Table pour identifier le keyword PI
185 Word 'PI' F:MatchFail
186 IsIn alpha+'_'+number F:MatchOk T:next
193 'vexpr' = Table ThisTable F:<err10>
195 'par2' = Is ')' F:<err9> T:<op>
196 t_number F:next T:<op>
197 t_complexe F:next T:<op>
200 'vexpr' = Table ThisTable F:<err10> T:<op>
204 'listpar' = Is '(': # on peut avoir une liste de parametres
207 'param' = Table ThisTable F:<err10>
209 Is ',' F:next T:<params>
210 'finlist' = Is ')' F:<err9>
215 'vexpr' = Table ThisTable F:<err10> T:MatchOk
218 'vexpr' = Table ThisTable F:<err10> T:MatchOk
221 err0 = Table t_err F:MatchFail T:MatchOk
223 err10 = Table t_err F:MatchFail T:MatchOk
225 err9 = Table t_err F:MatchFail T:MatchOk
238 t_vexpr F:<err> T:<suite>
241 Is ')' F:<err> T:MatchOk
243 err7 = Table t_err F:MatchFail T:MatchOk
251 'vexpr' = Table t_vexpr F:<err>
253 Is ')' F:<err> T:MatchOk
255 err7 = Table t_err F:MatchFail T:MatchOk
265 'comment' = Table is:
267 AllNotIn '\n\r' F:next
268 AllIn '\n\r' F:MatchOk
271 'Null' = AllIn ' ;\t\n\r'
274 'passline' = Table is:
275 AllNotIn newline F:next
287 Is '\n' F:MatchOk T:MatchOk
290 'formule' = Table is:
296 'type' = Table t_identificateur F:<err>
302 'id' = Table t_identificateur F:<err>
307 'typ' = Table t_identmc F:next
309 'id' = Table t_identificateur F:<err>
311 Is ',' F:next T:<params>
317 'vexpr' = Table t_vexpr F:<err>
325 Is '\n' F:MatchOk T:MatchOk
327 err0 = Table t_err F:MatchFail T:MatchOk
329 err9 = Table t_err F:MatchFail T:MatchOk
331 err11 = Table t_err F:MatchFail T:MatchOk
334 'nom_ope' = Table is:
335 Word 'EVAL' F:next T:MatchFail # EVAL n est pas un nom d operateur, il est reserve
337 AllIn alpha+'_'+number F:next
344 n_string F:next T:MatchOk
352 t_complexe F:next T:<suite>
353 t_number F:next T:<suite>
354 t_eval_expr F:next T:<suite>
355 t_arg F:MatchFail T:<suite>
359 Is ')' F:<arg> T:MatchOk
364 "comments" = Table t_commespaces F:next
365 Is ')' F:next T:MatchOk
367 "comments" = Table t_commespaces F:next
368 Is ':' F:MatchFail # a partir d ici on est dans un mot cle facteur (erreurs eventuelles)
370 "comments" = Table t_commespaces F:next
371 t_larg F:next T:<suite>
372 t_complexe F:next T:<suite>
373 t_number F:next T:<suite>
374 t_eval_expr F:next T:<suite>
377 "comments" = Table t_commespaces F:next
379 "comments" = Table t_commespaces F:next
380 Is ')' F:next T:MatchOk
382 "comments" = Table t_commespaces F:next
383 Is ':' F:<err> T:<args>
385 err7 = Table t_err F:MatchFail T:MatchOk
388 'comm' = Table is: # on attend les arguments entre () sinon erreur
391 Is ')' F:<call> T:MatchOk
402 t_mcf F:<sep> T:<mcfsuite>
404 t_larg F:next T:<suite>
405 t_complexe F:next T:<suite>
406 t_number F:next T:<suite>
407 t_eval_expr F:next T:<suite>
414 Is ')' F:<call> T:MatchOk
416 err1 = Table t_err F:MatchFail T:MatchOk
421 t_larg F:next T:<suite>
422 t_complexe F:next T:<suite>
423 t_number F:next T:<suite>
424 t_eval_expr F:next T:<suite>
425 t_arg F:next T:<suite>
430 err0 = Table t_err F:MatchFail T:MatchOk
439 t_nom_ope F:<affe> T:<comm>
441 t_comm F:MatchFail T:MatchOk
443 t_affe F:MatchFail T:MatchOk
445 err8 = Table t_err F:MatchFail T:MatchOk
448 'noreuse' = Table is:
452 Is '=': # on a affaire a un operateur ou une affectation
454 t_nom_ope F:<affe> T:<comm>
455 Is '(' F:<err8> T:next
458 t_comm F:<err> T:MatchOk
460 t_affe F:<err> T:MatchOk
462 err0 = Table t_err F:MatchFail T:MatchOk
464 err8 = Table t_err F:MatchFail T:MatchOk
467 'commande' = Table is:
468 'noreuse' = Table is:
472 Is '(' F:MatchFail # On est vraiment sur d avoir la commande FIN apres avoir identifie (
473 # On recule d un caractere pour identifier les arguments entre parenthèses
475 t_comm F:next T:MatchOk
476 err0 = Table t_err F:MatchFail T:MatchOk
478 Is ';' F:<err> T:MatchOk
480 err0 = Table t_err F:MatchFail T:MatchOk
483 'commande' = Table is:
486 t_reuse F:MatchFail T:<fin>
487 t_noreuse F:MatchFail
490 Is ';' F:<err> T:MatchOk
492 err0 = Table t_err F:MatchFail T:MatchOk
494 aster_script = Table is:
496 t_nullline F:next T:<top>
497 t_comment F:next T:<top>
498 t_formule F:next T:<top>
499 t_fin F:next T:<AfterFin>
500 t_commande F:next T:<top>
501 t_passline F:next T:<top>
504 t_nullline F:next T:<AfterFin>
505 t_passline F:next T:<AfterFin>
506 EOF Here F:<AfterFin>