BadgerDB
/afs/cs.wisc.edu/u/n/w/nwilliam/private/workspace/Quut/src/parser/SqlTest.cpp
00001 //
00002 // Author: Jignesh M. Patel
00003 //         EECS Department, University of Michigan
00004 // Date:   August 2000
00005 //
00006 
00013 // #include <stdio.h>
00014 // #include <stdlib.h>
00015 #include <iostream>
00016 
00017 extern FILE* yyin;
00018 extern void parse();
00019 
00020 #include "parser/SqlParser.h"
00021 #include "parser/SqlInterp.h"
00022 #include <string>
00023 
00024 /* 
00025 //
00026 // Evaluate the parse tree
00027 //
00028 void PxxInterp::eval(PxxPnode *ptree)
00029 {
00030    switch(ptree->MyType()) 
00031    {
00032    case PxxPnode::Create:
00033    case PxxPnode::Delete:
00034    case PxxPnode::Insert:
00035    case PxxPnode::Drop:
00036    case PxxPnode::Query:
00037    case PxxPnode::CreateIndex:
00038    case PxxPnode::DropIndex:
00039       {
00040          cout << *ptree << endl;
00041          break;
00042       }
00043       
00044    default:
00045       assert(!"Invalid node type");
00046    }
00047 }
00048 */
00049 
00050 //
00051 // quit the system
00052 //
00053 void PxxInterp::quit(void)
00054 {
00055    cerr << "Quitting Quickstep ... " << endl;
00056    exit(1);
00057 }
00058 
00059 int main(int argc, char** argv)
00060 {
00061    // If the command line contains a file, then read SQL statements 
00062    // from the file, else read input from stdin.
00063    if (argc > 1) 
00064    {
00065       if (!(yyin = fopen (argv[1], "r")))
00066       {
00067          cerr << "Error in opening file: " << argv[1] << endl;
00068          exit (-1);
00069       }
00070    }
00071 
00072    parse();  
00073    return 0;
00074 }
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends