Package org.antlr.runtime

Examples of org.antlr.runtime.CharStream.substring()


            /** Invoke lexer rule, and get the current index in CharStream */
            ruleName.invoke(lexObj, new Object[0]);
            Method ruleName2 = lexer.getMethod("getCharIndex", new Class[0]);
            int currentIndex = (Integer) ruleName2.invoke(lexObj, new Object[0]);
            if ( currentIndex!=input.size() ) {
              ps2.println("extra text found, '"+input.substring(currentIndex, input.size()-1)+"'");
            }
     
            this.stdout = null;
      this.stderr = null;
           
View Full Code Here


        /** Invoke lexer rule, and get the current index in CharStream */
        ruleName.invoke(lexObj, new Object[0]);
        Method ruleName2 = lexer.getMethod("getCharIndex", new Class[0]);
        int currentIndex = (Integer) ruleName2.invoke(lexObj, new Object[0]);
        if ( currentIndex!=input.size() ) {
            throw new RuntimeException("extra text found, '"+input.substring(currentIndex, input.size()-1)+"'");
//            System.out.println("extra text found, '"+input.substring(currentIndex, input.size()-1)+"'");
        }
           
        return result;
    }
View Full Code Here

        /** Invoke lexer rule, and get the current index in CharStream */
        ruleName.invoke(lexObj, new Object[0]);
        Method ruleName2 = lexer.getMethod("getCharIndex", new Class[0]);
        int currentIndex = (Integer) ruleName2.invoke(lexObj, new Object[0]);
        if ( currentIndex!=input.size() ) {
            throw new RuntimeException("extra text found, '"+input.substring(currentIndex, input.size()-1)+"'");
//            System.out.println("extra text found, '"+input.substring(currentIndex, input.size()-1)+"'");
        }
           
        return result;
    }
View Full Code Here

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.