
#line 30 "toksearc.ch"
/*************************************************************************/
#line 30 "toksearc.ch"
/*                                                                       */
#line 30 "toksearc.ch"
/*        Produced by Metachop version 2.0  -    1989-1995               */
#line 30 "toksearc.ch"
/*     Tree      Meta     Chopper      developped    by                  */
#line 30 "toksearc.ch"
/*                  Eric Lavillonniere                                   */
#line 30 "toksearc.ch"
/*                                                                       */
#line 30 "toksearc.ch"
/*************************************************************************/
#line 30 "toksearc.ch"
#line 30 "toksearc.ch"
#include "token.h"
#line 30 "toksearc.ch"
extern int _retVal[50];
#line 30 "toksearc.ch"
extern PPTREE _storeVal[50],_nextVal;
#line 30 "toksearc.ch"
extern PPTREE stackTree[1024];
#line 30 "toksearc.ch"
extern int ptStackTree;
#line 30 "toksearc.ch"
#define decomp decomp_metalang
#line 30 "toksearc.ch"
#line 30 "toksearc.ch"
#ifndef for_elem
#line 30 "toksearc.ch"
#line 30 "toksearc.ch"
#define for_elem _for_elem
#line 30 "toksearc.ch"
#endif
#ifdef INCONNU
#line 30 "toksearc.ch"
#line 30 "toksearc.ch"
PTREE   for_elem ;
#line 30 "toksearc.ch"
#line 30 "toksearc.ch"
#endif
#include "metalang.h"

RIEN    DEBUT_CPLUSPLUS ;
extern PPTREE   treeToken ;
static PTREE    listLex = (PTREE)0 ;
#line 30 "toksearc.ch"
static int  nbLex = 1 ;

#line 50 "toksearc.ch"
#line 50 "toksearc.ch"
int LexNumber ( PTREE tree )
#line 50 "toksearc.ch"
{
#line 50 "toksearc.ch"
    register PPTREE _inter ;
#line 50 "toksearc.ch"
#line 50 "toksearc.ch"
#line 54 "toksearc.ch"
    PTREE   lexNumb ;
#line 54 "toksearc.ch"
#line 54 "toksearc.ch"
#line 55 "toksearc.ch"
    char    string [10];
#line 55 "toksearc.ch"
#line 57 "toksearc.ch"
    if ( (lexNumb=ListFind(listLex, tree)) ) {
#line 57 "toksearc.ch"
#line 61 "toksearc.ch"
                                                    ((_inter = (PPTREE)lexNumb,1) && 
#line 61 "toksearc.ch"
                                                        ((lexNumb=SonTree(_inter,2)),1) &&
#line 61 "toksearc.ch"
                                                        1);
#line 61 "toksearc.ch"
                                                    ;
#line 61 "toksearc.ch"
#line 62 "toksearc.ch"
                                                    return atoi(Value(lexNumb));
#line 62 "toksearc.ch"
#line 63 "toksearc.ch"
                                                 } else 
#line 63 "toksearc.ch"
    {
#line 63 "toksearc.ch"
#line 66 "toksearc.ch"
        sprintf(string, "%d", nbLex);
#line 66 "toksearc.ch"
#line 67 "toksearc.ch"
        {
#line 67 "toksearc.ch"
            PPTREE _ptTree0= (PPTREE) 0,_ptRes0= (PPTREE) 0;
#line 67 "toksearc.ch"
            _ptRes0 = MakeTree(LIST, 2);
#line 67 "toksearc.ch"
            {
#line 67 "toksearc.ch"
                PPTREE _ptTree1= (PPTREE) 0,_ptRes1= (PPTREE) 0;
#line 67 "toksearc.ch"
                _ptRes1 = MakeTree(LIST, 2);
#line 67 "toksearc.ch"
                _ptTree1 = StoreRef(MakeString(Value(tree)));
#line 67 "toksearc.ch"
                ReplaceTree(_ptRes1, 1, _ptTree1);
#line 67 "toksearc.ch"
                _ptTree1 = StoreRef(MakeString(string));
#line 67 "toksearc.ch"
                ReplaceTree(_ptRes1, 2, _ptTree1);
#line 67 "toksearc.ch"
                _ptTree0 = _ptRes1;
#line 67 "toksearc.ch"
            }
#line 67 "toksearc.ch"
            ReplaceTree(_ptRes0, 1, _ptTree0);
#line 67 "toksearc.ch"
            ReplaceTree(_ptRes0, 2, listLex);
#line 67 "toksearc.ch"
            listLex = _ptRes0;
#line 67 "toksearc.ch"
        }
#line 67 "toksearc.ch"
#line 67 "toksearc.ch"
#line 69 "toksearc.ch"
        return nbLex++ ;
#line 69 "toksearc.ch"
#line 70 "toksearc.ch"
    }
#line 70 "toksearc.ch"
#line 71 "toksearc.ch"
}
#line 71 "toksearc.ch"

