public String lookingAt ( CharSequence text ) { try { if ( text . length ( ) == 0 ) { if ( acceptEmpty ) { return "" ; } else { throw new SyntaxErrorException ( "empty string not accepted" ) ; } } InputReader reader = Input . getInstance ( text ) ; return lookingAt ( reader ) ; } catch ( IOException ex ) { throw new IllegalArgumentException ( "can't happen" ) ; } }
Matches the start of text and returns the matched string