Beispiel #1
0
 /** Reinitialise. */
 public void ReInit(miniParserTokenManager tm)
 {
     token_source = tm;
     token = new PsrToken();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 45; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
 }
Beispiel #2
0
 /** Constructor. */
 public miniParser(java.io.Reader stream)
 {
     if (jj_initialized_once)
     {
         // System.out.println("ERROR: Second call to constructor of static parser. ");
         // System.out.println("       You must either use ReInit() or set the JavaCC option STATIC to false");
         // System.out.println("       during parser generation.");
         // throw new Error();
     }
     jj_initialized_once = true;
     jj_input_stream = new SimpleCharStream(stream, 1, 1);
     token_source = new miniParserTokenManager(jj_input_stream);
     token = new PsrToken();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 45; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
 }
Beispiel #3
0
 /** Constructor with generated Token Manager. */
 public miniParser(miniParserTokenManager tm)
 {
     if (jj_initialized_once) {
     System.out.println("ERROR: Second call to constructor of static parser. ");
     System.out.println("       You must either use ReInit() or set the JavaCC option STATIC to false");
     System.out.println("       during parser generation.");
     throw new Error();
     }
     jj_initialized_once = true;
     token_source = tm;
     token = new PsrToken();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 45; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
 }
Beispiel #4
0
        /** Constructor with InputStream and supplied encoding */
        public MiniParser(Stream stream, Encoding encoding)
        {
            if (jj_initialized_once)
            {
                ReInit(stream, encoding);
                // System.out.println("ERROR: Second call to constructor of static parser.  ");
                // System.out.println("       You must either use ReInit() or set the JavaCC option STATIC to false");
                // System.out.println("       during parser generation.");
                // throw new Error();
            }
            else
            {
                jj_initialized_once = true;

                try
                {
                    jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1);
                }
                catch (UnsupportedEncodingException e)
                {
                    throw new RuntimeException(e);
                }
                token_source = new MiniParserTokenManager(jj_input_stream);
            }

            token = new MiniToken();
            jj_ntk = MpRegExpId.UNDEFINED;
            jj_gen = 0;
            for (int i = 0; i < 45; i++) jj_la1[i] = -1;
            for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JJCalls();
        }