Package com.grits.Grits

Source Code of com.grits.Grits.Grits

package com.grits.Grits;

import com.grits.griti.GritsParser;
import com.grits.util.GritsException;
import com.grits.util.GritsFile;
import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
*
* @author Davie
*/
public class Grits
{
    static GritsException ge = new GritsException();
    static GritsFile g;
    static GritsParser gp;

    public Grits()
    throws Exception
    {
    }
    public static String getFileName()
    throws Exception
    {
        BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
        log("Enter File Name >> ");
        String fname = "";
        fname = b.readLine();
        return fname;
    }
    public static void main(String[] args)
    {
        try {
                /*if(args[0].equals(null) || args[0].equals(""))
                {
                    ge.throwGrits(0, "Usage: Grits filename.g");
                }
                else*/
                    g = new GritsFile("C:/Grits/test.g");//args[0]);
                    gp = new GritsParser(g);
        }
        catch(ArrayIndexOutOfBoundsException e)
        {
            ge.throwGrits(0, "Usage: Grits filename.g");
        }
        catch(Exception ex) {
            //ge.throwGrits(2, "");
            ex.printStackTrace();
        }
    }
    public static void log(Object o)
    {
        System.out.println(o);
    }
}
TOP

Related Classes of com.grits.Grits.Grits

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.