#line 75 "toksearc.ch"
#line 75 "toksearc.ch"
void SearchLexToken ( PTREE tree )
#line 75 "toksearc.ch"
{
#line 75 "toksearc.ch"
#line 79 "toksearc.ch"
    PTREE   ptTree = (PTREE)0 ;
#line 79 "toksearc.ch"
#line 79 "toksearc.ch"
#line 80 "toksearc.ch"
    PTREE   lexNumb ;
#line 80 "toksearc.ch"
#line 80 "toksearc.ch"
#line 79 "toksearc.ch"
    (ptTree=tree);
#line 79 "toksearc.ch"
#line 79 "toksearc.ch"
#line 83 "toksearc.ch"
    FreeDescriptList();
#line 83 "toksearc.ch"
#line 84 "toksearc.ch"
    while ( ptTree ) {
#line 84 "toksearc.ch"
#line 85 "toksearc.ch"
                        if ( ptTree && numbertree(SonTree(ptTree, 1)) == LEXDEFINE_metalang ) {
#line 85 "toksearc.ch"
#line 86 "toksearc.ch"
SearchToken(sontree(ptTree, 1), LexNumber(ptTree));
#line 86 "toksearc.ch"
#line 87 "toksearc.ch"
                                                                                                    }
#line 87 "toksearc.ch"
#line 88 "toksearc.ch"
                        (ptTree=sontree(ptTree, 2));
#line 88 "toksearc.ch"
#line 88 "toksearc.ch"
#line 89 "toksearc.ch"
                      }
#line 89 "toksearc.ch"
#line 90 "toksearc.ch"
}
#line 90 "toksearc.ch"

