Package java.io

Examples of java.io.StreamTokenizer.resetSyntax()


    // scientific notation (E or D); however, Double.valueOf does.
    // The strategy here is to disable StreamTokenizer's number parsing.
    // We'll only get whitespace delimited words, EOL's and EOF's.
    // These words should all be numbers, for Double.valueOf to parse.

    tokenizer.resetSyntax();
    tokenizer.wordChars(0,255);
    tokenizer.whitespaceChars(0, ' ');
    tokenizer.eolIsSignificant(true);
    java.util.Vector<Object> v = new java.util.Vector<Object>();
View Full Code Here


    } else {
      Element entries = (Element)v.item(0);
      String contents = entries.getChildNodes().item(0).getNodeValue();
      StringReader sr = new StringReader(contents);
      StreamTokenizer st = new StreamTokenizer(sr);
      st.resetSyntax();
      st.whitespaceChars(0, ' ');
      st.wordChars(' '+1,'\u00FF');
      st.whitespaceChars(' ',' ');
      st.quoteChar('"');
      st.quoteChar('\'');
View Full Code Here

      NodeList i = arrayE.getElementsByTagName("Indices");
      Element indices = (Element)i.item(0);
      contents = indices.getChildNodes().item(0).getNodeValue();
      sr = new StringReader(contents);
      st = new StreamTokenizer(sr);
      st.resetSyntax();
      st.whitespaceChars(0, ' ');
      st.wordChars(' '+1,'\u00FF');
      st.whitespaceChars(' ',' ');
      st.quoteChar('"');
      st.quoteChar('\'');
View Full Code Here

                int ttype = st.nextToken();
                if (ttype == StreamTokenizer.TT_NUMBER) {
                    int numEntries = (int)st.nval;
                    ttype = st.nextToken();
                    if (ttype == StreamTokenizer.TT_EOL) {
                        st.resetSyntax();
                        st.wordChars(32, 127);
                        st.wordChars(128 + 32, 255);
                        st.whitespaceChars(0, 31);

                        for (int i=0; i < numEntries; i++) {
View Full Code Here

    private static void loadCmdFile(String name, ListBuffer<String> args)
        throws IOException
    {
        Reader r = new BufferedReader(new FileReader(name));
        StreamTokenizer st = new StreamTokenizer(r);
        st.resetSyntax();
        st.wordChars(' ', 255);
        st.whitespaceChars(0, ' ');
        st.commentChar('#');
        st.quoteChar('"');
        st.quoteChar('\'');
View Full Code Here

        if (arg0 instanceof String)
        {
            StringReader sr = new StringReader((String) arg0);
            StreamTokenizer st = new StreamTokenizer(sr);
            st.resetSyntax();
            st.whitespaceChars(',', ',');
            st.quoteChar('"');
            st.eolIsSignificant(false);

        
View Full Code Here

            if (sql.indexOf("?") == -1)
                return sql;

            paramOrder.clear();
            StreamTokenizer tok = new StreamTokenizer(new StringReader(sql));
            tok.resetSyntax();
            tok.quoteChar('\'');
            tok.wordChars('0', '9');
            tok.wordChars('?', '?');

            StringBuffer buf = new StringBuffer(sql.length());
View Full Code Here

        if (arg0 instanceof String)
        {
            StringReader sr = new StringReader((String) arg0);
            StreamTokenizer st = new StreamTokenizer(sr);
            st.resetSyntax();
            st.whitespaceChars(',', ',');
            st.quoteChar('"');
            st.eolIsSignificant(false);

        
View Full Code Here

        if (sql.indexOf("?1") == -1)
            return sql;

        List paramOrder = new ArrayList();
        StreamTokenizer tok = new StreamTokenizer(new StringReader(sql));
        tok.resetSyntax();
        tok.quoteChar('\'');
        tok.wordChars('0', '9');
        tok.wordChars('?', '?');

        StringBuffer buf = new StringBuffer(sql.length());
View Full Code Here

  public static Set getClasses(File file) throws IOException {
    Set classes = new HashSet();

    StreamTokenizer st = new StreamTokenizer(
      new BufferedReader(new FileReader(file)));
    st.resetSyntax();
    st.slashSlashComments(true);
    st.slashStarComments(true);
    st.wordChars('a', 'z');
    st.wordChars('A', 'Z');
    st.wordChars('.', '.');
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.