-- init_compile_env
[silentbob2.git] / src / kinds.cxx
blob3798ee91ccbd1c6a386ba4d633d168d327e93db3
1 /*
2 * (c) Oleg Puchinin 2007
3 * graycardinalster@gmail.com
4 *
5 */
7 #include <head.h>
8 #include <TT.h>
10 int kindsFile (char * fileName, int type)
12 TT * tt;
13 char * op;
14 int m_type;
16 if (SB_FLGET (SB_FLDEBUG))
17 logToFile (ENV->debug_file, (char *) "kindsFile: %s %d\n", fileName, type);
19 tt = new TT;
20 if (tt->loadFile (fileName) < 0) {
21 delete tt;
22 return -1;
25 if (tt->init () < 0) {
26 delete tt;
27 return -1;
30 while (true) {
31 op = tt->nextOperator ();
32 if (tt->ch == 0)
33 break;
35 if (! SB_FLGET (SB_FLCPP)) {
36 if (tt->bracketDepth)
37 continue;
40 m_type = tt->wit ();
41 if (m_type & type)
42 globalsPrint (tt->tt, tt->op (), m_type);
45 delete tt;
46 return 0;