#line 92 "toksearc.ch"
#line 92 "toksearc.ch"
void SearchToken ( PTREE tree, int numb )
#line 92 "toksearc.ch"
{
#line 92 "toksearc.ch"
    register PPTREE _inter ;
#line 92 "toksearc.ch"
#line 92 "toksearc.ch"
#line 97 "toksearc.ch"
    PTREE   val, list ;
#line 97 "toksearc.ch"
#line 97 "toksearc.ch"
#line 98 "toksearc.ch"
    char    *theValue ;
#line 98 "toksearc.ch"
#line 99 "toksearc.ch"
    int i ;
#line 99 "toksearc.ch"
#line 102 "toksearc.ch"
    {
#line 102 "toksearc.ch"
#line 102 "toksearc.ch"
        ItPtree _iterator1 (tree, (PPTREE) 0) ;
#line 102 "toksearc.ch"
#line 102 "toksearc.ch"
        PPTREE  _for_elem ;
#line 102 "toksearc.ch"
#line 102 "toksearc.ch"
        _iterator1.AllSearch(1);
#line 102 "toksearc.ch"
#line 103 "toksearc.ch"
        while ( _for_elem = _iterator1++ ) {
#line 103 "toksearc.ch"
#line 102 "toksearc.ch"
            {
#line 102 "toksearc.ch"
#line 103 "toksearc.ch"
                switch ( NumberTree(for_elem) ) {
#line 103 "toksearc.ch"
#line 104 "toksearc.ch"
                    case metalang::RETURN : 
#line 104 "toksearc.ch"
#line 104 "toksearc.ch"
                        (val=SonTree(for_elem, 1));
#line 104 "toksearc.ch"
#line 104 "toksearc.ch"
#line 104 "toksearc.ch"
                    _Case0 : 
#line 104 "toksearc.ch"
#line 104 "toksearc.ch"
                        ;
#line 104 "toksearc.ch"
#line 105 "toksearc.ch"
                    INSERT_VAL : 
#line 105 "toksearc.ch"
#line 106 "toksearc.ch"
                        switch ( NumberTree(val) ) {
#line 106 "toksearc.ch"
#line 108 "toksearc.ch"
                            case metalang::TOKEN : 
#line 108 "toksearc.ch"
#line 108 "toksearc.ch"
                            _Case4 : 
#line 108 "toksearc.ch"
#line 108 "toksearc.ch"
                                ;
#line 108 "toksearc.ch"
#line 108 "toksearc.ch"
                                theValue = AddKey(BrainyValue(val));
#line 108 "toksearc.ch"
#line 109 "toksearc.ch"
                                i = AddConst(theValue);
#line 109 "toksearc.ch"
#line 110 "toksearc.ch"
                                InsertDescript(i, theValue, numb, sontree(tree, 1));
#line 110 "toksearc.ch"
#line 111 "toksearc.ch"
                                break ;
#line 111 "toksearc.ch"
#line 113 "toksearc.ch"
                            case metalang::EXCLA : 
#line 113 "toksearc.ch"
#line 113 "toksearc.ch"
                            _Case5 : 
#line 113 "toksearc.ch"
#line 113 "toksearc.ch"
                                ;
#line 113 "toksearc.ch"
#line 113 "toksearc.ch"
                                i = AddConst(SymboName(BrainyValue(val), 0));
#line 113 "toksearc.ch"
#line 114 "toksearc.ch"
                                InsertDescript(i, SymboName(BrainyValue(val), 0), numb, sontree(tree, 1));
#line 114 "toksearc.ch"
#line 116 "toksearc.ch"
                                break ;
#line 116 "toksearc.ch"
#line 118 "toksearc.ch"
                            case metalang::STRING : 
#line 118 "toksearc.ch"
#line 118 "toksearc.ch"
                            _Case6 : 
#line 118 "toksearc.ch"
#line 118 "toksearc.ch"
                                ;
#line 118 "toksearc.ch"
#line 118 "toksearc.ch"
                                treeToken = AddToken(BrainyValue(val), SymboName(BrainyValue(val), 0), treeToken);
#line 118 "toksearc.ch"
#line 120 "toksearc.ch"
                                i = AddConst(SymboName(BrainyValue(val), 0));
#line 120 "toksearc.ch"
#line 121 "toksearc.ch"
                                InsertDescript(i, SymboName(BrainyValue(val), 0), numb, sontree(tree, 1));
#line 121 "toksearc.ch"
#line 123 "toksearc.ch"
                                break ;
#line 123 "toksearc.ch"
#line 124 "toksearc.ch"
                            case metalang::FUNC : 
#line 124 "toksearc.ch"
#line 124 "toksearc.ch"
                                (list=SonTree(val, 2));
#line 124 "toksearc.ch"
#line 124 "toksearc.ch"
#line 124 "toksearc.ch"
                            _Case7 : 
#line 124 "toksearc.ch"
#line 124 "toksearc.ch"
                                ;
#line 124 "toksearc.ch"
#line 125 "toksearc.ch"
                                {
#line 125 "toksearc.ch"
#line 126 "toksearc.ch"
                                    if ( !strcmp(BrainyValue(val), "SortKeyWord") || !strcmp(BrainyValue(val), "UpSortKeyWord") ) 
#line 126 "toksearc.ch"
#line 128 "toksearc.ch"
                                        InsertDescript(0, "KeyWord", numb, sontree(tree, 1));
#line 128 "toksearc.ch"
#line 133 "toksearc.ch"
                                    ((_inter = (PPTREE)list,1) && 
#line 133 "toksearc.ch"
                                        ((val=SonTree(_inter,1)),1) &&
#line 133 "toksearc.ch"
                                        1);
#line 133 "toksearc.ch"
                                    ;
#line 133 "toksearc.ch"
#line 138 "toksearc.ch"
                                    if ( ((_inter = (PPTREE)val,1) && 
#line 138 "toksearc.ch"
                                            (NumberTree(_inter) == metalang::IDENT) &&
#line 138 "toksearc.ch"
                                            1) ) {
#line 138 "toksearc.ch"
#line 139 "toksearc.ch"
                                                    InsertDescript(AddConst(BrainyValue(val)), BrainyValue(val), numb, sontree(tree, 1));
#line 139 "toksearc.ch"
#line 141 "toksearc.ch"
                                                 } else 
#line 141 "toksearc.ch"
#line 142 "toksearc.ch"
                                        goto INSERT_VAL ;
#line 142 "toksearc.ch"
#line 142 "toksearc.ch"
#line 143 "toksearc.ch"
                                }
#line 143 "toksearc.ch"
                        }
#line 143 "toksearc.ch"
#line 143 "toksearc.ch"
#line 145 "toksearc.ch"
                        goto for_continue1 ;
#line 145 "toksearc.ch"
#line 146 "toksearc.ch"
                        break ;
#line 146 "toksearc.ch"
#line 148 "toksearc.ch"
                    case metalang::STORE_COMMENT_LINE : 
#line 148 "toksearc.ch"
#line 148 "toksearc.ch"
                    _Case1 : 
#line 148 "toksearc.ch"
#line 148 "toksearc.ch"
                        ;
#line 148 "toksearc.ch"
#line 148 "toksearc.ch"
                        InsertDescript( - 1, "Comment", numb, sontree(tree, 1));
#line 148 "toksearc.ch"
#line 149 "toksearc.ch"
                        break ;
#line 149 "toksearc.ch"
#line 151 "toksearc.ch"
                    case metalang::RECOGNIZE_STRING : 
#line 151 "toksearc.ch"
#line 151 "toksearc.ch"
                    _Case2 : 
#line 151 "toksearc.ch"
#line 151 "toksearc.ch"
                        ;
#line 151 "toksearc.ch"
#line 151 "toksearc.ch"
                        InsertDescript( - 2, "String", numb, sontree(tree, 1));
#line 151 "toksearc.ch"
#line 152 "toksearc.ch"
                        break ;
#line 152 "toksearc.ch"
#line 153 "toksearc.ch"
                    default : 
#line 153 "toksearc.ch"
#line 153 "toksearc.ch"
                    _Case3 : 
#line 153 "toksearc.ch"
#line 153 "toksearc.ch"
                        ;
#line 153 "toksearc.ch"
#line 153 "toksearc.ch"
                        break ;
#line 153 "toksearc.ch"
                }
#line 153 "toksearc.ch"
#line 153 "toksearc.ch"
#line 155 "toksearc.ch"
            }
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
            _iterator1.Current(_for_elem);
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
            continue ;
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
        for_continue1 : 
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
            _iterator1.Current(_for_elem);
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
            _iterator1.SkipSon(1);
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
            continue ;
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
        for_break1 : 
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
            break ;
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
        }
#line 155 "toksearc.ch"
#line 155 "toksearc.ch"
    }
#line 155 "toksearc.ch"
#line 156 "toksearc.ch"
}
#line 156 "toksearc.ch"

RIEN    FIN_CPLUSPLUS ;
#line 156 "toksearc.ch"
/*Well done my boy */ 

