<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    zhyiwww
    用平實的筆,記錄編程路上的點點滴滴………
    posts - 536,comments - 394,trackbacks - 0

    The StreamTokenizer can be used for simple parsing of a Java source file into tokens. The tokenizer can be aware of Java-style comments and ignore them. It is also aware of Java quoting and escaping rules.

    				
    						try {
            // Create the tokenizer to read from a file
            FileReader rd = new FileReader("filename.java");
            StreamTokenizer st = new StreamTokenizer(rd);
        
            // Prepare the tokenizer for Java-style tokenizing rules
            st.parseNumbers();
            st.wordChars('_', '_');
            st.eolIsSignificant(true);
        
            // If whitespace is not to be discarded, make this call
            st.ordinaryChars(0, ' ');
        
            // These calls caused comments to be discarded
            st.slashSlashComments(true);
            st.slashStarComments(true);
        
            // Parse the file
            int token = st.nextToken();
            while (token != StreamTokenizer.TT_EOF) {
                token = st.nextToken();
                switch (token) {
                case StreamTokenizer.TT_NUMBER:
                    // A number was found; the value is in nval
                    double num = st.nval;
                    break;
                case StreamTokenizer.TT_WORD:
                    // A word was found; the value is in sval
                    String word = st.sval;
                    break;
                case '"':
                    // A double-quoted string was found; sval contains the contents
                    String dquoteVal = st.sval;
                    break;
                case '\'':
                    // A single-quoted string was found; sval contains the contents
                    String squoteVal = st.sval;
                    break;
                case StreamTokenizer.TT_EOL:
                    // End of line character found
                    break;
                case StreamTokenizer.TT_EOF:
                    // End of file has been reached
                    break;
                default:
                    // A regular character was found; the value is the token itself
                    char ch = (char)st.ttype;
                    break;
                }
            }
            rd.close();
        } catch (IOException e) {
        }
    
    				
    		


    |----------------------------------------------------------------------------------------|
                               版權(quán)聲明  版權(quán)所有 @zhyiwww
                引用請注明來源 http://www.tkk7.com/zhyiwww   
    |----------------------------------------------------------------------------------------|
    posted on 2006-06-13 12:12 zhyiwww 閱讀(250) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 日韩电影免费在线观看网址| 午夜亚洲福利在线老司机| 一级做a爰片久久毛片免费看| 亚洲伊人久久大香线蕉影院| 亚洲成AV人在线播放无码 | 亚洲精品视频在线免费| 国产aⅴ无码专区亚洲av麻豆| 免费观看的av毛片的网站| 免费看男女下面日出水来| 免费观看成人久久网免费观看| xxxxx做受大片在线观看免费| 亚洲成av人片天堂网无码】| 亚洲制服丝袜一区二区三区| 亚洲精品国产成人99久久| 亚洲精品成人网站在线观看 | 一个人免费观看www视频| 国产99久久亚洲综合精品| 亚洲精品无码aⅴ中文字幕蜜桃| 亚洲国产精品久久网午夜| 久久精品国产亚洲AV无码麻豆| 亚洲av永久无码精品国产精品| 久久精品亚洲男人的天堂| 亚洲人成网站18禁止一区| 亚洲AV无码一区二区三区国产| 免费日本黄色网址| 国产亚洲福利一区二区免费看| 日本19禁啪啪无遮挡免费动图| 最近中文字幕mv免费高清电影 | 亚洲国产精品久久网午夜| 亚洲性无码av在线| 99热亚洲色精品国产88| 久久亚洲精品国产亚洲老地址| 色天使亚洲综合在线观看| 亚洲精品无码专区在线播放| 亚洲av日韩av永久无码电影| 欧美色欧美亚洲另类二区| 在线看亚洲十八禁网站| 国产亚洲精彩视频| 2022国内精品免费福利视频| 99热在线日韩精品免费| 免费国产污网站在线观看15|