root/tags/5.4.pre05/cifmt.h

Revision 1, 7.5 kB (checked in by heitor.barbieri, 3 years ago)

Criação do svn para Cisis.

Line 
1/*-------------------------------------------------------------------------*/
2/* CIFMT.h                                                                 */
3/*-------------------------------------------------------------------------*/
4
5#ifndef CIFMT_H
6#define CIFMT_H
7
8#define DATEFUNC 0
9#define DATETIME 999
10#define DATEONLY 998
11
12#define DEB_ATTRIB 0
13#define TYPE_PATTERN 1
14#define TYPE_NUM  0
15#define TY_A    'A' /* tem que ficaR NO CISIS */
16#define TY_X    'X'
17#define TY_N    'N'
18#define NO_MIN_OCC         -1    /* [-NO_MIN_OCC:-NO_MAX_OCC] */
19#define NO_MAX_OCC         -9999   /* Numero maximo de ocorrencias ? */
20#define FMT_OPTIMIZE 0
21#define MAXSTACK      100
22#define PRINT_CODE  0
23#define l_code  FMT_CODE        /* AOT 14/05/93 */
24#define MAX_LITER   500
25#define INCR_LITER   500
26#define NMAXVAR  10   /* Numero maximo de variaveis E e S */ 
27/* fld_def is used to store the possible parameters related to a field */
28
29typedef struct fld_def
30             {
31                int tag;
32                char sub_field;
33                int indent1;
34                int indent2;
35                int offset;
36                int length;
37/* inicio implementacao [x:y] */
38                int lower; /* intervalo [lowocc:uppocc] */
39                int upper;
40                int execlower; /* intervalo [lowocc:uppocc] -execucao */
41                int execupper;
42/* fim  implementacao [x:y] */
43                int max_occ;
44                int actual_occ;
45                int first_occ;
46                int last_occ;
47              } field_definition_node;
48
49typedef  int   endereco;
50
51typedef enum classe_operandos {
52    integer,string,logical,float_n,ptr,l_w,xindex,next_cc,long_n,type_recstru
53} class_operand;
54
55/* Extern */
56#if !CIAPI_SOURCE
57extern LONGX fmt_error;  /* gener'ated */                /* AOT 26/12/91 */
58extern char *inst_cnv[];/* gener'ated */                /* AOT 26/12/91 */
59#endif /* CIAPI_SOURCE */
60/* HB 20080901 - a funcao fmt_float_numb nao converte o numero corretamente se float_x for float
61#if PC */
62#if 1
63#define float_x double
64#else
65#define float_x float
66#define float_x_fmt "%f"
67#endif
68                                  /* Esta dando erro quando define float (?) */
69#define   max_str_num 16 /* Tamanho numero formatado quando omite param */
70
71
72/* Prototypes */
73#if ANSI
74char *fmt_float_numb (float_x valor,int min,int dec,char fill);
75LONGX store_float_const(char *s);
76void fmt_chadd(l_code  *pgmp);
77int num_expr(void);
78#if CICPP
79void  sc(char *p);
80#else /* CICPP */
81void sc(char *p);
82#endif /* CICPP */
83
84#if CICPP
85int fmt_CRLF (char *v,int   pos);
86#else
87int fmt_CRLF (char *v,int   pos);
88#endif /*CICPP*/
89
90#if CICPP
91LONGX lookup(char *keyp,TRMSTRU *trmp,char *dbnp,LONGX nord);
92#else /* CICPP */
93LONGX lookup(char *keyp,LONGX next_inverted_prat,char *dbnp,LONGX nord);
94#endif /* CICPP */
95void out_put_str(char out[],LONGX maxsize,int *pout,LONGX lw,
96                 int id1,int id2,LONGX *ncc,char s[]);
97void print_inter_din(char *fmt,l_code *head);
98void print_inter(char *fmt,l_code *head);
99int spacing_string (void);
100void suffix (void);
101label gen_next_label (void);
102int  separator (void);
103char  *store_res_word(char *str);
104void get_ch (void);
105void erro (int nerr);
106void str_read (char end_ch);
107void getsymbol (void);
108void initialize (void);
109void escrevesym (void);
110void semantic_initialize(void);
111void semantic_error(char *msg);
112void isis_fmt ( void );
113void change_pre_cond_by_u_cond(l_code *first, l_code *last);
114int dummy_id (l_code  *idx,label lab1);
115int  gen(label     lab,
116         instruction_code instr,LONGX  add,l_code *index);
117void print_code(l_code *lista);
118field_definition_node *alloc_field_definition_node (void);
119LONGX store_field_def(int tag,char subfield,
120                     int ind1,int ind2,int off,int len,int low,int upp);
121l_code *alloc_pgm_node (void);
122LONGX store_str_const(char *s);
123
124/*versao6 fim ----------------------------------------------------------*/
125char *sub_field_change(char *q);
126char *translate_instruction( instruction_code i);
127char *find_numeric_string(char v[],int *k);
128
129/*AOT ------------------------------------------------------------------*/
130void out_coreleft (void);
131void boolean_expr (void);
132void boolean_factor (void);
133void boolean_term (void);
134
135void fmt_push_repeat (void);
136void fmt_pop_repeat (void);
137/* void fmt_inicio_grupos_vfields(instruction_code i, instruction_code f); */
138void fmt_fim_grupos_vfields(void);
139
140#else
141char *fmt_float_numb ();
142LONGX store_float_const();
143void fmt_chadd();
144int num_expr();
145LONGX lookup();
146void out_put_str();
147void print_inter_din();
148void print_inter();
149int spacing_string ();
150void suffix ();
151label gen_next_label ();
152int  separator ();
153char  *store_res_word();
154void get_ch ();
155void erro ();
156void str_read ();
157void getsymbol ();
158void initialize ();
159void escrevesym ();
160void semantic_initialize();
161void semantic_error();
162void isis_fmt ();
163void change_pre_cond_by_u_cond();
164int dummy_id ();
165int gen();
166void print_code();
167field_definition_node *alloc_field_definition_node ();
168LONGX store_field_def();
169l_code *alloc_pgm_node ();
170LONGX store_str_const();
171
172/*versao6 fim ----------------------------------------------------------*/
173char *sub_field_change();
174char *translate_instruction();
175char *find_numeric_string();
176
177/*AOT ------------------------------------------------------------------*/
178void out_coreleft ();
179void boolean_expr ();
180void boolean_factor ();
181void boolean_term ();
182
183void fmt_push_repeat ();
184void fmt_pop_repeat ();
185/* void fmt_inicio_grupos_vfields(); */
186void fmt_fim_grupos_vfields();
187
188#endif
189
190
191
192/*-------------------------- Defines ---------------------------------------*/
193#define null_char               '\0'
194#define multiply_char           '*'
195#define nulo                    NULL                    /* AOT 06/04/92 */
196#define subfield_null           ' '
197#define cr                      '\r'
198#define lf                      '\n'
199#define true                    1
200#define false                   0
201#define greater_char            '>'
202#define less_char               '<'
203#define equal_char              '='
204#define space_char              ' '
205#define LASTVAL                 -2
206
207/*----------------- Defines  retirados de cifm[2,3].c-----------------------*/
208
209
210/*--------------------------------------------------------------------------*/
211/*                   crlf                                                   */
212/*--------------------------------------------------------------------------*/
213#if 0
214#if UNIX | WWWISIS
215#define  crlf(v,i)      ((v[i-1]==lf)?true:false)
216#define  LEN_crlf       1 /* 04-02-95 Para delete_chars funcionar */
217#else
218#define  crlf(v,i)      ((v[i-2]==cr && v[i-1]==lf)?true:false)
219#define  LEN_crlf       2 /* 04-02-95 Para delete_chars funcionar */
220#endif
221#endif
222/*--------------------------------------------------------------------------*/
223/*            Macro  is_upper_mode                                          */
224/*--------------------------------------------------------------------------*/
225
226#define is_upper_mode(i)  (i==mpu_par || i==mdu_par || i==mhu_par)
227
228/*--------------------------------------------------------------------------*/
229/*                   new_line                                               */
230/*--------------------------------------------------------------------------*/
231#if 0
232 #if UNIX
233  #define  new_line(v,i)  {v[i++]=lf;v[i]=null_char;}
234 #else
235  #define  new_line(v,i)  {v[i++]=cr;v[i++]=lf;v[i]=null_char;}
236 #endif
237#endif
238 
239#if !CICPP
240#define new_line(v,i,max) { if (i + nl_LEN < max ){  \
241   strcat(v,nl_STR);                           \
242   i=i+nl_LEN;                                 \
243  }else {if (fmttrace)printf(" No room for text - truncating");} \
244;}
245#endif /* CICPP */
246
247#endif  /* CIFMT_H */ 
Note: See TracBrowser for help on using the browser.