source: tol/toltcl/generic/toltclInt.h

devel
Last change on this file was 9d2a70c, checked in by Jorge Pérez <josp.jorge@…>, 15 years ago

refs #994, #1404: implementing the command tol::checksyntax

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@4124 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100644
File size: 12.9 KB
Line 
1/* toltclInt.h - Declarations of things used internally by the
2                 toltcl extension.
3                 GNU/tolTcl Library
4
5   Copyright (C) 2001, 2002, 2003 - Bayes Decisión, SL
6
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation; either version 2, or (at your option)
10   any later version.
11
12   This program is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16
17   You should have received a copy of the GNU General Public License
18   along with this program; if not, write to the Free Software
19   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20   USA.
21 */
22
23#ifndef TOLTCLINT_H
24#define TOLTCLINT_H 1
25
26#include <tt_common.h>
27#include <tcl.h>
28
29#ifndef __GNUC__
30#if !defined(strncasecmp)
31#    define strncasecmp _strnicmp
32#endif
33#if !defined(strcasecmp)
34#    define strcasecmp  _stricmp
35#endif
36#if !defined(isinf)
37#    define isinf       !_finite
38#endif
39#endif
40
41BEGIN_C_DECLS
42
43extern Tcl_Interp * TT_interp;
44
45/*! Fill in obj_result the version info corresponding to tol
46 *   {major MajorNum minor MinorNum release ReleaseNum coment Comment}
47 */
48extern int Tol_InfoVersion _ANSI_ARGS_((Tcl_Interp * interp,
49                                        Tcl_Obj * obj_result));
50
51/*! Set the language to be used  by TOL. Fill in obj_result the previous
52 *  language.
53 */
54extern int Tol_SetLanguage _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * lang,
55                                        Tcl_Obj * obj_result));
56
57/*! Return the language used  by TOL. Fill in obj_result the current
58 *  language.
59 */
60extern int Tol_GetLanguage _ANSI_ARGS_((Tcl_Interp * interp,
61                                        Tcl_Obj * obj_result));
62
63
64/*! Check the syntax of a given expresion.
65 */
66extern int Tol_CheckSyntax _ANSI_ARGS_((Tcl_Interp * interp,
67                                        Tcl_Obj * obj_expr,
68                                        Tcl_Obj * obj_result));
69
70/*! Fill in obj_result the result of evaluating including the file
71 *  given as argument: the absolute path.
72 */
73extern int Tol_IncludeFile _ANSI_ARGS_((Tcl_Interp * interp,
74                                        Tcl_Obj * obj_file,
75                                        Tcl_Obj * obj_result));
76
77extern int Tol_DecompileFile _ANSI_ARGS_((Tcl_Interp * interp,
78                                          Tcl_Obj * obj_file,
79                                          Tcl_Obj * obj_result));
80
81extern int Tol_InfoFile _ANSI_ARGS_((Tcl_Interp * interp,
82                                     Tcl_Obj * file,
83                                     Tcl_Obj * obj_result));
84
85/*! Fill in obj_result the result of evaluating in TOL the given
86 *  string.
87 */
88extern int Tol_EvalExpr _ANSI_ARGS_((Tcl_Obj * obj_expr,
89                                     int hidden,
90                                     Tcl_Obj * obj_result));
91
92/*! Fill in obj_result the content of the given tol object's names. The
93 *  object are searched in the console's stack.
94 */
95extern int Tol_ListStack _ANSI_ARGS_((Tcl_Interp * interp,
96                                      int objc,
97                                      Tcl_Obj *CONST objv[],
98                                      Tcl_Obj * obj_result));
99
100/*! Release the given tol object's names. The object are searched in
101 *  the console's stack.
102 */
103extern int Tol_ReleaseStack _ANSI_ARGS_((Tcl_Interp * interp,
104                                         int objc,
105                                         Tcl_Obj *CONST objv[],
106                                         Tcl_Obj * obj_result));
107
108                                         
109/*! Return the fields of a TOL structure.
110 *  { name1 type1 ... namej typej }
111 *  type could be the name of a grammar or {STRUCT struct-name}
112 */
113extern int Tol_GetStructure _ANSI_ARGS_(( Tcl_Interp * interp,
114                                          Tcl_Obj * name, Tcl_Obj * obj_result));
115
116/*! Puts in obj_result the global reference of the given
117 *  syntaxobject. The syntaxobject could be given as set member or as
118 *  global variable. In case of error leave in obj_result the message.
119 *  Returns TCL_OK if succesfull or TCL_ERROR in case of error.
120 */
121int Tol_GetReference(Tcl_Interp *interp, int objc,
122                     Tcl_Obj *CONST objv[], Tcl_Obj * obj_result);
123
124/*
125 * Fill in obj_result the result the string representation of the
126 * address of the object referenced in obj_ref.
127 */
128extern int Tol_GetAddressFromObject _ANSI_ARGS_( (Tcl_Interp * interp,
129                                                 Tcl_Obj * obj_ref,
130                                                 Tcl_Obj * obj_result));
131/*
132 * Fill in obj_result the specific type for an Anything object, could
133 * be: Struct, Class or Anything.
134 */
135extern int Tol_GetAnythingType _ANSI_ARGS_( (Tcl_Interp * interp,
136                                             Tcl_Obj * obj_ref,
137                                             Tcl_Obj * obj_result));
138
139/*! Return the path of a set if it is a file, trigger an error in other case
140 */
141extern int Tol_GetSetPath _ANSI_ARGS_(( Tcl_Interp * interp,
142                                        Tcl_Obj * name, Tcl_Obj * obj_result));
143
144/*! Iterate over a first level's children of a given set.  The set
145 *  could be tolset if the indexes is empty or tolset[i1][i2]...[ik]
146 *  for the given indexes {i1,i2,...,ik}
147 */
148extern int Tol_IterChildren _ANSI_ARGS_((Tcl_Interp * interp,
149                                         int objc,
150                                         Tcl_Obj *CONST objv[],
151                                         Tcl_Obj * obj_result));
152
153/*! Implement a foreach proc similar to the one provided in Tcl except
154 *  that instead of iterating over the list's items it iterates over
155 *  the Set's items. The set could be tolset if the indexes is empty
156 *  or tolset[i1][i2]...[ik] for the given indexes {i1,i2,...,ik}
157 */
158extern int Tol_ForEach _ANSI_ARGS_((Tcl_Interp * interp,
159                                    int objc,
160                                    Tcl_Obj *CONST objv[],
161                                    Tcl_Obj * obj_result));
162
163/*! Fill in obj_result the content of the matrix variable.
164 */
165extern int Tol_GetMatrixContent _ANSI_ARGS_((Tcl_Interp * interp,
166                                             Tcl_Obj * obj_name,
167                                             Tcl_Obj * obj_result));
168
169/*! Fill in obj_result the content of the serie variable.
170 */
171extern int Tol_GetSerieContent _ANSI_ARGS_((Tcl_Interp * interp,
172                                            int objc,
173                                            Tcl_Obj *CONST objv[],
174                                            Tcl_Obj * obj_result));
175
176/*! Create a new command to manipulate a group of series.
177 */
178extern int Tol_CreateSerieGrp _ANSI_ARGS_((Tcl_Interp * interp,
179                                           int objc,
180                                           Tcl_Obj *CONST series[],
181                                           Tcl_Obj * obj_result));
182
183/*! Create a new command to manipulate a group of series.
184 */
185extern int Tol_DestroySerieGrp _ANSI_ARGS_((Tcl_Interp * interp,
186                                           int objc,
187                                           Tcl_Obj *CONST objv[],
188                                           Tcl_Obj * obj_result));
189
190/*! Create a new command to manipulate a group of sets (only one set)
191 */
192extern int Tol_CreateTable _ANSI_ARGS_((Tcl_Interp * interp,
193                                        Tcl_Obj * tblcmd,
194                                        Tcl_Obj * objref,
195                                        int ismat,
196                                        Tcl_Obj * obj_result));
197
198/*! Create a new command to manipulate a group of sets (only one set)
199 */
200extern int Tol_DestroyTable _ANSI_ARGS_((Tcl_Interp * interp,
201                                         int objc,
202                                         Tcl_Obj *CONST objv[],
203                                         Tcl_Obj * obj_result));
204
205/*! Fill in obj_result the list of tol files included
206 */
207extern int Tol_InfoIncluded _ANSI_ARGS_((Tcl_Interp * interp,
208                                         Tcl_Obj * obj_result));
209
210/*! Fill in obj_result the list of grammars defined in TOL
211 */
212extern int Tol_SetGrammarsObj _ANSI_ARGS_((Tcl_Interp * interp,
213                                           Tcl_Obj * obj_result));
214
215/*! Fill in obj_result the list of packages defined in TOL
216 */
217extern int Tol_SetPackagesObj _ANSI_ARGS_((Tcl_Interp * interp,
218                                           Tcl_Obj * obj_result));
219
220/*! Fill in obj_result the description of gra_name.
221 */
222int Tol_SetGrammarDescObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * gra_name,
223                                        Tcl_Obj * obj_result));
224
225/*! Fill in obj_result the description of pkgName.
226 */
227int Tol_SetPackageDescObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj *pkgName,
228                                       Tcl_Obj * obj_result));
229
230/*! Fill in obj_result the functions defined for grammar gra_name.
231 */
232extern int Tol_SetFunctionsObj _ANSI_ARGS_((Tcl_Interp * interp,
233                                            Tcl_Obj * gra_name,
234                                            Tcl_Obj * obj_result));
235
236/*! Fill in obj_result the function's prototype and description
237 *  for a given function in a given grammar.
238 */
239int Tol_SetFunctionInfoObj _ANSI_ARGS_((Tcl_Obj * gra_name,
240                            Tcl_Obj * fun_name,
241                            Tcl_Obj * obj_result));
242/*! Fill in obj_result the variables defined for grammar gra_name.
243 */
244extern
245int Tol_SetVariablesObj _ANSI_ARGS_((Tcl_Interp * interp,
246                                    Tcl_Obj * gra_name,
247                                    Tcl_Obj * obj_result));
248
249/*! Fill in obj_result the variables's description for a given function
250 *  in a given grammar.
251 */
252extern
253int Tol_SetVariableInfoObj _ANSI_ARGS_((Tcl_Obj * gra_name,
254                                       Tcl_Obj * var_name,
255                                       Tcl_Obj * obj_result));
256
257/*! Create a new command to access the given TOL timeset object name.
258 */
259extern
260int Tol_CreateTMSCmd _ANSI_ARGS_((Tcl_Interp * interp,
261                                  Tcl_Obj * tmscmd,
262                                  Tcl_Obj * tmsname,
263                                  Tcl_Obj * obj_result));
264
265/*! Destroy the tcl tms commands given in objv.
266 */
267extern
268int Tol_DestroyTMSCmd _ANSI_ARGS_((Tcl_Interp * interp,
269                                  int objc, Tcl_Obj *CONST objv[],
270                                  Tcl_Obj * obj_result));
271
272/*! Implement tol::date
273 */
274extern
275int Tol_DateOption _ANSI_ARGS_((Tcl_Interp * interp,
276                                int objc, Tcl_Obj *CONST objv[],
277                                Tcl_Obj * obj_result));
278
279/*! Implement tol::autocorr
280 */
281extern
282int Tol_GetAutoCorr _ANSI_ARGS_((Tcl_Interp * interp,
283                                int objc, Tcl_Obj *CONST objv[],
284                                Tcl_Obj * obj_result));
285
286/*! Implement tol::seriestat
287 */
288extern
289int Tol_ComputeSerieStat _ANSI_ARGS_((Tcl_Interp * interp,
290                                  int objc, Tcl_Obj *CONST objv[],
291                                  Tcl_Obj * obj_result));
292extern
293int Tol_StopEvaluation _ANSI_ARGS_(());
294
295extern
296int Tol_LCFormat _ANSI_ARGS_((Tcl_Interp*   interp,
297                              Tcl_Obj*CONST value,
298                              Tcl_Obj*      obj_result));
299extern
300void Tol_InstallHciWriter _ANSI_ARGS_(());
301
302extern
303void Tol_InstallMethodsHook _ANSI_ARGS_(());
304
305END_C_DECLS
306
307//------------------------------------------------------------
308#ifdef __cplusplus
309
310//#define FINDVARIABLE FindVariable
311#define FINDVARIABLE(name) FindOperand(name,true)
312
313class BSyntaxObject;
314class BGrammar;
315class BDate;
316class BList;
317
318extern
319int Tol_CreateSerieGrp _ANSI_ARGS_((Tcl_Interp * interp,
320                                    char * sgrp_name,
321                                    BList * series,
322                                    Tcl_Obj * obj_result));
323
324extern
325int Tol_ParseDate(Tcl_Interp * interp, char * what, BDate & date);
326
327/*!
328 *  Tol_ResolveObject --
329 *
330 *     Resolve a SyntaxObject given a toltcl object reference. A
331 *     reference is {TYPE ?container? i1 i2 ... in} or a global
332 *     container's name of type File|Set|NameBlock|Console. When TYPE
333 *     is Console then container is not given. The grammar of the
334 *     object found is matched to the given argument grammar. If the
335 *     return value is NULL an error message is left in interp.
336 */
337extern
338BSyntaxObject * Tol_ResolveObject(Tcl_Interp *interp,
339                                  Tcl_Obj    *obj_ref,
340                                  Tcl_Obj    *obj_result/*,
341                                                          BGrammar   *grammar=NULL*/);
342
343extern
344int Tol_ListToDate _ANSI_ARGS_(( Tcl_Interp * interp, Tcl_Obj * list,
345                    BDate & date, Tcl_Obj * obj_result ));
346
347extern
348int Tol_DateToList _ANSI_ARGS_(( BDate & date, Tcl_Obj * obj_result ));
349
350#endif /* __cplusplus */
351//------------------------------------------------------------
352
353#endif /* TOLTCLINT_H */
Note: See TracBrowser for help on using the repository browser.