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

#ifndef SUN
#line 24 "chopper.ch"
#line 31 "chopper.ch"
#include <malloc.h>
#line 31 "chopper.ch"
#endif

#include "decmetac.h"
#include <fcntl.h>

DecompMetachop  *DecompMetachop::ptDecomp = 0 ;
DecompChopb *DecompChopb::ptDecomp = 0 ;

extern "C" {
    char    *parseLanguage = (char *)0 ;
    void    ReadIncludeS (char *, int) ;
    
#line 44 "chopper.ch"
#line 44 "chopper.ch"
    PPTREE bri_parse_entry_metachop ( int error_free )
#line 44 "chopper.ch"
    {
#line 44 "chopper.ch"
#line 46 "chopper.ch"
        return metachop().parse_entry(error_free);
#line 46 "chopper.ch"
#line 47 "chopper.ch"
    }
#line 47 "chopper.ch"
    
#line 49 "chopper.ch"
#line 49 "chopper.ch"
    PPTREE bri_parse_entry_chopb ( int error_free )
#line 49 "chopper.ch"
    {
#line 49 "chopper.ch"
#line 53 "chopper.ch"
        return (PPTREE) - 1 ;
#line 53 "chopper.ch"
#line 54 "chopper.ch"
    }
#line 54 "chopper.ch"
    
    extern PPTREE   (*the_parse_entry_pt)(int) ;
    
#line 58 "chopper.ch"
#line 58 "chopper.ch"
    PPTREE parse_metachop ( int error_tree )
#line 58 "chopper.ch"
    {
#line 58 "chopper.ch"
#line 60 "chopper.ch"
        return metachop().prog(error_tree);
#line 60 "chopper.ch"
#line 61 "chopper.ch"
    }
}

int metaQuick = 0 ;
extern int  cplusGen ;
int compiledLine = 0 ;
char    *theFileName = (char *)0 ;

#line 69 "chopper.ch"
#line 69 "chopper.ch"
main ( int argc, char **argv )
#line 69 "chopper.ch"
{
#line 69 "chopper.ch"
#line 71 "chopper.ch"
    PPTREE  tree ;
#line 71 "chopper.ch"
#line 72 "chopper.ch"
    char    name [50];
#line 72 "chopper.ch"
#line 73 "chopper.ch"
    char    *ptName ;
#line 73 "chopper.ch"
#line 74 "chopper.ch"
    DecompMetachop  decomp ;
#line 74 "chopper.ch"
#line 76 "chopper.ch"
    dumpCoord = 1 ;
#line 76 "chopper.ch"
#line 76 "chopper.ch"
    cplusGen = 0 ;
#line 76 "chopper.ch"
#line 77 "chopper.ch"
    DecompMetachop::ptDecomp = &decomp ;
#line 77 "chopper.ch"
#line 78 "chopper.ch"
    DecompChopb::ptDecomp = (DecompChopb *)(&decomp);
#line 78 "chopper.ch"
#line 79 "chopper.ch"
    DecompCplus::ptDecomp = (DecompCplus *)(&decomp);
#line 79 "chopper.ch"
#line 80 "chopper.ch"
    MetaInit();
#line 80 "chopper.ch"
#line 81 "chopper.ch"
    SwitchLang("metachop");
#line 81 "chopper.ch"
#line 82 "chopper.ch"
    ReadIncludeS("c.set", 1);
#line 82 "chopper.ch"
#line 83 "chopper.ch"
    cplusGen = metaQuick = 0 ;
#line 83 "chopper.ch"
#line 84 "chopper.ch"
follow : 
#line 84 "chopper.ch"
#line 85 "chopper.ch"
    if ( !strcmp(*(argv + 1), "-c++") ) {
#line 85 "chopper.ch"
#line 86 "chopper.ch"
                                                cplusGen = 1 ;
#line 86 "chopper.ch"
#line 87 "chopper.ch"
                                                argc-- ;
#line 87 "chopper.ch"
#line 88 "chopper.ch"
                                                argv++ ;
#line 88 "chopper.ch"
#line 89 "chopper.ch"
                                                goto follow ;
#line 89 "chopper.ch"
#line 89 "chopper.ch"
                                               } else 
#line 90 "chopper.ch"
    if ( !strcmp(*(argv + 1), "-f") ) {
#line 90 "chopper.ch"
#line 91 "chopper.ch"
                                                metaQuick = 1 ;
#line 91 "chopper.ch"
#line 92 "chopper.ch"
                                                argc-- ;
#line 92 "chopper.ch"
#line 93 "chopper.ch"
                                                argv++ ;
#line 93 "chopper.ch"
#line 94 "chopper.ch"
                                                goto follow ;
#line 94 "chopper.ch"
#line 94 "chopper.ch"
                                             }
#line 94 "chopper.ch"
#line 96 "chopper.ch"
    if ( argc < 2 ) {
#line 96 "chopper.ch"
#line 97 "chopper.ch"
                        sprintf(name, "Bad name for your source file \n");
#line 97 "chopper.ch"
#line 98 "chopper.ch"
                        write(2, name, strlen(name));
#line 98 "chopper.ch"
#line 99 "chopper.ch"
                        exit(0);
#line 99 "chopper.ch"
#line 99 "chopper.ch"
                      } else 
#line 100 "chopper.ch"
    {
#line 100 "chopper.ch"
#line 101 "chopper.ch"
        theFileName = ptName = *(argv + 1);
#line 101 "chopper.ch"
#line 102 "chopper.ch"
        input = open(ptName, O_RDONLY | O_BINARY);
#line 102 "chopper.ch"
#line 102 "chopper.ch"
    }
#line 102 "chopper.ch"
#line 104 "chopper.ch"
    the_parse_entry_pt = parse_metachop ;
#line 104 "chopper.ch"
#line 105 "chopper.ch"
    tree = ReadInFile(0);
#line 105 "chopper.ch"
#line 106 "chopper.ch"
    AddRef(tree);
#line 106 "chopper.ch"
#line 108 "chopper.ch"
    TrimPosComment(tree);
#line 108 "chopper.ch"
#line 111 "chopper.ch"
    DecompMetachop::ptDecomp -> ChopTree(tree);
#line 111 "chopper.ch"
#line 112 "chopper.ch"
    MetaEnd();
#line 112 "chopper.ch"
#line 113 "chopper.ch"
    if ( !firstError ) 
#line 113 "chopper.ch"
#line 114 "chopper.ch"
        return 1 ;
#line 114 "chopper.ch"
    else 
#line 114 "chopper.ch"
#line 116 "chopper.ch"
        return 0 ;
#line 116 "chopper.ch"
#line 116 "chopper.ch"
#line 117 "chopper.ch"
}
#line 117 "chopper.ch"
/*Well done my boy */ 
#line 117 "chopper.ch"

