summaryrefslogtreecommitdiff
path: root/support/w2latex/rtf.y
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/w2latex/rtf.y
Initial commit
Diffstat (limited to 'support/w2latex/rtf.y')
-rw-r--r--support/w2latex/rtf.y3025
1 files changed, 3025 insertions, 0 deletions
diff --git a/support/w2latex/rtf.y b/support/w2latex/rtf.y
new file mode 100644
index 0000000000..0865ac5a21
--- /dev/null
+++ b/support/w2latex/rtf.y
@@ -0,0 +1,3025 @@
+%{
+ /* Declarations en C */
+#include <stdio.h>
+#include <stdlib.h>
+#define YYDEBUG 1
+#include <malloc.h>
+/*#define fprintf if(!FLAG_DebutTeX) {;} else fprintf*/
+#define ifDTfprintf if(!FLAG_DebutTeX) {;} else fprintf
+#define LF_FNIL 1
+#define LF_FROMAN 2
+#define LF_FSWISS 3
+#define LF_FMODERN 4
+#define LF_FSCRIPT 5
+#define LF_FDECOR 6
+#define LF_FTECH 7
+#define LF_FBIDI 8
+#define CENTER 1
+#define LEFT 2
+#define RIGHT 3
+#define JUST 0
+#define INTINT 0
+#define INTSUM 1
+#define INTPROD 2
+#define BRParentheseO '('
+#define BRAccoladeO '{'
+#define BRSupInfO '<'
+#define BRCrochetO '['
+#define BRParentheseF ')'
+#define BRAccoladeF '}'
+#define BRSupInfF '>'
+#define BRCrochetF ']'
+#define BRPoint '.'
+#include "rtf.ascii.c"
+char calutemp;
+
+char pzIntermStd[]="\\end{minipage}\n\\begin{minipage}";
+char pzIntermFrame[]="\\end{minipage}}\n\\fbox{\\begin{minipage}";
+char * pzIntermDef=pzIntermStd;
+
+char pzEndStd[]="\\end{minipage}\n";
+char * pzEndDef=pzEndStd;
+char pzEndFrame[]="\\end{minipage}}\n";
+
+char pzStartStd[]="\n\\begin{minipage}";
+char * pzStartDef=pzStartStd;
+char pzStartFrame[]="\n\\fbox{\\begin{minipage}";
+
+FILE * entree;
+FILE * sortie;
+FILE * auxiliaire;
+FILE * filetemp;
+FILE * SORT;
+int FLAG_Underline=0;
+int FLAG_Bold=0;
+int FLAG_DebutTeX=0;
+int FLAG_Italique=0;
+int FLAG_FlushLeft=0;
+int FLAG_FlushRight=0;
+int FLAG_Equation=0;
+int FLAG_Center=0;
+int FLAG_Dollars=0;
+int FLAG_FI=0;
+int FLAG_RI=0;
+int FLAG_LI=0;
+int FLAG_Indice=0;
+int FLAG_Exposant=0;
+int FLAG_Integrale=0;
+int FLAG_Symbol=0;
+int FLAG_Suscript=0;
+int FLAG_bracketleft='.';
+int FLAG_bracketright='.';
+int FLAG_SusTab=0;
+int FLAG_CompteTableau=0;
+int FLAG_Tableau=0;
+int FLAG_MatrixAlign=CENTER;
+int FLAG_MatrixCols=1;
+int FLAG_InMatrix=0;
+int FLAG_MatrixColCour=1;
+int FLAG_PICTLargeur=0;
+int FLAG_PICTHauteur=0;
+int FLAG_BorderBot=0;
+int FLAG_Footer=0;
+int FLAG_InPict=0;
+int FLAG_WMetafile=0;
+int FLAG_NIT=1;
+int FLAG_ERROR=0;
+int FLAG_FIRST_ERROR=1;
+int FLAG_EndTeX=0;
+char TAB_PosTabMatrix[]={ ' ', 'c', 'l', 'r' };
+int Num_Col_Tabular=0;
+int ASCII_TABLE=2;
+int lengthLCT=1024;
+int Largeur_Cols[512];
+int cpt,cpt2,cpt3;
+int Num_Max_Col=0;
+int Inter_Col=0;
+char * Ligne_Courante_Tabular;
+typedef struct t_formatDocument
+ {
+ int FDDEFTAB;
+ int FDPAPERW;
+ int FDPAPERH;
+ int FDPSZ;
+ int FDMARGL;
+ int FDMARGR;
+ int FDMARGT;
+ int FDMARGB;
+ int FDFACINGP;
+ int FDGUTTER;
+ int FDMARGMIRROR;
+ int FDLANDSCAPE;
+ int FDPGNSTART;
+ int FDWIDOWCTRL;
+ } t_FormatDocument;
+t_FormatDocument PZ_FD;
+typedef struct t_lfonte
+ {
+ int LF_Fontnum; /* Numero de fonte : Le meme que dans l'ordre de la liste en general */
+ int LF_Fontfamily; /* Famille de fonte: cf les defines */
+ int LF_Fcharset; /* Jeu de caracteres dans la table des polices */
+ int LF_Fprq; /* 'Pitch' de la police dans la table de caracteres */
+ char * LF_Fontname; /* Nom de la fonte */
+ char * LF_TexEquiv; /* Equivalent TeX */
+ struct t_lfonte * suiv;/* Maillon suivant */
+ } t_LFonte, *p_LFonte;
+typedef struct t_ConTeXte
+ {
+ int EtatTexte; /* CENTER ou RIGHT ou LEFT */
+ struct t_ConTeXte * suiv;
+ struct t_ConTeXte * prec;
+ /* Pour l'instant ca nous suffit */
+ } t_contexte, * p_contexte;
+p_contexte DebLisContextes=NULL;
+p_contexte ContextActuel=NULL;
+p_contexte ContextInitTab=NULL;
+p_LFonte DebLisFontes=NULL;
+p_LFonte FonteActuelle=NULL;
+#include "rtf.fonts.c"
+#include "rtf.context.c"
+%}
+
+
+ /* Declarations YACC - BISON */
+%expect 12179
+%union {
+char calu;
+int numo;
+char* motcomm;
+char carcomm;
+char* pcdata;
+}
+%token <numo> NUM
+ /* INCLURE ICI TOUS LES MOTS DE COMMANDE EN TANT QUE TYPES DE TOKENS TERMINAUX. */
+%token <motcomm> PC
+%token <motcomm> PCA
+%token <motcomm> DEFF
+%token <motcomm> FONTTBL
+%token <motcomm> ANSI
+%token <motcomm> RTF
+%token <motcomm> MAC
+%token <motcomm> F
+%token <motcomm> FNIL
+%token <motcomm> FROMAN
+%token <motcomm> FSWISS
+%token <motcomm> FMODERN
+%token <motcomm> FSCRIPT
+%token <motcomm> FDECOR
+%token <motcomm> FTECH
+%token <motcomm> FBIDI
+%token <motcomm> FCHARSET
+%token <motcomm> FPQR
+%token <carcomm> ETOILE /* represente le caractere de commande '/''*' */
+%token <motcomm> FONTFI_LE
+%token <motcomm> FTNIL
+%token <motcomm> FTTRUETYPE
+%token <motcomm> CPG
+%token <motcomm> FI_LETBL
+%token <motcomm> FI_LE
+%token <motcomm> FID
+%token <motcomm> FRELATIVE
+%token <motcomm> FOSNUM
+%token <motcomm> FVALIDMAC
+%token <motcomm> FVALIDDOS
+%token <motcomm> FVALIDNTFS
+%token <motcomm> FVALIDHPFS
+%token <motcomm> FNETWORK
+%token <motcomm> RED
+%token <motcomm> BLUE
+%token <motcomm> GREEN
+%token <motcomm> STYLESHEET
+%token <motcomm> S
+%token <motcomm> CS
+%token <motcomm> DS
+%token <motcomm> KEYCODE
+%token <motcomm> ADDITIVE
+%token <motcomm> SBASEDON
+%token <motcomm> SHIFT
+%token <motcomm> CTRL
+%token <motcomm> ALT
+%token <motcomm> FN
+%token <motcomm> INFO
+%token <motcomm> SECT
+%token <motcomm> HEADER
+%token <motcomm> FOOTER
+%token <motcomm> HEADERL
+%token <motcomm> HEADERR
+%token <motcomm> HEADERF
+%token <motcomm> FOOTERL
+%token <motcomm> FOOTERR
+%token <motcomm> FOOTERF
+%token <motcomm> PAR
+%token <motcomm> ROW
+%token <motcomm> CELL
+%token <motcomm> FONTEMB
+%token <motcomm> COLORTBL
+%token <motcomm> SUBDOCUMENT
+%token <motcomm> TX
+%token <motcomm> TB
+%token <motcomm> TQR
+%token <motcomm> TQC
+%token <motcomm> TQDEC
+%token <motcomm> TLDOT
+%token <motcomm> TLHYPH
+%token <motcomm> TLUL
+%token <motcomm> TITH
+%token <motcomm> TLEQ
+%token <motcomm> BIN
+%token <motcomm> BDATA
+%token <motcomm> SDATA
+%token <pcdata> PCDATA
+%token <pcdata> SNEXT
+%token <motcomm> ABSH
+%token <motcomm> ABSW
+%token <motcomm> B
+%token <motcomm> BGBDIAG
+%token <motcomm> BGCROSS
+%token <motcomm> BGDCROSS
+%token <motcomm> BGDKBDIAG
+%token <motcomm> BGDKCROSS
+%token <motcomm> BGDKDCROSS
+%token <motcomm> BGDKFDIAG
+%token <motcomm> BGDKHORIZ
+%token <motcomm> BGDKVERT
+%token <motcomm> BGFDIAG
+%token <motcomm> BGHORIZ
+%token <motcomm> BGVERT
+%token <motcomm> BINFSXN
+%token <motcomm> BINSXN
+%token <motcomm> BOX
+%token <motcomm> BRDRB
+%token <motcomm> BRDRBAR
+%token <motcomm> BRDRBTW
+%token <motcomm> BRDRCF
+%token <motcomm> BRDRDASH
+%token <motcomm> BRDRDB
+%token <motcomm> BRDRDOT
+%token <motcomm> BRDRHAIR
+%token <motcomm> BRDRL
+%token <motcomm> BRDRR
+%token <motcomm> BRDRS
+%token <motcomm> BRDRSH
+%token <motcomm> BRDRT
+%token <motcomm> BRDRTH
+%token <motcomm> BRDRW
+%token <motcomm> BRSP
+%token <motcomm> BULLET
+%token <motcomm> CAPS
+%token <motcomm> CB
+%token <motcomm> CBPAT
+%token <motcomm> CCHS
+%token <motcomm> CELLX
+%token <motcomm> CF
+%token <motcomm> CFPAT
+%token <motcomm> CHATN
+%token <motcomm> CHDATE
+%token <motcomm> CHDPA
+%token <motcomm> CHDPL
+%token <motcomm> CHFTN
+%token <motcomm> CHFTNSEP
+%token <motcomm> CHFTNSEPC
+%token <motcomm> CHPGN
+%token <motcomm> CHTIME
+%token <motcomm> CLBGBDIAG
+%token <motcomm> CLBGCROSS
+%token <motcomm> CLBGDCROSS
+%token <motcomm> CLBGDKBDIAG
+%token <motcomm> CLBGDKCROSS
+%token <motcomm> CLBGDKFDIAG
+%token <motcomm> CLBGDKHOR
+%token <motcomm> CLBGDKRCDCROSS
+%token <motcomm> CLBGDKVERT
+%token <motcomm> CLBGFDIAG
+%token <motcomm> CLBGHORIZ
+%token <motcomm> CLBGVERT
+%token <motcomm> CLBRDRB
+%token <motcomm> CLBRDRL
+%token <motcomm> CLBRDRR
+%token <motcomm> CLBRDRT
+%token <motcomm> CLCBPAT
+%token <motcomm> CLCFPAT
+%token <motcomm> CLMGF
+%token <motcomm> CLMGR
+%token <motcomm> CLSHDNG
+%token <motcomm> COLNO
+%token <motcomm> COLS
+%token <motcomm> COLSR
+%token <motcomm> COLSX
+%token <motcomm> COLUMN
+%token <motcomm> COLW
+%token <motcomm> DELETED
+%token <motcomm> DEUXPOINTS
+%token <motcomm> DFRMTXTX
+%token <motcomm> DFRMTXTY
+%token <motcomm> DN
+%token <motcomm> DROPCAPLI
+%token <motcomm> DROPCAPT
+%token <motcomm> DXFRTEXT
+%token <motcomm> EMDASH
+%token <motcomm> EMSPACE
+%token <motcomm> ENDASH
+%token <motcomm> ENDNHERE
+%token <motcomm> ENSPACE
+%token <motcomm> EXPND
+%token <motcomm> EXPNDTW
+%token <motcomm> FI
+%token <motcomm> FOOTERY
+%token <motcomm> FS
+%token <motcomm> GUTTERSXN
+%token <motcomm> HEADERY
+%token <motcomm> HYPHPAR
+%token <motcomm> I
+%token <motcomm> INTBL
+%token <motcomm> KEEP
+%token <motcomm> KEEPN
+%token <motcomm> KERNING
+%token <motcomm> LANG
+%token <motcomm> LDBLQUOTE
+%token <motcomm> LEVEL
+%token <motcomm> LI
+%token <motcomm> LINE
+%token <motcomm> LINEBETCOL
+%token <motcomm> LINECONT
+%token <motcomm> LINEMOD
+%token <motcomm> LINEPPAGE
+%token <motcomm> LINERESTART
+%token <motcomm> LINESTARTS
+%token <motcomm> LINEX
+%token <motcomm> LNDSCPSXN
+%token <motcomm> LQUOTE
+%token <motcomm> LTRCH
+%token <motcomm> LTRMARK
+%token <motcomm> LTRPAR
+%token <motcomm> LTRROW
+%token <motcomm> LTRSECT
+%token <motcomm> MARGBSXN
+%token <motcomm> MARGLSXN
+%token <motcomm> MARGRSXN
+%token <motcomm> MARGTSXN
+%token <motcomm> MOINS
+%token <motcomm> NOLINE
+%token <motcomm> NOSUPERSUB
+%token <motcomm> NOWIDCLTPAR
+%token <motcomm> NOWRAP
+%token <motcomm> OUTL
+%token <motcomm> PAGE
+%token <motcomm> PAGEBB
+%token <motcomm> PARD
+%token <motcomm> PGHSXN
+%token <motcomm> PGNCONT
+%token <motcomm> PGNDEC
+%token <motcomm> PGNGNSH
+%token <motcomm> PGNHN
+%token <motcomm> PGNHNSC
+%token <motcomm> PGNHNSM
+%token <motcomm> PGNHNSN
+%token <motcomm> PGNHNSP
+%token <motcomm> PGNLCLTR
+%token <motcomm> PGNLCRM
+%token <motcomm> PGNRESTART
+%token <motcomm> PGNSTARTS
+%token <motcomm> PGNUCLTR
+%token <motcomm> PGNUCRM
+%token <motcomm> PGNX
+%token <motcomm> PGNY
+%token <motcomm> PGWSXN
+%token <motcomm> PHCOL
+%token <motcomm> PHMRG
+%token <motcomm> PHPG
+%token <motcomm> PIPE
+%token <motcomm> PLAIN
+%token <motcomm> PN
+%token <motcomm> PNACROSS
+%token <motcomm> PNB
+%token <motcomm> PNCAPS
+%token <motcomm> PNCARD
+%token <motcomm> PNCF
+%token <motcomm> PNDEC
+%token <motcomm> PNF
+%token <motcomm> PNFS
+%token <motcomm> PNHANG
+%token <motcomm> PNI
+%token <motcomm> PNINDENT
+%token <motcomm> PNLCLTR
+%token <motcomm> PNLCRM
+%token <motcomm> PNLVL
+%token <motcomm> PNLVLBODY
+%token <motcomm> PNLVLCONT
+%token <motcomm> PNNUMONCE
+%token <motcomm> PNORD
+%token <motcomm> PNORDT
+%token <motcomm> PNPREV
+%token <motcomm> PNQC
+%token <motcomm> PNQL
+%token <motcomm> PNQR
+%token <motcomm> PNRESTART
+%token <motcomm> PNSCAPS
+%token <motcomm> PNSECLVL
+%token <motcomm> PNSP
+%token <motcomm> PNSTART
+%token <motcomm> PNSTRIKE
+%token <motcomm> PNTEXT
+%token <motcomm> PNTXTA
+%token <motcomm> PNTXTB
+%token <motcomm> PNUCLTR
+%token <motcomm> PNUCRM
+%token <motcomm> PNUL
+%token <motcomm> PNULD
+%token <motcomm> PNULDB
+%token <motcomm> PNULNONE
+%token <motcomm> PNULW
+%token <motcomm> PNVLBT
+%token <motcomm> POSNEGX
+%token <motcomm> POSNEGY
+%token <motcomm> POSX
+%token <motcomm> POSXC
+%token <motcomm> POSXI
+%token <motcomm> POSXL
+%token <motcomm> POSXO
+%token <motcomm> POSXR
+%token <motcomm> POSY
+%token <motcomm> POSYB
+%token <motcomm> POSYC
+%token <motcomm> POSYIL
+%token <motcomm> POSYT
+%token <motcomm> PVMRG
+%token <motcomm> PVPARA
+%token <motcomm> PVPG
+%token <motcomm> QC
+%token <motcomm> QJ
+%token <motcomm> QL
+%token <motcomm> QR
+%token <motcomm> RDBLQUOTE
+%token <motcomm> REVAUTH
+%token <motcomm> REVDTTM
+%token <motcomm> REVISED
+%token <motcomm> RI
+%token <motcomm> RQUOTE
+%token <motcomm> RTLCH
+%token <motcomm> RTLMARK
+%token <motcomm> RTLPAR
+%token <motcomm> RTLROW
+%token <motcomm> RTLSECT
+%token <motcomm> SA
+%token <motcomm> SB
+%token <motcomm> SBKCOL
+%token <motcomm> SBKEVEN
+%token <motcomm> SBKNONE
+%token <motcomm> SBKODD
+%token <motcomm> SBKPAGE
+%token <motcomm> SBYS
+%token <motcomm> SCAPS
+%token <motcomm> SECTNUM
+%token <motcomm> SECTD
+%token <motcomm> SETUNLOCKED
+%token <motcomm> SHAD
+%token <motcomm> SHADING
+%token <motcomm> SL
+%token <motcomm> SLMULT
+%token <motcomm> SOFTCOL
+%token <motcomm> SOFTLHEIGHT
+%token <motcomm> SOFTLINE
+%token <motcomm> SOFTPAGE
+%token <motcomm> STRIKE
+%token <motcomm> SUB
+%token <motcomm> SUPER
+%token <motcomm> TAB
+%token <motcomm> TILDE
+%token <motcomm> TITLEPG
+%token <motcomm> TRBRDRB
+%token <motcomm> TRBRDRH
+%token <motcomm> TRBRDRL
+%token <motcomm> TRBRDRR
+%token <motcomm> TRBRDRT
+%token <motcomm> TRBRDRV
+%token <motcomm> TRGAPH
+%token <motcomm> TRHDR
+%token <motcomm> TRKEEP
+%token <motcomm> TRLEFT
+%token <motcomm> TROWD
+%token <motcomm> TRQC
+%token <motcomm> TRQL
+%token <motcomm> TRQR
+%token <motcomm> TRRH
+%token <motcomm> UL
+%token <motcomm> ULD
+%token <motcomm> ULDB
+%token <motcomm> ULNONE
+%token <motcomm> ULW
+%token <motcomm> UNDERSCORE
+%token <motcomm> UP
+%token <motcomm> V
+%token <motcomm> VERTALB
+%token <motcomm> VERTALC
+%token <motcomm> VERTALJ
+%token <motcomm> VERTALT
+%token <motcomm> ZWJ
+%token <motcomm> ZWNJ
+%token <motcomm> AENDDOC
+%token <motcomm> AENDNOTES
+%token <motcomm> AFTNBJ
+%token <motcomm> AFTNCN
+%token <motcomm> AFTNNALC
+%token <motcomm> AFTNNAR
+%token <motcomm> AFTNNAUC
+%token <motcomm> AFTNNCHI
+%token <motcomm> AFTNNRLC
+%token <motcomm> AFTNNRUC
+%token <motcomm> AFTNRESTART
+%token <motcomm> AFTNRSTCONT
+%token <motcomm> AFTNSEP
+%token <motcomm> AFTNSEPC
+%token <motcomm> AFTNSTART
+%token <motcomm> AFTNTJ
+%token <motcomm> ALLPROT
+%token <motcomm> ANNOTPROT
+%token <motcomm> BRKFRM
+%token <motcomm> CVMME
+%token <motcomm> DEFFORMAT
+%token <motcomm> DEFLANG
+%token <motcomm> DEFTAB
+%token <motcomm> DOCTEMP
+%token <motcomm> ENDDOC
+%token <motcomm> ENDNOTES
+%token <motcomm> FACINGP
+%token <motcomm> FET
+%token <motcomm> FORMDISP
+%token <motcomm> FORMPROT
+%token <motcomm> FORMSHADE
+%token <motcomm> FRACWIDTH
+%token <motcomm> FTNBJ
+%token <motcomm> FTNCN
+%token <motcomm> FTNNALC
+%token <motcomm> FTNNAR
+%token <motcomm> FTNNAUC
+%token <motcomm> FTNNCHI
+%token <motcomm> FTNNRLC
+%token <motcomm> FTNNRUC
+%token <motcomm> FTNRESTART
+%token <motcomm> FTNRSTCONT
+%token <motcomm> FTNRSTPG
+%token <motcomm> FTNSEP
+%token <motcomm> FTNSEPC
+%token <motcomm> FTNSTART
+%token <motcomm> FTNTJ
+%token <motcomm> GUTTER
+%token <motcomm> HYPHAUTO
+%token <motcomm> HYPHCAPS
+%token <motcomm> HYPHCONSEC
+%token <motcomm> HYPHHOTZ
+%token <motcomm> LANDSCAPE
+%token <motcomm> LINESTART
+%token <motcomm> LINKSTYLES
+%token <motcomm> LTRDOC
+%token <motcomm> MAKEBACKUP
+%token <motcomm> MARGB
+%token <motcomm> MARGL
+%token <motcomm> MARGMIRROR
+%token <motcomm> MARGR
+%token <motcomm> MARGT
+%token <motcomm> NEXTFILE
+%token <motcomm> NOCOLBAL
+%token <motcomm> NOEXTRASPRL
+%token <motcomm> NOTABIND
+%token <motcomm> OTBLRUL
+%token <motcomm> PAPERH
+%token <motcomm> PAPERW
+%token <motcomm> PGNSTART
+%token <motcomm> PRCOLBL
+%token <motcomm> PRINTDATA
+%token <motcomm> PSOVER
+%token <motcomm> PSZ
+%token <motcomm> REVBAR
+%token <motcomm> REVISIONS
+%token <motcomm> REVPROP
+%token <motcomm> REVPROT
+%token <motcomm> RTLDOC
+%token <motcomm> SPRSSPBF
+%token <motcomm> SPRSTSP
+%token <motcomm> SWPBDR
+%token <motcomm> TEMPLATE
+%token <motcomm> TRANSMF
+%token <motcomm> WIDOWCTRL
+%token <motcomm> WRAPTRSP
+%token <motcomm> APOSTROPHE
+%token <motcomm> FIELD
+%token <motcomm> FLDDIRTY
+%token <motcomm> FLDEDIT
+%token <motcomm> FLDLOCK
+%token <motcomm> FLDPRIV
+%token <motcomm> FLDINST
+%token <motcomm> FLDALT
+%token <motcomm> FLDRSLT
+%token <motcomm> PICT
+%token <motcomm> PZINTEGRALE
+%token <motcomm> PZRACINE
+%token <motcomm> PZFRACTION
+%token <motcomm> PZMATRIX
+%token <motcomm> PZBOX
+%token <motcomm> PZBRACKET
+%token <motcomm> PZLIST
+%token <motcomm> PZOVERSTRIKE
+%token <motcomm> PZSUSCRIPT
+%token <motcomm> EQLC
+%token <motcomm> EQRC
+%token <motcomm> EQBC
+%token <motcomm> EQAL
+%token <motcomm> EQAC
+%token <motcomm> EQAR
+%token <motcomm> EQCO
+%token <motcomm> EQVS
+%token <motcomm> EQHS
+%token <motcomm> EQSU
+%token <motcomm> EQPR
+%token <motcomm> EQIN
+%token <motcomm> EQFC
+%token <motcomm> EQVC
+%token <motcomm> EQAI
+%token <motcomm> EQUP
+%token <motcomm> EQDI
+%token <motcomm> EQDO
+%token <motcomm> EQCROCHETO
+%token <motcomm> EQCROCHETF
+%token <motcomm> EQPARENTHO
+%token <motcomm> EQPARENTHF
+%token <motcomm> EQACCOLADO
+%token <motcomm> EQACCOLADF
+%token <motcomm> EQSUPINFO
+%token <motcomm> EQSUPINFF
+%token <motcomm> FOOTNOTE
+%token <motcomm> PZPEQ
+%token <motcomm> BKMKSTART
+%token <motcomm> BKMKEND
+%token <motcomm> BKMKCOLF
+%token <motcomm> BKMKCOLL
+%token <motcomm> MACPICT
+%token <motcomm> PMMETAFILE
+%token <motcomm> WMETAFILE
+%token <motcomm> DIBITMAP
+%token <motcomm> WBITMAP
+%token <motcomm> WBMBITSPIXEL
+%token <motcomm> WBMPLANES
+%token <motcomm> WBMWIDTHBYTES
+%token <motcomm> PICBMP
+%token <motcomm> PICBPP
+%token <motcomm> YR
+%token <motcomm> MO
+%token <motcomm> DY
+%token <motcomm> HR
+%token <motcomm> MIN
+%token <motcomm> SEC
+%token <motcomm> OBJECT
+%token <motcomm> OBJTOPICT
+%token <motcomm> BKMKPUB
+%token <motcomm> PUBAUTO
+%token <motcomm> PICW
+%token <motcomm> PICH
+%token <motcomm> PICWGOAL
+%token <motcomm> PICHGOAL
+%token <motcomm> PICSCALEX
+%token <motcomm> PICSCALEY
+%token <motcomm> PICSCALED
+%token <motcomm> PICCROPT
+%token <motcomm> PICCROPB
+%token <motcomm> PICCROPR
+%token <motcomm> PICCROPL
+%token <motcomm> OBJEMB
+%token <motcomm> OBJLINK
+%token <motcomm> OBJAUTLINK
+%token <motcomm> OBJSUB
+%token <motcomm> OBJPUB
+%token <motcomm> ONJICEMB
+%token <motcomm> LINKSELF
+%token <motcomm> OBJLOCK
+%token <motcomm> OBJUPDATE
+%token <motcomm> OBJCLASS
+%token <motcomm> OBJNAME
+%token <motcomm> OBJTIME
+%token <motcomm> RSLTMERGE
+%token <motcomm> RSLTRTF
+%token <motcomm> RSLTTXT
+%token <motcomm> RSLTPICT
+%token <motcomm> RSLTBMP
+%token <motcomm> OBJSETSIZE
+%token <motcomm> OBJALIGN
+%token <motcomm> OBJTRANSY
+%token <motcomm> OBJCROPT
+%token <motcomm> OBJCROPB
+%token <motcomm> OBJCROPL
+%token <motcomm> OBJCROPR
+%token <motcomm> OBJSCALEY
+%token <motcomm> OBJSCALEX
+%token <motcomm> OBJH
+%token <motcomm> OBJW
+%token <motcomm> OBJDATA
+%token <motcomm> OBJALIAS
+%token <motcomm> OBJSECT
+%token <motcomm> RESULT
+%token <motcomm> PZPAUTREFIELD
+%token <motcomm> ATRFSTART
+%token <motcomm> ATRFEND
+%token <motcomm> ATNTIME
+%token <motcomm> ATNICN
+%token <motcomm> ANNOTATION
+%token <motcomm> ATNREF
+%token <motcomm> ATNID
+%token <motcomm> ATNAUTHOR
+%token <motcomm> PZPENDEQ
+%token <motcomm> XE
+%token <motcomm> TC
+%token <motcomm> DO
+%token <motcomm> PZERROR
+%type <numo> num
+%type <motcomm> input
+%type <motcomm> Entete
+%type <motcomm> pzdeflang
+%type <motcomm> ppentete
+%type <motcomm> pentete
+%type <motcomm> charset
+%type <motcomm> deffont
+%type <motcomm> pfontinfo
+%type <motcomm> fontinfo
+%type <numo> fontfamily
+%type <numo> fcharset
+%type <numo> fpqr
+%type <motcomm> fontaltname
+%type <motcomm> fontemb
+%type <motcomm> fonttype
+%type <pcdata> fontfname
+%type <motcomm> codepage
+%type <motcomm> filetbl
+%type <motcomm> pfileinfo
+%type <motcomm> fileinfo
+%type <motcomm> pfilesource
+%type <motcomm> relpath
+%type <motcomm> osnum
+%type <motcomm> filesource
+%type <motcomm> colortbl
+%type <motcomm> pcolordef
+%type <motcomm> colordef
+%type <motcomm> red
+%type <motcomm> blue
+%type <motcomm> green
+%type <motcomm> stylesheet
+%type <motcomm> pstyle
+%type <motcomm> style
+%type <motcomm> styledef
+%type <motcomm> keycode
+%type <motcomm> pformatting
+%type <motcomm> formatting
+%type <motcomm> additive
+%type <motcomm> based
+%type <motcomm> next
+%type <motcomm> stylename
+%type <motcomm> keys
+%type <motcomm> shift
+%type <motcomm> alt
+%type <motcomm> ctrl
+%type <motcomm> key
+%type <motcomm> revtbl
+%type <motcomm> Document
+%type <motcomm> pdocfmtpsection
+%type <motcomm> info
+%type <motcomm> docfmt
+%type <motcomm> section
+%type <motcomm> psecfmt
+%type <motcomm> secfmt
+%type <motcomm> hdrftr
+%type <motcomm> hdrctl
+%type <pcdata> ppara
+%type <pcdata> ppar
+%type <pcdata> para
+%type <motcomm> pzpn
+%type <motcomm> pnlevel
+%type <motcomm> pndesc
+%type <motcomm> pnnstyle
+%type <motcomm> pnchrfmt
+%type <motcomm> pnul
+%type <motcomm> pnfmt
+%type <motcomm> pnjust
+%type <motcomm> pntxtb
+%type <motcomm> pntxta
+%type <motcomm> brdrdef
+%type <motcomm> brdrseg
+%type <motcomm> pbrdr
+%type <motcomm> brdrk
+%type <motcomm> brdr
+%type <motcomm> psubdoc
+%type <motcomm> pchar
+%type <motcomm> pcell
+%type <motcomm> pznvpparfmt
+%type <motcomm> parfmt
+%type <motcomm> pznvpapoctl
+%type <motcomm> apoctl
+%type <motcomm> framesize
+%type <motcomm> horzpos
+%type <motcomm> vertpos
+%type <motcomm> txtwrap
+%type <motcomm> dropcap
+%type <motcomm> hframe
+%type <motcomm> hdist
+%type <motcomm> vframe
+%type <motcomm> vdist
+%type <motcomm> pznvshading
+%type <motcomm> pshading
+%type <motcomm> pat
+%type <motcomm> pznvtabdef
+%type <motcomm> tabkind
+%type <motcomm> tablead
+%type <motcomm> zpcelldef
+%type <motcomm> ptbldef
+%type <motcomm> pptbldef
+%type <motcomm> ppptbldef
+%type <motcomm> rowjust
+%type <motcomm> rowwrite
+%type <motcomm> pcelldef
+%type <motcomm> pcellshad
+%type <motcomm> cellpat
+%type <pcdata> charr
+%type <pcdata> pznvcharr
+%type <motcomm> pchrfmt
+%type <pcdata> pdata
+%type <pcdata> pznvpdata
+%type <pcdata> data
+%type <motcomm> chrfmt
+%type <motcomm> atext
+%type <carcomm> spec
+%type <motcomm> picttype
+%type <motcomm> bitmapinfo
+%type <motcomm> pictsize
+%type <motcomm> metafileinfo
+%type <motcomm> do
+%type <motcomm> annot
+%type <motcomm> fieldmod
+%type <motcomm> fieldinst
+%type <motcomm> fieldrslt
+%type <motcomm> idx
+%type <motcomm> toc
+%type <pcdata> pzpvpcdata
+%type <pcdata> ppvformule
+%type <pcdata> pzpcdata
+%type <pcdata> pzpict
+%type <pcdata> pzpictsize
+%type <pcdata> ppzpictsize
+%type <pcdata> pppzpictsize
+%type <pcdata> accopzpn
+%type <numo> pznvnum
+%type <pcdata> etfinpznvcharr
+%type <pcdata> endpict
+%%
+ /* Regles de Grammaire */
+input: /* Vide */
+ | '{' Entete { FLAG_DebutTeX=1;
+ fprintf(SORT,"%%\n%% This document was generated using\n%% ");
+ fprintf(SORT,"w2LaTeX\n%% Bug Reports: jgarmend@cyberspace.org\n%%\n\n");
+ fprintf(SORT,"\\documentstyle[a4]{article}\n");
+ fprintf(SORT,"\n\\parindent = %d pt \n",0/*(PZ_FD.FDDEFTAB)*/);
+ fprintf(SORT,"\n\\oddsidemargin0cm\n");
+ fprintf(SORT,"\n\\evensidemargin0cm\n");
+ fprintf(SORT,"\n\\hoffset%dpt \n",(int)(-72+(PZ_FD.FDMARGL)));
+ fprintf(SORT,"\n\\textwidth%dpt \n",
+ (int)(614-(PZ_FD.FDMARGL)-(PZ_FD.FDMARGR)));
+ fprintf(SORT,"\n\\vsize=%dpt\n",(int)(644-(PZ_FD.FDMARGT)));
+ fprintf(SORT,"\n\\font\\mathex=cmex10\n");
+ fprintf(SORT,"\n\\font\\pzrm=cmr10\n");
+ fprintf(SORT,"\n\\pagestyle{myheadings}\n");
+ fprintf(SORT,"\n\\begin{document}\n");
+ /*parcoursfontes();*/
+ }
+ Document '}' { ifDTfprintf(SORT,"\n\\end{document}\n"); /*parcourscontexts();*/
+ FLAG_EndTeX=1;}
+ | PZERROR section
+ ;
+Entete: /* Vide */
+ | RTF num charset deffont /*?*/ pzdeflang '{' FONTTBL pfontinfo '}' ppentete
+ | RTF num charset pzdeflang deffont /*?*/ '{' FONTTBL pfontinfo '}' ppentete
+ | RTF num DEFFORMAT charset deffont /*?*/ pzdeflang '{' FONTTBL pfontinfo '}' ppentete
+ | RTF num pzdeflang charset deffont /*?*/ pzdeflang '{' FONTTBL pfontinfo '}' ppentete
+ | RTF num pzdeflang DEFFORMAT charset deffont /*?*/ pzdeflang '{' FONTTBL pfontinfo '}' ppentete
+ /* Cette derniere regle a ete imposee par la pratique car certains documents generes
+ avec WORD pour MAC ne suivent pas les conventions.... (sic) */
+ /* Note: Ce document se refere aux specifications de la version 1.2 notee simplement 1.
+ Il s'agit en realite des specifications fournies par Microsoft pour la version
+ de WORD 6.0. Nous essayerons de faire de notre mieux pour assurer la compatibilite
+ avec les formats precedents, qui ne sont pas assures de suivre la norme..(sic) ..
+ Note: deffN definit la fonte a utiliser par defaut dans tout le document. */
+ /* Note: les 2 dernieres lignes ont ete rajoutees pour la compatibilite Applix */
+ ;
+pzdeflang: /* Vide */
+ | DEFLANG num /* Ceci est necessaire pour des raisons de compatibilite
+ avec les versions anterieures de WORD */
+ ;
+ppentete: /* Vide */
+ | '{' pentete '}' ppentete
+ ;
+pentete: /* Vide */
+ | filetbl
+ | colortbl
+ | stylesheet
+ | revtbl
+ | INFO info
+ ;
+charset: ANSI
+ | MAC { ASCII_TABLE=1; }
+ | PC { ASCII_TABLE=2; }
+ | PCA
+ ;
+
+deffont: /* Vide */
+ | DEFF num
+ ;
+
+num: /* Vide */ { $$ = 1; }
+ | NUM { $$ = $1; }
+ ;
+pznvnum: NUM { $$=$1; }
+ ;
+pzpcdata: PCDATA { $$ = $1; }
+ | ';' { $$ = ";"; }
+ | 'e' { $$ = "e"; }
+ | 'q' { $$ = "q"; }
+ | ' ' { $$ = " "; }
+ | ' ' { $$ = " "; }
+ ;
+pzpvpcdata: PCDATA { $$ = $1; }
+ | ';' { $$ = ";"; }
+ | 'e' { $$ = "e"; }
+ | 'q' { $$ = "q"; }
+ | ' ' { $$ = " "; }
+ | ' ' { $$ = " "; }
+ | ',' { $$ = ","; }
+ ;
+pfontinfo: fontinfo
+ | '{' fontinfo '}'
+ | fontinfo pfontinfo
+ | '{' fontinfo '}' pfontinfo
+ ;
+
+fontinfo: F num fontfamily fcharset fpqr fontemb codepage pzpcdata { nouvfonte($2,$3,$4,$5,$8); }
+ fontaltname /*?*/ ';'
+ ;
+
+fontfamily: FNIL { $$=LF_FNIL; }
+ | FROMAN { $$=LF_FROMAN; }
+ | FSWISS { $$=LF_FSWISS; }
+ | FMODERN { $$=LF_FMODERN; }
+ | FSCRIPT { $$=LF_FSCRIPT; }
+ | FDECOR { $$=LF_FDECOR; }
+ | FTECH { $$=LF_FTECH; }
+ | FBIDI { $$=LF_FBIDI; }
+ ;
+ /* Note: L'interet de la famille defontes reside dans le fait que l'aplication recevant le document (et c'est
+ notre cas) pourrait ne pas disposer de toutes les fontes, et en particulier de celle demandee par le texte
+ en RTF. On pourra, en connaissant la famille de la police demandee, trouver la plus proche
+ disponible... */
+fcharset: /* Vide */ { $$=-1; }
+ | FCHARSET num { $$=$2; }
+ ;
+ /* Note: fcharsetN determine le jeux de caracteres de la table choisie. */
+fpqr: /* Vide */ { $$=-1; }
+ | FPQR num { $$=$2; }
+ ;
+ /* Note: Specifies the pitch of a font in the font table. (see Spec for values) */
+
+fontaltname: /* Vide */
+ | '{' ETOILE FONTFI_LE codepage /*?*/ pzpcdata '}'
+ ;
+fontemb: /* Vide */
+ | '{' ETOILE FONTEMB fonttype fontfname /*?*/ data /*?*/ '}'
+ ;
+ /* Note: Il et necessaire d'avoir au moins l'un des deux champs <fontfname> <data>
+ Note: deux types de fontes utilisant cette option: \ftnil (Default) et \fttruetype */
+fonttype: FTNIL
+ | FTTRUETYPE
+ ;
+fontfname: /* Vide */
+ | '{' ETOILE FONTFI_LE codepage /*?*/ pzpcdata '}'
+ ;
+codepage: /* Vide */
+ | CPG num
+ ;
+ /* NOTES: \falt determine une police de 'secours' si celle demandee n'est pas disponible.
+ Syntaxe: '{\*' \falt <Alternate Font Name > '}'
+ NOTES: \cpg determine la correspondance entre les tables de codes et les fontes.
+ (voir spec pour liste de valeurs). */
+
+filetbl: /* Vide */
+ | ETOILE FI_LETBL pfileinfo
+ ;
+
+pfileinfo: '{' fileinfo '}'
+ | pfileinfo '{' fileinfo '}'
+ ;
+fileinfo: FI_LE FID num relpath /*?*/ osnum /*?*/ pfilesource pzpcdata
+ ;
+pfilesource: filesource
+ | pfilesource filesource
+ ;
+
+relpath: /* Vide */
+ | FRELATIVE num
+ ;
+osnum: /* Vide */
+ | FOSNUM num
+ ;
+filesource: FVALIDMAC
+ | FVALIDDOS
+ | FVALIDNTFS
+ | FVALIDHPFS
+ | FNETWORK
+ ;
+
+colortbl: /* Vide */
+ | COLORTBL ';' pcolordef
+ | COLORTBL pcolordef /* Pour les besoins de la cause (specifications non specifiees) */
+ ;
+pcolordef: colordef ';'
+ | pcolordef colordef ';'
+ ;
+
+colordef: red blue green
+ | red green blue
+ | blue red green
+ | blue green red
+ | green red blue
+ | green blue red
+ ;
+red: /* Vide */
+ | RED num
+ ;
+blue: /* Vide */
+ | BLUE num
+ ;
+green: /* Vide */
+ | GREEN num
+ ;
+stylesheet: /* Vide */
+ | STYLESHEET pstyle
+ ;
+pstyle: /* Vide */
+ | style pstyle
+ ;
+style: '{' styledef /*?*/ keycode /*?*/ pformatting additive /*?*/ based /*?*/ next /*?*/
+ stylename /*?*/ ';' '}'
+ | '{' styledef /*?*/ keycode /*?*/ additive /*?*/ based /*?*/ next /*?*/
+ stylename /*?*/ ';' '}'
+ ;
+styledef: /* Vide */
+ | S num
+ | CS num
+ | DS num
+ ;
+ /* Note: \csN determine le style de caractere
+ Note: \sN determine le style du paragraphe
+ Note: \dsN determine le style de la section */
+keycode: /* Vide */
+ | '{' KEYCODE keys '}'
+ ;
+pformatting: formatting
+ | pformatting formatting
+ ;
+formatting: brdrdef
+ | pznvpparfmt
+ | pznvpapoctl
+ | pznvtabdef
+ | pznvshading
+ | chrfmt
+ ;
+additive: /* Vide */
+ | ADDITIVE num
+ ;
+ /* Note: \additive (utilise lors de la definition de styles avec '{\*\cs .... } ) indique que les attributs de
+ style doivent etre supperposes aux attributs courrants. */
+based: /* Vide */
+ | SBASEDON num
+ ;
+ /* Note: \sbasedonN definit le numero du style qui a servi de reference au style actuel. */
+next: /* Vide */
+ | SNEXT num
+ ;
+ /* Note: \snextN definit le prochain style associe avec le style courrant. S'il est omis on conserve
+ le style courrant */
+stylename: /* Vide */
+ | pzpcdata
+ ;
+keys: shift ctrl alt key
+ | shift alt ctrl key
+ | alt shift ctrl key
+ | alt ctrl shift key
+ | ctrl alt shift key
+ | ctrl shift alt key
+ ;
+shift: /* Vide */
+ | SHIFT
+ ;
+alt: /* Vide */
+ | ALT
+ ;
+ctrl: /* Vide */
+ | CTRL
+ ;
+key: FN num
+ | pzpcdata
+ ;
+ /* Note: \fnN determine une touche de fonction (numero N) */
+revtbl: /* Vide */
+ ;
+ /* Note: reference tous les auteurs et modifications effectuees sur les documents en question.
+ Il suffit de l'ignorer pour la lecture du texte. */
+time: YR num
+ | MO num
+ | DY num
+ | HR num
+ | MIN num
+ | SEC num
+ | time YR num
+ | time MO num
+ | time DY num
+ | time HR num
+ | time MIN num
+ | time SEC num
+ ;
+/*****************************************************************************************************************/
+Document: /*pinfo: On le metra dans l'entete*/ pdocfmtpsection
+/* | psection */
+ ;
+pdocfmtpsection: docfmt pdocfmtpsection
+ | section
+ | pdocfmtpsection section
+ | '{' ETOILE NEXTFILE pzpcdata '}' pdocfmtpsection
+ | '{' ETOILE TEMPLATE pzpcdata '}'pdocfmtpsection
+ ;
+info: /* Vide */
+ | '{' '}'
+ ;
+ /* POUR L'INSTANT CE CHAMP LA SERA IGNORE. L'ANALYSEUR LEXICAL NE TRANSMETTRA QUE LES ACCOLADES.
+ PAR LA SUITE NOUS TENTERONS DE L'IMPLEMENTER */
+docfmt: DEFTAB num { PZ_FD.FDDEFTAB=($2/20); }
+ | HYPHHOTZ num
+ | HYPHCONSEC num
+ | HYPHCAPS
+ | HYPHAUTO
+ | LINESTART num
+ | FRACWIDTH
+/* | '{' ETOILE NEXTFILE pzpcdata '}'
+ | '{' ETOILE TEMPLATE pzpcdata '}' */
+ | MAKEBACKUP
+ | DEFFORMAT
+ | PSOVER
+ | DOCTEMP
+ | DEFLANG num
+ /* FOOTNOTES AND ENDNOTES */
+ | FET num
+ | FTNSEP
+ | FTNSEPC
+ | FTNCN
+ | AFTNSEP
+ | AFTNSEPC
+ | AFTNCN
+ | ENDNOTES
+ | ENDDOC
+ | FTNTJ
+ | FTNBJ
+ | AENDNOTES
+ | AENDDOC
+ | AFTNBJ
+ | AFTNTJ
+ | FTNSTART num
+ | AFTNSTART num
+ | FTNRSTPG
+ | FTNRESTART
+ | FTNRSTCONT
+ | AFTNRESTART
+ | AFTNRSTCONT
+ | FTNNAR
+ | FTNNALC
+ | FTNNAUC
+ | FTNNRLC
+ | FTNNRUC
+ | FTNNCHI
+ | AFTNNAR
+ | AFTNNALC
+ | AFTNNAUC
+ | AFTNNRLC
+ | AFTNNRUC
+ | AFTNNCHI
+ /* PAGE INFORMATION */
+ | PAPERW num { PZ_FD.FDPAPERW=($2/20); }
+ | PAPERH num { PZ_FD.FDPAPERH=($2/20); }
+ | PSZ num { PZ_FD.FDPSZ=($2/20); }
+ | MARGL num { PZ_FD.FDMARGL=($2/20); }
+ | MARGR num { PZ_FD.FDMARGR=($2/20); }
+ | MARGT num { PZ_FD.FDMARGT=($2/20); }
+ | MARGB num { PZ_FD.FDMARGB=($2/20); }
+ | FACINGP { PZ_FD.FDFACINGP=1; }
+ | GUTTER num { PZ_FD.FDGUTTER=($2/20); }
+ | MARGMIRROR { PZ_FD.FDMARGMIRROR=1; }
+ | LANDSCAPE { PZ_FD.FDLANDSCAPE=1; }
+ | PGNSTART num { PZ_FD.FDPGNSTART=($2/20); }
+ | WIDOWCTRL { PZ_FD.FDWIDOWCTRL=1; }
+ /* LINKED STYLES */
+ | LINKSTYLES
+ /* COMPATIBILITY OPTIONS */
+ | NOTABIND
+ | WRAPTRSP
+ | PRCOLBL
+ | NOEXTRASPRL
+ | NOCOLBAL
+ | CVMME
+ | SPRSTSP
+ | SPRSSPBF
+ | OTBLRUL
+ | TRANSMF
+ | SWPBDR
+ | BRKFRM
+ /* FORMS */
+ | FORMPROT
+ | ALLPROT
+ | FORMSHADE
+ | FORMDISP
+ | PRINTDATA
+ /* REVISION MARKS */
+ | REVPROT
+ | REVISIONS
+ | REVPROP num
+ | REVBAR num
+ /* ANNOTATIONS */
+ | ANNOTPROT
+ /* BIDIRECTIONAL CONTROLS */
+ | RTLDOC
+ | LTRDOC
+ ;
+section: psecfmt '{' hdrftr '}' { if (FLAG_Footer) ifDTfprintf(SORT,"}%%\n");
+ FLAG_Footer=0; }
+ pzhdrftretfin
+ | psecfmt ppara SECT section
+ | '{' hdrftr '}' { if (FLAG_Footer) ifDTfprintf(SORT,"}%%\n");
+ FLAG_Footer=0; }
+ pzhdrftretfin
+ | ppara SECT section
+ | psecfmt ppara
+ | ppara
+ ; /* REMARQUE: Avant, c'etaient des ppara */
+psecfmt: secfmt
+ | psecfmt secfmt
+ ;
+secfmt: SECT
+ | SECTD
+ | ENDNHERE
+ | BINFSXN num
+ | BINSXN num
+ | DS num
+ | PNSECLVL num
+ | SETUNLOCKED
+ /* Section Break Command Words */
+ | SBKNONE
+ | SBKCOL
+ | SBKPAGE
+ | SBKEVEN
+ | SBKODD
+ /* Columns Command Words */
+ | COLS num
+ | COLSX num
+ | COLNO num
+ | COLSR num
+ | COLW num
+ | LINEBETCOL
+ /* Line Numbering Command Words */
+ | LINEMOD num
+ | LINEX num
+ | LINESTARTS num
+ | LINERESTART
+ | LINEPPAGE
+ | LINECONT
+ /* Page Information Command Words */
+ | PGWSXN num
+ | PGHSXN num
+ | MARGLSXN num
+ | MARGRSXN num
+ | MARGTSXN num
+ | MARGBSXN num
+ | GUTTERSXN num
+ | LNDSCPSXN
+ | TITLEPG
+ | HEADERY num
+ | FOOTERY num
+ /* Page Numbers Command Words */
+ | PGNSTARTS num
+ | PGNCONT
+ | PGNRESTART
+ | PGNX num
+ | PGNY num
+ | PGNDEC
+ | PGNUCRM
+ | PGNLCRM
+ | PGNUCLTR
+ | PGNLCLTR
+ | PGNHN num
+ | PGNGNSH num
+ | PGNHNSP
+ | PGNHNSC
+ | PGNHNSM
+ | PGNHNSN
+ /* Vertical Alignment Command Words */
+ | VERTALT
+ | VERTALB
+ | VERTALC
+ | VERTALJ
+ /* Bidirectional Controls */
+ | RTLSECT
+ | LTRSECT
+ ;
+ /* Definition des proprietes de formatage des sections. POUR L'INSTANT CE CHAMP LA SERA IGNORE. */
+hdrftr: hdrctl ppara
+ | hdrctl ppara '{' hdrftr '}' { if (FLAG_Footer) ifDTfprintf(SORT,"}%%\n");
+ FLAG_Footer=0; }
+ ;
+hdrctl: HEADER
+ | FOOTER { FLAG_Footer=1; ifDTfprintf(SORT,"\\markright{");}
+ | HEADERL
+ | HEADERR
+ | HEADERF
+ | FOOTERL
+ | FOOTERR
+ | FOOTERF
+ ;
+ /* Note: Definissent les entetes et les pieds de pages pour les pages de gauche, droite, toutes les
+ pages, ou simplement la premiere. */
+ppara: para
+ | ppara para
+ ;
+declpara: pzmultdeclpara
+ | declpara pzmultdeclpara
+ ;
+pzmultdeclpara: accopzpn brdrdef pznvpparfmt
+ | accopzpn pznvpparfmt brdrdef
+ | brdrdef pznvpparfmt accopzpn
+ | brdrdef accopzpn pznvpparfmt
+ | pznvpparfmt brdrdef accopzpn
+ | pznvpparfmt accopzpn brdrdef
+ | accopzpn brdrdef
+ | brdrdef accopzpn
+ | accopzpn pznvpparfmt
+ | pznvpparfmt accopzpn
+ | brdrdef pznvpparfmt
+ | pznvpparfmt brdrdef
+ | accopzpn
+ | brdrdef
+ | pznvpparfmt
+ ;
+declbispara: pznvpapoctl pznvtabdef pznvshading
+ | pznvpapoctl pznvtabdef
+ | pznvpapoctl pznvshading
+ | pznvtabdef pznvshading
+ | pznvpapoctl
+ | pznvtabdef
+ | pznvshading
+ ;
+pzmottrowd: TROWD { Num_Max_Col=0; Inter_Col=0; FLAG_NIT=0 ;}
+ ;
+para: pzsubquapara
+ | declpara
+ | pzsubquipara
+ | pzsubpara
+ | declbispara psubdoc pzsubterpara
+ | psubdoc pzsubterpara
+ ;
+pzsubquapara: declbispara pzsubpara
+ /* Il semblerait que d'anciennes versions de RTF aient ommis les TRGAPH (sic) */
+ ;
+pzsubquipara: pzsubquapara
+ | pzsubpara
+ | declbispara psubdoc pzsubterpara
+ | psubdoc pzsubterpara
+ ;
+pzsubpara: psubdoc
+ | pzmottrowd pzsubbispara
+ ;
+pzsubbispara: TRGAPH num { Inter_Col=$2/10; } pzpsubpar
+ | pzpsubpar
+ ;
+pzsubterpara: motcell pcell
+ | ppar motcell pcell
+ ;
+
+pzpsubpar: ptbldef pptbldef ppptbldef zpcelldef pcell /* Avant: row */
+ | pptbldef ppptbldef zpcelldef pcell
+ | ptbldef ppptbldef zpcelldef pcell
+ | ptbldef pptbldef zpcelldef pcell
+ | ppptbldef zpcelldef pcell
+ | pptbldef zpcelldef pcell
+ | ptbldef zpcelldef pcell
+ | zpcelldef pcell
+ ;
+ppar: PAR { if (FLAG_BorderBot) ifDTfprintf(SORT,"\\hline%%\n");
+ FLAG_BorderBot=0;
+ if (!FLAG_Footer && !FLAG_Equation) { ifDTfprintf(SORT,"\n\\par %%\n"); };
+ if (FLAG_LI!=0)
+ ifDTfprintf(SORT,"\n\\leftskip = %d pt ",FLAG_LI);
+ if (FLAG_RI!=0)
+ ifDTfprintf(SORT,"\n\\rightskip = %d pt ",FLAG_RI);
+ if (FLAG_FI!=0)
+ ifDTfprintf(SORT,"\n\\parindent = %d pt \n",FLAG_FI);
+ FLAG_Dollars=0;
+ }
+ para { $$=$3; }
+ ;
+ /* Bullets and Numbering */
+accopzpn: '{' { ifDTfprintf(SORT,"{%%\n");
+ if (FLAG_DebutTeX) ContextActuel=nouvcontext(JUST);
+ }
+ pzpn
+ '}' {
+ if (FLAG_Indice)
+ {
+ FLAG_Indice--;
+ if (FLAG_Equation==-1 && !FLAG_Indice)
+ { FLAG_Equation=0;
+ ifDTfprintf(SORT,"}$%%\n");
+ }
+ else
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ if (FLAG_Exposant)
+ {
+ FLAG_Exposant--;
+ if (FLAG_Equation==-1 && !FLAG_Exposant)
+ { FLAG_Equation=0;
+ ifDTfprintf(SORT,"}$%%\n");
+ }
+ else
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ if (FLAG_Symbol==1) FLAG_Symbol=0;
+ $$="";
+ if (FLAG_DebutTeX) contextback();ifDTfprintf(SORT,"}%%\n");
+ FLAG_Bold=0;
+ FLAG_Italique=0;
+ }
+ ;
+pzpn: ETOILE PNSECLVL num pndesc
+ | ETOILE PNSECLVL num
+ | PNTEXT charr '}' '{' ETOILE PN pnlevel pndesc
+ | PNTEXT charr '}' '{' ETOILE PN pnlevel
+ | psubdoc
+ ;
+
+pnlevel: PNLVL num
+ | PNVLBT
+ | PNLVLBODY
+ | PNLVLCONT
+ ;
+pndesc: pnnstyle
+ | pnchrfmt
+ | pntxtb
+ | pntxta
+ | pnfmt
+ | pnnstyle pndesc
+ | pnchrfmt pndesc
+ | pntxtb pndesc
+ | pntxta pndesc
+ | pnfmt pndesc
+ ;
+pnnstyle: PNCARD
+ | PNDEC
+ | PNUCLTR
+ | PNUCRM
+ | PNLCLTR
+ | PNLCRM
+ | PNORD
+ | PNORDT
+ ;
+pnchrfmt: PNF num
+ | PNFS num
+ | PNCF num
+ | PNB
+ | PNI
+ | PNCAPS
+ | PNSCAPS
+ | pnul
+ | PNSTRIKE
+ | PNF num pnchrfmt
+ | PNFS num pnchrfmt
+ | PNCF num pnchrfmt
+ | PNB pnchrfmt
+ | PNI pnchrfmt
+ | PNCAPS pnchrfmt
+ | PNSCAPS pnchrfmt
+ | pnul pnchrfmt
+ | PNSTRIKE pnchrfmt
+ ;
+pnul: PNUL
+ | PNULD
+ | PNULDB
+ | PNULNONE
+ | PNULW
+ ;
+pnfmt: PNNUMONCE
+ | PNACROSS
+ | PNINDENT num
+ | PNSP num
+ | PNPREV
+ | pnjust
+ | PNSTART num
+ | PNHANG
+ | PNRESTART
+ | PNNUMONCE pnfmt
+ | PNACROSS pnfmt
+ | PNINDENT num pnfmt
+ | PNSP num pnfmt
+ | PNPREV pnfmt
+ | pnjust pnfmt
+ | PNSTART num pnfmt
+ | PNHANG pnfmt
+ | PNRESTART pnfmt
+ ;
+pnjust: PNQC
+ | PNQL
+ | PNQR
+ ;
+pntxtb: '{' PNTXTB pzpcdata '}'
+ ;
+pntxta: '{' PNTXTA pzpcdata '}'
+ ;
+brdrdef: brdrseg brdrk
+ | brdrseg brdrk pbrdr
+ | brdrdef brdrseg brdrk
+ | brdrdef brdrseg brdrk pbrdr
+ ;
+brdrseg: BRDRT { /*ifDTfprintf(SORT,"\\hline %%\n");*/ }
+ | BRDRB { /*FLAG_BorderBot=1;*/ }
+ | BRDRL
+ | BRDRR
+ | BRDRBTW
+ | BRDRBAR
+ | BOX
+ ;
+brdr: brdrk
+ | brdrk pbrdr
+ ;
+pbrdr: BRDRW num
+ | BRSP num
+ | BRDRCF num
+ | pbrdr BRDRW num
+ | pbrdr BRSP num
+ | pbrdr BRDRCF num
+ ;
+brdrk: BRDRS
+ | BRDRTH
+ | BRDRSH
+ | BRDRDB
+ | BRDRDOT
+ | BRDRDASH
+ | BRDRHAIR
+ ;
+psubdoc: SUBDOCUMENT { $$=""; }
+ | pchar { $$=$1; }
+ ;
+pchar: charr { $$=$1; }
+ | pchar charr {
+ $$ = (char * ) malloc (strlen($1) + strlen($2) + 1);
+ strcpy($$,$1);
+ strcat($$,$2);
+
+ }
+ ;
+motrow: ROW {Num_Col_Tabular=0; FLAG_Tableau=0; FLAG_NIT=1;}
+ ;
+pcell: pzsubterpcell
+ | declpara pzsubquapcell
+ | declbispara pzsubterpcell
+ | declbispara
+ ;
+
+pzsubpcell: pzsubbispcell
+ | ppar pzsubbispcell
+ ;
+pzsubbispcell: motcell pcell
+ | pcell
+ ;
+pzsubterpcell: motrow
+ | psubdoc pzsubpcell
+ | motcell pcell /* Pour les cases de tableaux vides... */
+ ;
+pzsubquapcell: pzsubterpcell
+ | declbispara pzsubterpcell
+ | declbispara pcell /* L'etrange format Mac */
+ ;
+motcell: CELL {
+ if (Num_Col_Tabular<Num_Max_Col)
+ {
+ if (FLAG_DebutTeX) endkeepcontext();
+ ifDTfprintf(SORT,"%s{%dpt}",pzIntermDef,
+ Largeur_Cols[Num_Col_Tabular++]);
+ if (FLAG_DebutTeX) showcontext();
+ }
+ else
+ { if (FLAG_DebutTeX) contextback();
+ ifDTfprintf(SORT,"%s",pzEndDef);
+ }
+ }
+ ;
+pznvpparfmt: parfmt
+ | pznvpparfmt parfmt
+ ;
+parfmt: PAR { if (FLAG_BorderBot) ifDTfprintf(SORT,"\\hline%%\n");
+ FLAG_BorderBot=0;
+ if (!FLAG_Footer && !FLAG_Equation) { ifDTfprintf(SORT,"\n\\par %%\n");};
+ FLAG_Dollars=0;
+ if (FLAG_LI!=0)
+ ifDTfprintf(SORT,"\n\\leftskip = %d pt ",FLAG_LI);
+ if (FLAG_RI!=0)
+ ifDTfprintf(SORT,"\n\\rightskip = %d pt ",FLAG_RI);
+ if (FLAG_FI!=0)
+ ifDTfprintf(SORT,"\n\\parindent = %d pt \n",FLAG_FI);
+ }
+ | PARD { if (FLAG_BorderBot) ifDTfprintf(SORT,"\\hline%%\n");
+ FLAG_BorderBot=0;
+ if (FLAG_Center==1)
+ {
+ FLAG_Center=0;
+ ifDTfprintf(SORT,"\n\\end{center}\n");
+ FLAG_Dollars=0;
+ }
+ if (FLAG_FlushLeft==1)
+ {
+ FLAG_FlushLeft=0;
+ ifDTfprintf(SORT,"\n\\end{flushleft}\n");
+ }
+ if (FLAG_FlushRight==1)
+ {
+ FLAG_FlushRight=0;
+ ifDTfprintf(SORT,"\n\\end{flushright}\n");
+ }
+ if (FLAG_LI!=0)
+ ifDTfprintf(SORT,"\n\\leftskip = %d pt ",0);
+ if (FLAG_RI!=0)
+ ifDTfprintf(SORT,"\n\\rightskip = %d pt ",0);
+ if (FLAG_FI!=0)
+ ifDTfprintf(SORT,"\n\\parindent = %d pt\n",0);
+ FLAG_LI=0;
+ FLAG_RI=0;
+ FLAG_FI=0;
+ FLAG_Bold=0;
+ FLAG_Italique=0;
+ if (!FLAG_Footer && !FLAG_Equation) { ifDTfprintf(SORT,"\n\\par %%\n"); };
+ /*if (Num_Col_Tabular!=0) Num_Max_Col=Num_Col_Tabular;
+ Num_Col_Tabular=0;*/
+ ifDTfprintf(SORT,"\\normalsize ");
+ ifDTfprintf(SORT,"\\pzrm ");
+ if (FLAG_LI!=0)
+ {
+ FLAG_LI=0;
+ ifDTfprintf(SORT,"\n\\leftskip = %d pt ",0);
+ }
+ if (FLAG_RI!=0)
+ {
+ FLAG_RI=0;
+ ifDTfprintf(SORT,"\n\\rightskip = %d pt ",0);
+ }
+ if (FLAG_FI!=0)
+ {
+ FLAG_FI=0;
+ ifDTfprintf(SORT,"\n\\parindent = %d pt \n",0);
+ }
+ if (ContextActuel==NULL && FLAG_DebutTeX) ContextActuel=nouvcontext(JUST);
+ if( FLAG_DebutTeX ) ContextActuel->EtatTexte=JUST;
+ }
+ | S num
+ | HYPHPAR
+ | INTBL { if (FLAG_Tableau==0 && Num_Col_Tabular==0 /* && Num_Col_Tabular<Num_Max_Col*/)
+ {
+ ifDTfprintf(SORT,"%s{%dpt}",pzStartDef,
+ Largeur_Cols[0]+Inter_Col);
+ Num_Col_Tabular=1;
+ ContextInitTab=ContextActuel;
+ if (FLAG_DebutTeX) showcontext();
+ }
+ FLAG_Tableau=1;
+ FLAG_NIT=1;
+ }
+ | KEEP
+ | NOWIDCLTPAR
+ | KEEPN
+ | LEVEL num
+ | NOLINE
+ | PAGEBB
+ | SBYS
+ /* Alignment Command Words */
+ | QL { if (FLAG_Center==1)
+ {
+ FLAG_Center=0;
+ ifDTfprintf(SORT,"\n\\end{center}\n");
+ FLAG_Dollars=0;
+ }
+ if (FLAG_FlushRight==1)
+ {
+ FLAG_FlushRight=0;
+ ifDTfprintf(SORT,"\n\\end{flushright}\n");
+ }
+ if (!FLAG_Footer) { ifDTfprintf(SORT,"\n\\begin{flushleft}\n"); };
+
+ if (ContextActuel==NULL && FLAG_DebutTeX ) ContextActuel=nouvcontext(JUST);
+ if( FLAG_DebutTeX ) ContextActuel->EtatTexte=LEFT;
+ if( FLAG_DebutTeX && !FLAG_Footer) FLAG_FlushLeft=1;
+ }
+ | QR { if (FLAG_Center==1)
+ {
+ FLAG_Center=0;
+ ifDTfprintf(SORT,"\n\\end{center}\n");
+ FLAG_Dollars=0;
+ }
+ if (FLAG_FlushLeft==1)
+ {
+ FLAG_FlushLeft=0;
+ ifDTfprintf(SORT,"\n\\end{flushleft}\n");
+ }
+ if (!FLAG_Footer && FLAG_NIT) { ifDTfprintf(SORT,"\n\\begin{flushright}\n"); };
+ if (ContextActuel==NULL && FLAG_DebutTeX) ContextActuel=nouvcontext(JUST);
+ if( FLAG_DebutTeX ) ContextActuel->EtatTexte=RIGHT;
+ if( FLAG_DebutTeX && !FLAG_Footer) FLAG_FlushRight=1;
+ }
+ | QJ { if (FLAG_Center==1)
+ {
+ FLAG_Center=0;
+ ifDTfprintf(SORT,"\n\\end{center}\n");
+ FLAG_Dollars=0;
+ }
+ if (FLAG_FlushLeft==1)
+ {
+ FLAG_FlushLeft=0;
+ ifDTfprintf(SORT,"\n\\end{flushleft}\n");
+ }
+ if (FLAG_FlushRight==1)
+ {
+ FLAG_FlushRight=0;
+ ifDTfprintf(SORT,"\n\\end{flushright}\n");
+ }
+ if (ContextActuel==NULL && FLAG_DebutTeX) ContextActuel=nouvcontext(JUST);
+ if( FLAG_DebutTeX ) ContextActuel->EtatTexte=JUST;
+ }
+ | QC { if (FLAG_FlushLeft==1)
+ {
+ FLAG_FlushLeft=0;
+ ifDTfprintf(SORT,"\n\\end{flushleft}\n");
+ }
+ if (FLAG_FlushRight==1)
+ {
+ FLAG_FlushRight=0;
+ ifDTfprintf(SORT,"\n\\end{flushright}\n");
+ }
+ if (!FLAG_Footer && FLAG_NIT) { ifDTfprintf(SORT,"\n\\begin{center}\n"); }
+ if (FLAG_Footer) { ifDTfprintf(SORT," \\centerline "); };
+ if (ContextActuel==NULL && FLAG_DebutTeX) ContextActuel=nouvcontext(JUST);
+ if( FLAG_DebutTeX && !FLAG_Footer) ContextActuel->EtatTexte=CENTER;
+ if( FLAG_DebutTeX && !FLAG_Footer) FLAG_Center=1;
+ if( FLAG_DebutTeX && !FLAG_Footer) FLAG_Dollars=1;
+ }
+ | FI num { if (FLAG_FlushRight==0 && FLAG_FlushLeft==0 && FLAG_Center==0)
+ {
+ FLAG_FI=(int)($2/20);
+ ifDTfprintf(SORT,"\n\\parindent = %d pt\n",FLAG_FI);
+ }
+ }
+ | LI num { if (FLAG_FlushRight==0 && FLAG_FlushLeft==0 && FLAG_Center==0)
+ {
+ FLAG_LI=(int)($2/20);
+ ifDTfprintf(SORT,"\n\\leftskip = %d pt ",FLAG_LI);
+ }
+ }
+ | RI num { if (FLAG_FlushRight==0 && FLAG_FlushLeft==0 && FLAG_Center==0)
+ {
+ FLAG_RI=(int)($2/20);
+ ifDTfprintf(SORT,"\n\\rightskip = %d pt ",FLAG_RI);
+ }
+ }
+ /* Spacing Command Words */
+ | SB num
+ | SA num
+ | SL num
+ | SLMULT num
+ /* Subdocuments Command Words */
+ | SUBDOCUMENT num
+ /* Bidirectionnal Controls */
+ | RTLPAR
+ | LTRPAR
+ ;
+ /* Definition des proprietes de formatage des paragraphes. Si le mot de commande \pard n'est pas
+ specifie, le paragraphe recupere les proprietes de son precedent. POUR L'INSTANT CE CHAMP LA SERA IGNORE. */
+
+pznvpapoctl: apoctl
+ | apoctl pznvpapoctl
+ ;
+apoctl: framesize
+ | horzpos
+ | vertpos
+ | txtwrap
+ | dropcap
+ | apoctl framesize
+ | apoctl horzpos
+ | apoctl vertpos
+ | apoctl txtwrap
+ | apoctl dropcap
+ ;
+framesize: framesize ABSW num
+ | framesize ABSH num
+ | ABSW num
+ | ABSH num
+ ;
+horzpos: hframe horzpos
+ | hdist horzpos
+ | hframe
+ | hdist
+ ;
+vertpos: vframe vertpos
+ | vdist vertpos
+ | vframe
+ | vdist
+ ;
+txtwrap: NOWRAP txtwrap
+ | DXFRTEXT num txtwrap
+ | DFRMTXTX num txtwrap
+ | DFRMTXTY num txtwrap
+ | NOWRAP
+ | DXFRTEXT num
+ | DFRMTXTX num
+ | DFRMTXTY num
+ ;
+dropcap: DROPCAPLI num dropcap
+ | DROPCAPT num dropcap
+ | DROPCAPLI num
+ | DROPCAPT num
+ ;
+hframe: PHMRG
+ | PHPG
+ | PHCOL
+ ;
+hdist: POSX num
+ | POSNEGX num
+ | POSXC
+ | POSXI
+ | POSXO
+ | POSXL
+ | POSXR
+ ;
+vframe: PVMRG
+ | PVPG
+ | PVPARA
+ ;
+vdist: POSY num
+ | POSNEGY num
+ | POSYT
+ | POSYIL
+ | POSYB
+ | POSYC
+ ;
+
+pznvshading: SHADING num
+ | pat
+ | pshading SHADING num
+ | pshading pat
+ | SHADING num pshading
+ | pat pshading
+ ;
+pshading: CFPAT num
+ | CBPAT num
+ | pshading CFPAT num
+ | pshading CBPAT num
+ ;
+pat: BGHORIZ
+ | BGVERT
+ | BGFDIAG
+ | BGBDIAG
+ | BGCROSS
+ | BGDCROSS
+ | BGDKHORIZ
+ | BGDKVERT
+ | BGDKFDIAG
+ | BGDKBDIAG
+ | BGDKCROSS
+ | BGDKDCROSS
+ ;
+pznvtabdef: tabkind tablead TX num
+ | tabkind tablead TB num
+ | tabkind TX num /* Ajoute a posteriori */
+ | tabkind TB num /* Ajoute a posteriori */
+ | tablead TB num /* Ajoute a posteriori */
+ | tablead TX num /* Ajoute a posteriori */
+ | TX num /* Pour les besoins de la cause... */
+ | pznvtabdef tabkind tablead TX num
+ | pznvtabdef tabkind tablead TB num
+ | pznvtabdef tabkind TX num /* Ajoute a posteriori */
+ | pznvtabdef tabkind TB num /* Ajoute a posteriori */
+ | pznvtabdef tablead TB num /* Ajoute a posteriori */
+ | pznvtabdef tablead TX num /* Ajoute a posteriori */
+ | pznvtabdef TX num /* Pour les besoins de la cause... */
+ ;
+tabkind: TQR
+ | TQC
+ | TQDEC
+ ;
+ /* Note: \tqr : Flush Right Tab
+ Note: \tqc : Centered Tab
+ Note: \tqdes : Decimal Tab */
+tablead: TLDOT
+ | TLHYPH
+ | TLUL
+ | TITH
+ | TLEQ
+ ;
+ /* Note: \tldot : Leader dots
+ Note: \tlhyph : Leader Hyphens
+ Note: \tlul : Leader underline
+ Note: \tith : Leader thick line
+ Note: \tleq :Leader equal sign */
+
+zpcelldef: pcelldef motcellxnum
+ | motcellxnum
+ | pcelldef motcellxnum zpcelldef
+ | motcellxnum zpcelldef
+ ;
+motcellxnum: CELLX num { if (Num_Max_Col==0)
+ Largeur_Cols[Num_Max_Col]=($2/20);
+ if (Num_Max_Col!=0)
+ {
+ cpt=1;
+ Largeur_Cols[Num_Max_Col]=($2/20);
+ while(cpt<=Num_Max_Col)
+ Largeur_Cols[Num_Max_Col]-=Largeur_Cols[Num_Max_Col-(cpt++)];
+ }
+ Num_Max_Col++;}
+ ;
+
+ptbldef: rowjust
+ | rowwrite
+ | ptbldef rowjust
+ | ptbldef rowwrite
+ ;
+pptbldef: TRBRDRT brdr
+ | TRBRDRB brdr
+ | TRBRDRL brdr
+ | TRBRDRR brdr
+ | TRBRDRH brdr
+ | TRBRDRV brdr
+ | TRLEFT num
+ | TRRH num
+ | pptbldef TRBRDRT brdr
+ | pptbldef TRBRDRB brdr
+ | pptbldef TRBRDRL brdr
+ | pptbldef TRBRDRR brdr
+ | pptbldef TRBRDRH brdr
+ | pptbldef TRBRDRV brdr
+ | pptbldef TRLEFT num
+ | pptbldef TRRH num
+ ;
+ppptbldef: TRHDR
+ | TRKEEP
+ | ppptbldef TRHDR
+ | ppptbldef TRKEEP
+ ;
+rowjust: TRQL
+ | TRQR
+ | TRQC
+ ;
+rowwrite: LTRROW
+ | RTLROW
+ ;
+
+pcelldef: CLMGF
+ | CLMGR
+ | CLBRDRT brdr
+ | CLBRDRL brdr
+ | CLBRDRB brdr
+ | CLBRDRR brdr
+ | cellpat pcellshad
+ | pcellshad
+ | CLMGF pcelldef
+ | CLMGR pcelldef
+ | CLBRDRT brdr pcelldef
+ | CLBRDRL brdr pcelldef
+ | CLBRDRB brdr pcelldef
+ | CLBRDRR brdr pcelldef
+ | cellpat pcellshad pcelldef
+ | pcellshad pcelldef
+ ;
+
+pcellshad: CLSHDNG num /* Ou Vide ? Cette ligne n'est pas tres claire dans la Spec. */
+ | CLCFPAT num pcellshad
+ | CLCBPAT num pcellshad
+ | CLCFPAT num
+ | CLCBPAT num
+ | CLSHDNG num pcellshad
+ ;
+cellpat: CLBGHORIZ
+ | CLBGVERT
+ | CLBGFDIAG
+ | CLBGBDIAG
+ | CLBGCROSS
+ | CLBGDCROSS
+ | CLBGDKHOR
+ | CLBGDKVERT
+ | CLBGDKFDIAG
+ | CLBGDKBDIAG
+ | CLBGDKCROSS
+ | CLBGDKRCDCROSS
+ ;
+
+/*............................................................................................
+ TEXTE ET CARACTERES
+ ----------------- */
+
+charr: '{' { ifDTfprintf(SORT,"{%%\n");
+ if (FLAG_DebutTeX) ContextActuel=nouvcontext(JUST);
+ }
+ pzincharr '}'
+ {
+ if (FLAG_Indice)
+ {
+ FLAG_Indice--;
+ if (FLAG_Equation==-1 && !FLAG_Indice)
+ { FLAG_Equation=0;
+ ifDTfprintf(SORT,"}$%%\n");
+ }
+ else
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ if (FLAG_Exposant)
+ {
+ FLAG_Exposant--;
+ if (FLAG_Equation==-1 && !FLAG_Exposant)
+ { FLAG_Equation=0;
+ ifDTfprintf(SORT,"}$%%\n");
+ }
+ else
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ if (FLAG_Symbol==1) FLAG_Symbol=0;
+ $$="";
+ if (FLAG_DebutTeX) contextback();ifDTfprintf(SORT,"}%%\n");
+ FLAG_Bold=0;
+ FLAG_Italique=0;
+ }
+ | psecfmt '{' hdrftr '}' { if (FLAG_Footer) ifDTfprintf(SORT,"}%%\n");
+ FLAG_Footer=0; }
+ pzhdrftretfin
+ | psecfmt ppara SECT section
+ | '{' hdrftr '}' { if (FLAG_Footer) ifDTfprintf(SORT,"}%%\n");
+ FLAG_Footer=0; }
+ pzhdrftretfin
+ | psecfmt ppara
+ /*| atext ; Non traite pour l'instant*/
+ | pchrfmt pdata { if (FLAG_Underline==1)
+ {
+ FLAG_Underline=0;
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ $$=$2;
+ }
+ | pznvpdata { if (FLAG_Underline==1)
+ {
+ FLAG_Underline=0;
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ $$=$1;
+ }
+ | pchrfmt pdata charr { if (FLAG_Underline==1)
+ {
+ FLAG_Underline=0;
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ $$=$2;
+ }
+ | pznvpdata charr { if (FLAG_Underline==1)
+ {
+ FLAG_Underline=0;
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ $$=$1;
+ }
+ | BKMKEND pzpcdata { $$=""; }
+ | BKMKEND pzpcdata charr { $$=""; }
+ | BKMKSTART bkmkcol pzpcdata { $$=""; }
+ | BKMKSTART bkmkcol pzpcdata charr { $$=""; }
+ | BKMKSTART pzpcdata { $$=""; }
+ | BKMKSTART pzpcdata bkmkcol { $$=""; }
+ | BKMKSTART pzpcdata bkmkcol charr { $$=""; }
+ | BKMKSTART pzpcdata charr { $$=""; }
+ | ETOILE BKMKEND pzpcdata { $$=""; }
+ | ETOILE BKMKEND pzpcdata charr { $$=""; }
+ | ETOILE BKMKSTART BKMKPUB PUBAUTO pzpubobject pzpcdata { $$=""; }
+ | ETOILE BKMKSTART BKMKPUB PUBAUTO pzpubobject pzpcdata charr { $$=""; }
+ | ETOILE BKMKSTART BKMKPUB pzpubobject pzpcdata { $$=""; }
+ | ETOILE BKMKSTART BKMKPUB pzpubobject pzpcdata charr { $$=""; }
+ | ETOILE BKMKSTART bkmkcol pzpcdata { $$=""; }
+ | ETOILE BKMKSTART bkmkcol pzpcdata charr { $$=""; }
+ | ETOILE BKMKSTART pzpcdata { $$=""; }
+ | ETOILE BKMKSTART pzpcdata charr { $$=""; }
+ | ETOILE BKMKSTART pzpcdata bkmkcol { $$=""; }
+ | ETOILE BKMKSTART pzpcdata bkmkcol charr { $$=""; }
+ | ETOILE pzmotfootnote pzetfincharr { $$=""; }
+ | pzmotfootnote pzetfincharr { $$=""; }
+ | FIELD fieldinst fieldrslt { $$=""; }
+ | FIELD fieldinst fieldrslt charr { $$=""; }
+ | FIELD fieldmod /*?*/ fieldinst fieldrslt { $$=""; }
+ | FIELD fieldmod /*?*/ fieldinst fieldrslt charr { $$=""; }
+ | OBJECT /*pzobj objdata result */ { $$=""; }
+ | PICT { FLAG_InPict=1; FLAG_WMetafile=0; }
+ endpict
+ | ETOILE ATNID pzpcdata { $$=""; }
+ | ETOILE ATNAUTHOR pzpcdata { $$=""; }
+ | ETOILE ATNTIME time { $$=""; }
+ | CHATN { $$=""; }
+ charr
+ | ETOILE ATNICN pict charr { $$=""; }
+ | ETOILE ANNOTATION '{' ETOILE ATNREF num '}' ppara { $$=""; }
+ | ETOILE DO { $$=""; }
+ | DO { $$=""; }
+ | XE { $$=""; }
+ | TC { $$=""; }
+ ;
+endpict: pzpict datadata charr { $$=""; if (FLAG_WMetafile)
+ ifDTfprintf(SORT,"%%\n\\framebox(%d,%d){}\n",
+ FLAG_PICTLargeur,FLAG_PICTHauteur);
+ else
+ ifDTfprintf(SORT,"%%\n\\framebox(%d,%d){}\n",
+ (int)(FLAG_PICTLargeur*20),
+ (int)(FLAG_PICTHauteur*20));
+ FLAG_PICTHauteur=0;
+ FLAG_PICTLargeur=0;
+ FLAG_InPict=0;
+ FLAG_WMetafile=0;
+ }
+ | pzpict datadata { $$=""; if (FLAG_WMetafile)
+ ifDTfprintf(SORT,"%%\n\\framebox(%d,%d){}\n",
+ FLAG_PICTLargeur,FLAG_PICTHauteur);
+ else
+ ifDTfprintf(SORT,"%%\n\\framebox(%d,%d){}\n",
+ (int)(FLAG_PICTLargeur*20),
+ (int)(FLAG_PICTHauteur*20));
+ FLAG_PICTHauteur=0;
+ FLAG_PICTLargeur=0;
+ FLAG_InPict=0;
+ FLAG_WMetafile=0;
+ }
+ ;
+pzhdrftretfin: ppara SECT section
+ | ppara
+ ;
+pzetfincharr: ppara { /*ifDTfprintf(SORT,"}%%\n");*/ }
+ | ppara { ifDTfprintf(SORT,"}%%\n"); }
+ charr
+ ;
+pzmotfootnote: FOOTNOTE { FLAG_Exposant=0; FLAG_Indice=0;
+ /* fseek(SORT,-strlen("$^{"),1); */
+ ifDTfprintf(SORT,"\\footnote{%%\n"); }
+ ;
+pzincharr: /* Vide: Pour une fois il semblerait bon. */
+ | charr
+ | ppara SECT section
+ | ppara
+ ;
+pchrfmt: chrfmt
+ | chrfmt pchrfmt
+ ;
+pdata: /*data*/ {$$="";} /* Avant: data . Pb avec les specifications */
+ | pdata data { $$ = (char * ) malloc (strlen($1) + strlen($2) + 1);
+ strcpy($$,$1);
+ strcat($$,$2);
+ }
+ ;
+/* La regle suivante s'applique aux champs de donees ne pouvant pas etre vides */
+pznvpdata: data { $$ = (char * ) malloc (strlen($1) + 1);
+ strcpy($$,$1);
+ }
+ | pznvpdata data { $$ = (char * ) malloc (strlen($1) + strlen($2) + 1);
+ strcpy($$,$1);
+ strcat($$,$2);
+ }
+ ;
+data: pzpcdata {
+ $$=$1;
+ if (FLAG_Symbol==0)
+ {
+ printText($1);
+ }
+ if (FLAG_Symbol!=0)
+ { if (FLAG_Equation==0)
+ { ifDTfprintf(SORT,"$");
+ printSymbol($1);
+ ifDTfprintf(SORT,"$");
+ }
+ if (FLAG_Equation!=0) printSymbol($1);
+ }
+ }
+ | pznvnum { $$=""; ifDTfprintf(SORT,"%d",$1); }
+ | spec { $$=""; /*FLAG_Equation=0;*/ }
+ ;
+chrfmt: PLAIN
+ | B num { if ($2==1) { ifDTfprintf(SORT,"\\bf "); FLAG_Bold=1; }
+ if ($2!=1)
+ {
+ if ($2==0) ifDTfprintf(SORT,"\t\t\t ****** Fin de bold \n");
+ if ($2!=0) ifDTfprintf(SORT,"\t\t\t !!!!!! Erreur dans le bold \n");
+ }
+ }
+ | CAPS num
+ | DELETED num
+ | DN num { if (FLAG_DebutTeX)
+ {
+ if (FLAG_Equation==0)
+ {FLAG_Equation=-1;
+ ifDTfprintf(SORT,"$_{");
+ }
+ else
+ { ifDTfprintf(SORT,"_{"); }
+ FLAG_Indice++;
+ }
+ }
+ | SUB
+ | NOSUPERSUB
+ | EXPND num
+ | EXPNDTW num
+ | KERNING num
+ | F num { FonteActuelle=DebLisFontes;
+ while(FonteActuelle!=NULL && FonteActuelle->LF_Fontnum!=$2)
+ FonteActuelle=FonteActuelle->suiv;
+ if (FonteActuelle!=NULL)
+ { if (!strcmp(FonteActuelle->LF_Fontname,"Symbol"))
+ FLAG_Symbol=1;
+ if (strcmp(FonteActuelle->LF_Fontname,"Symbol"))
+ {
+ ifDTfprintf(SORT,"%s",FonteActuelle->LF_TexEquiv);
+ FLAG_Symbol=0;
+ }
+ }
+ else FLAG_Symbol=0;
+
+ if (FLAG_Bold)
+ ifDTfprintf(SORT,"\\bf ");
+ if (FLAG_Italique)
+ ifDTfprintf(SORT,"\\it ");
+ }
+
+ /* On a besoin de faire une mise a jour de l'aspect (Bold, Italique)
+ car le changement de fonte le detruit (justement)*/
+
+ | FS num { if (FLAG_DebutTeX && FLAG_Equation==0) ifDTfprintf(SORT,"%s",EqTeXTaille($2));
+ FonteActuelle=DebLisFontes;
+ while(FonteActuelle!=NULL && FonteActuelle->LF_Fontnum!=$2)
+ FonteActuelle=FonteActuelle->suiv;
+ if (FonteActuelle!=NULL)
+ { if (!strcmp(FonteActuelle->LF_Fontname,"Symbol"))
+ FLAG_Symbol=1;
+ if (strcmp(FonteActuelle->LF_Fontname,"Symbol"))
+ {
+ ifDTfprintf(SORT,"%s",FonteActuelle->LF_TexEquiv);
+ FLAG_Symbol=0;
+ }
+ }
+ else FLAG_Symbol=0;
+ /* On est obliges de repositionner les parametres de la fonte... */
+ if (FLAG_Bold)
+ ifDTfprintf(SORT,"\\bf ");
+ if (FLAG_Italique)
+ ifDTfprintf(SORT,"\\it ");
+ }
+ | I num { if ($2==1) { ifDTfprintf(SORT,"\\it "); FLAG_Italique=1; }
+ else if ($2==0) ifDTfprintf(SORT,"\t\t\t ****** Fin de italique \n");
+ else ifDTfprintf(SORT,"\t\t\t !!!!!! Erreur dans le italique \n");
+ }
+ | OUTL num
+ | REVISED
+ | REVAUTH num
+ | REVDTTM num
+ | SCAPS num
+ | SHAD num
+ | STRIKE num
+ | UL num { if (FLAG_DebutTeX)
+ { if ($2==1)
+ {
+ ifDTfprintf(SORT,"\\underline {");
+ FLAG_Underline=1;
+ }
+ else if ($2==0)
+ {
+ ifDTfprintf(SORT,"\t\t\t ****** Fin de underline \n");
+ FLAG_Underline=0;
+ }
+ else ifDTfprintf(SORT,"\t\t\t !!!!!! Erreur dans le underline \n");
+ }
+ }
+ | ULD num
+ | ULDB num
+ | ULNONE
+ | ULW
+ | UP num { if (FLAG_DebutTeX)
+ {
+ if (FLAG_Equation==0)
+ {FLAG_Equation=-1;
+ ifDTfprintf(SORT,"$^{%%\n");
+ }
+ else
+ { ifDTfprintf(SORT,"^{%%\n"); }
+ FLAG_Exposant++;
+ }
+ }
+ | SUPER
+ | V num
+ | CF num
+ | CB num
+ | RTLCH
+ | LTRCH
+ | CS num
+ | CCHS num
+ | LANG num
+ ;
+ /* Proprietes de formatage du texte */
+atext: 'z' /* Code qui ne sera jamais passe par l'analyseur lexical */
+ /* Vide POUR L'INSTANT CE CHAMP LA SERA IGNORE. */
+ ;
+ /* Proprietes des characteres associes (pour les langues Arabe et Hebreux) */
+spec: CHDATE { ifDTfprintf(SORT,"\\today "); }
+ | CHDPL { ifDTfprintf(SORT,"\\today "); }
+ | CHDPA { ifDTfprintf(SORT,"\\today "); }
+ | CHTIME
+ | CHPGN
+ | SECTNUM
+ | CHFTN
+ | CHATN
+ | CHFTNSEP
+ | CHFTNSEPC
+/* | motcell
+ | motrow*/
+ | PAR { if (FLAG_BorderBot) ifDTfprintf(SORT,"\\hline%%\n");
+ FLAG_BorderBot=0;
+ if (FLAG_Underline==1)
+ {
+ FLAG_Underline=0;
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ if (!FLAG_Footer && !FLAG_Equation) { ifDTfprintf(SORT,"\n\\par "); };
+ if (FLAG_LI!=0)
+ ifDTfprintf(SORT,"\n\\leftskip = %d pt ",FLAG_LI);
+ if (FLAG_RI!=0)
+ ifDTfprintf(SORT,"\n\\rightskip = %d pt ",FLAG_RI);
+ if (FLAG_FI!=0)
+ ifDTfprintf(SORT,"\n\\parindent = %d pt\n",FLAG_FI);
+ FLAG_Dollars=0;
+ }
+ | SECT
+ | PAGE { ifDTfprintf(SORT,"\\newpage ");}
+ | COLUMN
+ | LINE { ifDTfprintf(SORT,"\\newline ");}
+ | SOFTPAGE
+ | SOFTCOL
+ | SOFTLINE
+ | SOFTLHEIGHT num
+ | TAB { ifDTfprintf(SORT,"\n\\hspace{%dpt}", PZ_FD.FDDEFTAB);}
+ | EMDASH { ifDTfprintf(SORT,"--"); }
+ | ENDASH { ifDTfprintf(SORT,"-"); }
+ | EMSPACE { ifDTfprintf(SORT,"\\,\\,"); }
+ | ENSPACE { ifDTfprintf(SORT,"\\, "); }
+ | BULLET { if (FLAG_Equation) ifDTfprintf(SORT,"\\bullet ");
+ if (!FLAG_Equation) ifDTfprintf(SORT,"$\\bullet $"); }
+ | LQUOTE { ifDTfprintf(SORT,"`"); }
+ | RQUOTE { ifDTfprintf(SORT,"'"); }
+ | LDBLQUOTE { ifDTfprintf(SORT,"\""); }
+ | RDBLQUOTE { ifDTfprintf(SORT,"\""); }
+ | PIPE { FLAG_Equation=1; }
+ equation
+ | TILDE { ifDTfprintf(SORT,"\\ "); }
+ | MOINS /* Optional Hyphen: Cesure */
+ | UNDERSCORE /* Nonbreaking Hyphen: Cesure */
+ | DEUXPOINTS /* Sous-Entree dans un index */
+/* | ETOILE /* Nouvelles commandes */
+ | APOSTROPHE /* ' : APOSTROPHE plus valeur hexa */
+ { {
+ unsigned long ullu;
+ ullu=strtol($1,NULL,16);
+ if (FLAG_Symbol) printApostrophe(ullu);
+ if (!FLAG_Symbol)
+ {
+ if (ASCII_TABLE==2 && !FLAG_Equation)
+ ifDTfprintf(SORT,"%s",ASCII_PC[ullu-DEBASCII_PC]);
+ if (ASCII_TABLE==1 && !FLAG_Equation)
+ ifDTfprintf(SORT,"%s",ASCII_MAC[ullu-DEBASCII_MAC]);
+ if (ASCII_TABLE==2 && FLAG_Equation)
+ ifDTfprintf(SORT,"%s",ASCII_PC_MATH[ullu-DEBASCII_PC]);
+ if (ASCII_TABLE==1 && FLAG_Equation)
+ ifDTfprintf(SORT,"%s",ASCII_MAC_MATH[ullu-DEBASCII_MAC]);
+ }
+ }
+ }
+ | LTRMARK
+ | RTLMARK
+ | ZWJ
+ | ZWNJ
+ ;
+ /* Caracteres Speciaux */
+
+picttype: MACPICT
+ | PMMETAFILE num
+ | WMETAFILE { FLAG_WMetafile=1; }
+ num
+ | DIBITMAP num bitmapinfo
+ | WBITMAP num
+ ;
+bitmapinfo: WBMBITSPIXEL num
+ | WBMPLANES num
+ | WBMWIDTHBYTES num
+ | bitmapinfo WBMBITSPIXEL num
+ | bitmapinfo WBMPLANES num
+ | bitmapinfo WBMWIDTHBYTES num
+ ;
+pict: '{' PICT pzpict datadata '}'
+ ;
+pictsize: pzpictsize ppzpictsize pppzpictsize
+ | pzpictsize ppzpictsize
+ | pzpictsize pppzpictsize
+ | pzpictsize
+ ;
+pzpict: brdr
+ | pznvshading
+ | picttype
+ | pictsize
+ | metafileinfo
+ | pzpict brdr
+ | pzpict pznvshading
+ | pzpict picttype
+ | pzpict pictsize
+ | pzpict metafileinfo
+ ;
+pzpictsize: PICW num { FLAG_PICTLargeur=$2/20; }
+ | PICH num { FLAG_PICTHauteur=$2/20; }
+ | pzpictsize PICW num { FLAG_PICTLargeur=$3/20; }
+ | pzpictsize PICH num { FLAG_PICTHauteur=$3/20; }
+ ;
+ppzpictsize: PICWGOAL num { FLAG_PICTLargeur=$2/20; }
+ | PICHGOAL num { FLAG_PICTHauteur=$2/20; }
+ | ppzpictsize PICWGOAL num { FLAG_PICTLargeur=$3/20; }
+ | ppzpictsize PICHGOAL num { FLAG_PICTHauteur=$3/20; }
+ ;
+pppzpictsize: PICSCALEX num
+ | PICSCALEY num
+ | PICSCALED num
+ | PICCROPT num
+ | PICCROPB num
+ | PICCROPR num
+ | PICCROPL num
+ | pppzpictsize PICSCALEX num
+ | pppzpictsize PICSCALEY num
+ | pppzpictsize PICSCALED num
+ | pppzpictsize PICCROPT num
+ | pppzpictsize PICCROPB num
+ | pppzpictsize PICCROPR num
+ | pppzpictsize PICCROPL num
+ ;
+metafileinfo: PICBMP
+ | PICBPP
+ | metafileinfo PICBMP
+ | metafileinfo PICBPP
+ ;
+datadata: BIN BDATA
+ | SDATA
+ | pzpcdata
+ ;
+pzobj: objtype
+ | objmod
+ | objclass
+ | objname
+ | objtime
+ | objsize
+ | rsltmod
+ | pzobj objtype
+ | pzobj objmod
+ | pzobj objclass
+ | pzobj objname
+ | pzobj objtime
+ | pzobj objsize
+ | pzobj rsltmod
+ ;
+objtype: OBJEMB
+ | OBJLINK
+ | OBJAUTLINK
+ | OBJSUB
+ | OBJPUB
+ | ONJICEMB
+ ;
+objmod: LINKSELF
+ | OBJLOCK
+ | OBJUPDATE
+ ;
+objclass: '{' ETOILE OBJCLASS pzpcdata '}'
+ ;
+objname: '{' ETOILE OBJNAME pzpcdata '}'
+ ;
+objtime: '{' ETOILE OBJTIME time '}'
+ ;
+rsltmod: RSLTMERGE
+ | rsltmod RSLTMERGE
+ | rslttype
+ | rsltmod rslttype
+ ;
+rslttype: RSLTRTF
+ | RSLTTXT
+ | RSLTPICT
+ | RSLTBMP
+ ;
+objsize: OBJSETSIZE
+ | OBJALIGN num
+ | OBJTRANSY num
+ | objhw
+ | OBJCROPT num
+ | OBJCROPB num
+ | OBJCROPL num
+ | OBJCROPR num
+ | OBJSCALEY num
+ | OBJSCALEX num
+ | objsize OBJSETSIZE
+ | objsize OBJALIGN num
+ | objsize OBJTRANSY num
+ | objsize objhw
+ | objsize OBJCROPT num
+ | objsize OBJCROPB num
+ | objsize OBJCROPL num
+ | objsize OBJCROPR num
+ | objsize OBJSCALEY num
+ | objsize OBJSCALEX num
+ ;
+objhw: OBJH num
+ | OBJW num
+ | objhw OBJH num
+ | objhw OBJW num
+ ;
+objdata: '{' ETOILE OBJDATA pzobjdata data '}'
+ | '{' ETOILE OBJDATA data '}'
+ ;
+pzobjdata: objalias
+ | objsect
+ | pzobjdata objalias
+ | pzobjdata objsect
+ ;
+objalias: '{' ETOILE OBJALIAS data '}'
+ ;
+objsect: '{' ETOILE OBJSECT data '}'
+ ;
+result: '{' RESULT ppara '}'
+ ;
+pzpubobject: objalias
+ | objsect
+ | pzpubobject objalias
+ | pzpubobject objsect
+ ;
+ /* Objets crees par Microsoft OLE links et Macintosh Edition Manager*/
+do: 'z' /* Code qui ne sera jamais passe par l'analyseur lexical */
+ /* Vide POUR L'INSTANT CE CHAMP LA SERA IGNORE. */
+ ;
+ /* Drawing Objects */
+atrfstart: '{' ETOILE ATRFSTART num '}'
+ | '{' ATRFSTART num '}'
+ ;
+atrfend: '{' ETOILE ATRFEND num '}'
+ | '{' ATRFEND num '}'
+ ;
+annot: atnidauthor '{' ETOILE ATNTIME time '}' CHATN '{' ETOILE ATNICN pict '}'
+ '{' ETOILE ANNOTATION '{' ETOILE ATNREF num '}' ppara '}'
+ | atnidauthor CHATN '{' ETOILE ATNICN pict '}' '{' ETOILE ANNOTATION
+ '{' ETOILE ATNREF num '}' ppara '}'
+ | atnidauthor '{' ETOILE ATNTIME time '}' CHATN '{' ETOILE ANNOTATION
+ '{' ETOILE ATNREF num '}' ppara '}'
+ | atnidauthor CHATN '{' ETOILE ANNOTATION '{' ETOILE ATNREF num '}' ppara '}'
+ ;
+atnidauthor: '{' ETOILE ATNID pzpcdata '}' '{' ETOILE ATNAUTHOR pzpcdata '}'
+ ;
+ /* Annotations */
+fieldmod: FLDDIRTY /* TROUVER UN MOYEN DE GERER LE DIRTY !!!!!! */
+ | FLDEDIT
+ | FLDLOCK
+ | FLDPRIV
+ | FLDDIRTY fieldmod /* TROUVER UN MOYEN DE GERER LE DIRTY !!!!!! */
+ | FLDEDIT fieldmod
+ | FLDLOCK fieldmod
+ | FLDPRIV fieldmod
+ ;
+fieldinst: '{' ETOILE FLDINST pzeqalt '}'
+ ;
+pzeqalt: equation
+ | equation FLDALT
+ | PZPAUTREFIELD pzpcdata
+ ;
+fieldrslt: '{' ETOILE FLDRSLT ppara '}'
+ | '{' FLDRSLT ppara '}' /* Ecart entre la theorie RTF et la pratique :-( */
+ | '{' FLDRSLT '}' /* Ecart entre la theorie RTF et la pratique :-( */
+ ;
+idx: 'z' /* Code qui ne sera jamais passe par l'analyseur lexical */
+ /* Vide POUR L'INSTANT CE CHAMP LA SERA IGNORE. */
+ ;
+ /* Index Entries */
+toc: 'z' /* Code qui ne sera jamais passe par l'analyseur lexical */
+ /* Vide POUR L'INSTANT CE CHAMP LA SERA IGNORE. */
+ ;
+ /* Table Of Contents Entries */
+bkmkcol: BKMKCOLF num
+ | BKMKCOLL num
+ | BKMKCOLF num bkmkcol
+ | BKMKCOLL num bkmkcol
+ ;
+
+ /* Regles de Grammaire pour les formules mathematiques */
+equation: /* Vide */
+ | PZPEQ { FLAG_Equation=1;
+ /*if (FLAG_Dollars==1) ifDTfprintf(SORT,"$$ ");
+ if (FLAG_Dollars!=1) */ifDTfprintf(SORT,"$ ");
+ }
+ pformule PZPENDEQ { FLAG_Equation=0;
+ /*if (FLAG_Dollars==1) ifDTfprintf(SORT," $$");
+ if (FLAG_Dollars!=1) */ifDTfprintf(SORT," $");
+ FLAG_Dollars=0;
+ }
+ ;
+pformule: formule
+ | pformule formule
+ ;
+ppvformule: formule
+ | pzpvpcdata {
+ $$=$1;
+ if (FLAG_Symbol==0)
+ {
+ ifDTfprintf(SORT,"{%%\n\\rm ");
+ printText($1);
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ else
+ {
+ printSymbol($1);
+ }
+ }
+ | ppvformule formule
+ | ppvformule pzpvpcdata
+ {
+ $$=$2;
+ if (FLAG_Symbol==0)
+ {
+ ifDTfprintf(SORT,"{%%\n\\rm ");
+ printText($2);
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ else
+ {
+ printSymbol($2);
+ }
+ }
+ ;
+formule: integrale
+ | racine
+ | fraction
+ | matrix
+ | box
+ | bracket
+ | list
+ | overstrike
+ | suscript
+ | texte
+ ;
+integrale: PZINTEGRALE { FLAG_Integrale=INTINT; }
+ integralesw '('
+ {if (FLAG_Integrale==INTINT)
+ ifDTfprintf(SORT,"\\int_{");
+ if (FLAG_Integrale==INTSUM)
+ ifDTfprintf(SORT,"\\sum_{");
+ if (FLAG_Integrale==INTPROD)
+ ifDTfprintf(SORT,"\\prod_{");
+ }
+ pformule ',' {ifDTfprintf(SORT,"}^{");
+ }
+ pformule ',' {ifDTfprintf(SORT,"}{");
+ }
+ pformule ')' {ifDTfprintf(SORT,"}%%\n");
+ }
+ | PZINTEGRALE { FLAG_Integrale=INTINT; }
+ '(' {if (FLAG_Integrale==INTINT)
+ ifDTfprintf(SORT,"\\int_{");
+ if (FLAG_Integrale==INTSUM)
+ ifDTfprintf(SORT,"\\sum_{");
+ if (FLAG_Integrale==INTPROD)
+ ifDTfprintf(SORT,"\\prod_{");
+ }
+ pformule ',' {ifDTfprintf(SORT,"}^{");
+ }
+ pformule ',' {ifDTfprintf(SORT,"}{");
+ }
+ pformule ')' {ifDTfprintf(SORT,"}%%\n");
+ }
+ ;
+
+racine: PZRACINE '(' {ifDTfprintf(SORT,"\\sqrt[{");
+ }
+ pformule ',' {ifDTfprintf(SORT,"}]{");
+ }
+ pformule ')' {ifDTfprintf(SORT,"}%%\n");
+ }
+ ;
+
+fraction: PZFRACTION '(' {ifDTfprintf(SORT,"\\frac{");
+ }
+ pformule ',' {ifDTfprintf(SORT,"}{");
+ }
+ pformule ')' {ifDTfprintf(SORT,"}%%\n");
+ }
+ ;
+
+matrix: PZMATRIX '(' {ifDTfprintf(SORT,"\\begin{array}{c}\n");
+ FLAG_InMatrix=1;
+ FLAG_MatrixColCour=1;
+ }
+ colones ')' {ifDTfprintf(SORT,"\n\\end{array}\n");
+ FLAG_InMatrix=0;
+ }
+ | PZMATRIX matrixsw '(' {ifDTfprintf(SORT,"\\begin{array}{");
+ for(cpt3=0;cpt3<FLAG_MatrixCols;cpt3++)
+ ifDTfprintf(SORT,"%c",TAB_PosTabMatrix[FLAG_MatrixAlign]);
+ ifDTfprintf(SORT,"}%%\n");
+ FLAG_InMatrix=1;
+ FLAG_MatrixColCour=1;
+ }
+ colones ')' {ifDTfprintf(SORT,"\n\\end{array}\n");
+ FLAG_InMatrix=0;
+ }
+ ;
+box: PZBOX '(' { ifDTfprintf(SORT,"\\fbox{$");
+ }
+ ppvformule ')' { ifDTfprintf(SORT,"$}%%\n");
+ }
+ ;
+bracket: PZBRACKET '(' { ifDTfprintf(SORT,"\\left%c ",FLAG_bracketleft); }
+ ppvformule ')' { ifDTfprintf(SORT,"\\right%c ",FLAG_bracketright);
+ FLAG_bracketleft=BRPoint; FLAG_bracketright=BRPoint; }
+ | PZBRACKET bracketsw '(' { ifDTfprintf(SORT,"\\left%c ",FLAG_bracketleft); }
+ ppvformule ')' { ifDTfprintf(SORT,"\\right%c ",FLAG_bracketright);
+ FLAG_bracketleft=BRPoint; FLAG_bracketright=BRPoint; }
+ | PZBRACKET bracketsw espaces '(' { ifDTfprintf(SORT,"\\left%c ",FLAG_bracketleft); }
+ ppvformule ')' { ifDTfprintf(SORT,"\\right%c ",FLAG_bracketright);
+ FLAG_bracketleft=BRPoint; FLAG_bracketright=BRPoint; }
+ ;
+espaces: ' '
+ | ' '
+ | espaces ' '
+ | espaces ' '
+ ;
+list: PZLIST '('
+ ppvformule ')'
+ ;
+overstrike: PZOVERSTRIKE '('
+ ppvformule ')'
+ | PZOVERSTRIKE overstrikesw '('
+ ppvformule ')'
+ ;
+suscript: PZSUSCRIPT '(' { ifDTfprintf(SORT,"%%\n\\begin{tabular}{l}\n$"); FLAG_SusTab=1;
+ if (FLAG_InMatrix==1) FLAG_InMatrix=-1;
+ }
+ colones ')' { ifDTfprintf(SORT,"$%%\n\\end{tabular}\n"); FLAG_SusTab=0;
+ if (FLAG_InMatrix==-1) FLAG_InMatrix=1;
+ }
+ | PZSUSCRIPT { FLAG_Suscript=0; }
+ suscriptsw '(' {
+ if (FLAG_InMatrix==1) FLAG_InMatrix=-1;
+ if (FLAG_Suscript==EQUP)
+ {ifDTfprintf(SORT,"^{");}
+ else {if (FLAG_Suscript==EQDO)
+ {ifDTfprintf(SORT,"_{");}
+ else {ifDTfprintf(SORT,"{%%\n");}}
+ }
+ colones ')' { ifDTfprintf(SORT,"}%%\n");
+ if (FLAG_InMatrix==-1) FLAG_InMatrix=1;
+ }
+ ;
+bracketsw: EQLC EQCROCHETO { FLAG_bracketleft=BRCrochetO; }
+ | EQLC EQCROCHETF { FLAG_bracketleft=BRCrochetF; }
+ | EQLC EQSUPINFO { FLAG_bracketleft=BRSupInfO; }
+ | EQLC EQSUPINFF { FLAG_bracketleft=BRSupInfF; }
+ | EQLC EQPARENTHO { FLAG_bracketleft=BRParentheseO; }
+ | EQLC EQPARENTHF { FLAG_bracketleft=BRParentheseF; }
+ | EQLC EQACCOLADO { FLAG_bracketleft=BRAccoladeO; }
+ | EQLC EQACCOLADF { FLAG_bracketleft=BRAccoladeF; }
+ | EQRC EQCROCHETO { FLAG_bracketright=BRCrochetO; }
+ | EQRC EQCROCHETF { FLAG_bracketright=BRCrochetF; }
+ | EQRC EQSUPINFO { FLAG_bracketright=BRSupInfO; }
+ | EQRC EQSUPINFF { FLAG_bracketright=BRSupInfF; }
+ | EQRC EQPARENTHO { FLAG_bracketright=BRParentheseO; }
+ | EQRC EQPARENTHF { FLAG_bracketright=BRParentheseF; }
+ | EQRC EQACCOLADO { FLAG_bracketright=BRAccoladeO; }
+ | EQRC EQACCOLADF { FLAG_bracketright=BRAccoladeF; }
+ | EQBC EQCROCHETO { FLAG_bracketright=BRCrochetO; FLAG_bracketleft=BRCrochetO;}
+ | EQBC EQCROCHETF { FLAG_bracketright=BRCrochetF; FLAG_bracketleft=BRCrochetF;}
+ | EQBC EQSUPINFO { FLAG_bracketright=BRSupInfO; FLAG_bracketleft=BRSupInfO;}
+ | EQBC EQSUPINFF { FLAG_bracketright=BRSupInfF; FLAG_bracketleft=BRSupInfF;}
+ | EQBC EQPARENTHO { FLAG_bracketright=BRParentheseO; FLAG_bracketleft=BRParentheseO;}
+ | EQBC EQPARENTHF { FLAG_bracketright=BRParentheseF; FLAG_bracketleft=BRParentheseF;}
+ | EQBC EQACCOLADO { FLAG_bracketright=BRAccoladeO; FLAG_bracketleft=BRAccoladeO;}
+ | EQBC EQACCOLADF { FLAG_bracketright=BRAccoladeF; FLAG_bracketleft=BRAccoladeF;}
+ | bracketsw EQLC EQCROCHETO { FLAG_bracketleft=BRCrochetO; }
+ | bracketsw EQLC EQCROCHETF { FLAG_bracketleft=BRCrochetF; }
+ | bracketsw EQLC EQSUPINFO { FLAG_bracketleft=BRSupInfO; }
+ | bracketsw EQLC EQSUPINFF { FLAG_bracketleft=BRSupInfF; }
+ | bracketsw EQLC EQPARENTHO { FLAG_bracketleft=BRParentheseO; }
+ | bracketsw EQLC EQPARENTHF { FLAG_bracketleft=BRParentheseF; }
+ | bracketsw EQLC EQACCOLADO { FLAG_bracketleft=BRAccoladeO; }
+ | bracketsw EQLC EQACCOLADF { FLAG_bracketleft=BRAccoladeF; }
+ | bracketsw EQRC EQCROCHETO { FLAG_bracketright=BRCrochetO; }
+ | bracketsw EQRC EQCROCHETF { FLAG_bracketright=BRCrochetF; }
+ | bracketsw EQRC EQSUPINFO { FLAG_bracketright=BRSupInfO; }
+ | bracketsw EQRC EQSUPINFF { FLAG_bracketright=BRSupInfF; }
+ | bracketsw EQRC EQPARENTHO { FLAG_bracketright=BRParentheseO; }
+ | bracketsw EQRC EQPARENTHF { FLAG_bracketright=BRParentheseF; }
+ | bracketsw EQRC EQACCOLADO { FLAG_bracketright=BRAccoladeO; }
+ | bracketsw EQRC EQACCOLADF { FLAG_bracketright=BRAccoladeF; }
+ | bracketsw EQBC EQCROCHETO { FLAG_bracketright=BRCrochetO; FLAG_bracketleft=BRCrochetO;}
+ | bracketsw EQBC EQCROCHETF { FLAG_bracketright=BRCrochetF; FLAG_bracketleft=BRCrochetF;}
+ | bracketsw EQBC EQSUPINFO { FLAG_bracketright=BRSupInfO; FLAG_bracketleft=BRSupInfO;}
+ | bracketsw EQBC EQSUPINFF { FLAG_bracketright=BRSupInfF; FLAG_bracketleft=BRSupInfF;}
+ | bracketsw EQBC EQPARENTHO { FLAG_bracketright=BRParentheseO; FLAG_bracketleft=BRParentheseO;}
+ | bracketsw EQBC EQPARENTHF { FLAG_bracketright=BRParentheseF; FLAG_bracketleft=BRParentheseF;}
+ | bracketsw EQBC EQACCOLADO { FLAG_bracketright=BRAccoladeO; FLAG_bracketleft=BRAccoladeO;}
+ | bracketsw EQBC EQACCOLADF { FLAG_bracketright=BRAccoladeF; FLAG_bracketleft=BRAccoladeF;}
+ ;
+
+matrixsw: EQAL { FLAG_MatrixAlign=LEFT; }
+ | EQAC { FLAG_MatrixAlign=CENTER; }
+ | EQAR { FLAG_MatrixAlign=RIGHT; }
+ | EQCO num { FLAG_MatrixCols=$2; }
+ | EQVS num
+ | EQHS num
+ | matrixsw EQAL { FLAG_MatrixAlign=LEFT; }
+ | matrixsw EQAC { FLAG_MatrixAlign=CENTER; }
+ | matrixsw EQAR { FLAG_MatrixAlign=RIGHT; }
+ | matrixsw EQCO num { FLAG_MatrixCols=$3; }
+ | matrixsw EQVS num
+ | matrixsw EQHS num
+ ;
+integralesw: EQSU { FLAG_Integrale=INTSUM; }
+ | EQPR { FLAG_Integrale=INTPROD; }
+ | EQIN
+ | EQFC pzpvpcdata
+ | EQVC pzpvpcdata
+ | EQSU { FLAG_Integrale=INTSUM; }
+ integralesw
+ | EQPR { FLAG_Integrale=INTPROD; }
+ integralesw
+ | EQIN integralesw
+ | EQFC pzpvpcdata integralesw
+ | EQVC pzpvpcdata integralesw
+ ;
+overstrikesw: EQAL
+ | EQAC
+ | EQAR
+ ;
+suscriptsw: EQAI num
+ | EQUP num { FLAG_Suscript=EQUP; }
+ | EQDI num
+ | EQDO num { FLAG_Suscript=EQDO; }
+ ;
+colones: colones ',' ','
+ pformule {
+ if (FLAG_SusTab) ifDTfprintf(SORT,"$\\\\\n$");
+ if (FLAG_InMatrix==1)
+ {
+ if (FLAG_MatrixColCour==FLAG_MatrixCols)
+ {
+ ifDTfprintf(SORT,"\\\\\n");
+ FLAG_MatrixColCour=0;
+ }
+ if (FLAG_MatrixColCour!=FLAG_MatrixCols && FLAG_MatrixCols!=1)
+ ifDTfprintf(SORT," %c ",'&');
+ FLAG_MatrixColCour++;
+ }
+ }
+ | pformule {
+ if (FLAG_InMatrix==1)
+ {
+ if (FLAG_MatrixColCour==FLAG_MatrixCols)
+ {
+ ifDTfprintf(SORT,"\\\\\n");
+ FLAG_MatrixColCour=0;
+ }
+ if (FLAG_MatrixColCour!=FLAG_MatrixCols && FLAG_MatrixCols!=1)
+ ifDTfprintf(SORT," %c ",'&');
+ FLAG_MatrixColCour++;
+ }
+ }
+ | colones ','
+ pformule {
+ if (FLAG_SusTab) ifDTfprintf(SORT,"$\\\\\n$");
+ if (FLAG_InMatrix==1)
+ {
+ if (FLAG_MatrixColCour==FLAG_MatrixCols)
+ {
+ ifDTfprintf(SORT,"\\\\\n");
+ FLAG_MatrixColCour=0;
+ }
+ if (FLAG_MatrixColCour!=FLAG_MatrixCols && FLAG_MatrixCols!=1)
+ ifDTfprintf(SORT," %c ",'&');
+ FLAG_MatrixColCour++;
+ }
+ }
+ ;
+
+texte: /* Vide */
+ | ' ' texte
+ | ' '
+ | '(' ')' { ifDTfprintf(SORT,"()"); }
+ | '(' { ifDTfprintf(SORT,"("); }
+ ppvformule ')' { ifDTfprintf(SORT,")"); }
+ | pznvcharr texte
+ | pznvcharr
+ ;
+/* Les regles suivantes sont necessaires pour eviter des boucles infinies dans le vide */
+etfinpznvcharr: '}'
+ {
+ if (FLAG_Indice)
+ {
+ FLAG_Indice--;
+ if (FLAG_Equation==0 && !FLAG_Indice)
+ ifDTfprintf(SORT,"}$%%\n");
+ else
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ if (FLAG_Exposant)
+ {
+ FLAG_Exposant--;
+ if (FLAG_Equation==0 && !FLAG_Exposant)
+ ifDTfprintf(SORT,"}$%%\n");
+ else
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ if (FLAG_Symbol==1) FLAG_Symbol=0;
+ $$="";
+ if (FLAG_DebutTeX) contextback();ifDTfprintf(SORT,"}%%\n");
+ }
+ | pznvcharr '}'
+ {
+ if (FLAG_Indice)
+ {
+ FLAG_Indice--;
+ if (FLAG_Equation==0 && !FLAG_Indice)
+ ifDTfprintf(SORT,"}$%%\n");
+ else
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ if (FLAG_Exposant)
+ {
+ FLAG_Exposant--;
+ if (FLAG_Equation==0 && !FLAG_Exposant)
+ ifDTfprintf(SORT,"}$%%\n");
+ else
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ if (FLAG_Symbol==1) FLAG_Symbol=0;
+ $$="";
+ if (FLAG_DebutTeX) contextback();ifDTfprintf(SORT,"}%%\n");
+ }
+ ;
+pznvcharr: '{' { ifDTfprintf(SORT,"{%%\n");
+ if (FLAG_DebutTeX) ContextActuel=nouvcontext(JUST);
+ }
+ etfinpznvcharr
+
+ /* | atext ; Non traite pour l'instant*/
+ | pchrfmt pdata { if (FLAG_Underline==1)
+ {
+ FLAG_Underline=0;
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ $$=$2;
+ }
+ | pznvpdata { if (FLAG_Underline==1)
+ {
+ FLAG_Underline=0;
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ $$=$1;
+ }
+ | pchrfmt pdata charr { if (FLAG_Underline==1)
+ {
+ FLAG_Underline=0;
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ $$=$2;
+ }
+ | pznvpdata charr { if (FLAG_Underline==1)
+ {
+ FLAG_Underline=0;
+ ifDTfprintf(SORT,"}%%\n");
+ }
+ $$=$1;
+ }
+ ;
+
+
+
+%%
+#include "rtf.lex.c"
+
+
+
+
+