Package java.io

Examples of java.io.StreamTokenizer.lineno()


        case StreamTokenizer.TT_WORD:
          String s = stok.sval;
          Constructor<? extends PerfTask> cnstr = taskClass(config,s)
            .asSubclass(PerfTask.class).getConstructor(PerfRunData.class);
          PerfTask task = cnstr.newInstance(runData);
          task.setAlgLineNum(stok.lineno());
          task.setDisableCounting(isDisableCountNextTask);
          isDisableCountNextTask = false;
          currSequence.addTask(task);
          if (task instanceof RepSumByPrefTask) {
            stok.nextToken();
View Full Code Here


        passwordMap = new HashMap<String, byte[]>();
        while (stok.nextToken() != StreamTokenizer.TT_EOF) {
            String name = stok.sval;
            if (stok.nextToken() == StreamTokenizer.TT_EOF) {
                throw new IOException("Unexpected EOL at line " +
                                      stok.lineno());
            }
            byte [] password = decodeBytes(stok.sval.getBytes("UTF-8"));
            passwordMap.put(name, password);
        }
View Full Code Here

          if ( toklen > 0 ) {
        try {
            parseRule(tokens, toklen);
        } catch (RuleParserException ex) {
            String msg = ("Error while parsing rule file, "
              + "line "+st.lineno()+": "
              + ex.getMessage());
            throw new RuleParserException(msg);
        }
        toklen = 0;
          }
View Full Code Here

          if ( toklen > 0 ) {
        try {
            parseRule(tokens, toklen);
        } catch (RuleParserException ex) {
            String msg = ("Error while parsing rule file, "
              + "line "+st.lineno()+": "
              + ex.getMessage());
            throw new RuleParserException(msg);
        }
        toklen = 0;
          }
View Full Code Here

          }
          tokens[toklen++] = st.sval;
          break;
      default:
          throw new RuleParserException("Invalid syntax, line "
                                                    + st.lineno()
                + ".");
    }
      }
  }
  return root;
View Full Code Here

    StreamTokenizer in = new StreamTokenizer(r);
    //just read the first field
    String foundSeries = null;
    int maxTransNum = -1;
    while (in.nextToken() != StreamTokenizer.TT_EOF) {
      workDialog.SetProgress(25 + (in.lineno() * 25 / numRowsInFile));
      switch (in.ttype) {
        case '#':
          in.nextToken();
          if (in.ttype != StreamTokenizer.TT_WORD) {
            getWholeRow(in);
View Full Code Here

          } else {
            if (in.sval.equals("SIETYP")) {
              in.nextToken();
              SIE_typen = getIntFromStream(in);
              if (SIE_typen != 1 && SIE_typen != 2 && SIE_typen != 3 && SIE_typen != 4) {
                throw new ParseException("SIETYP must be 1,2 or 4.  Invalid SIETYP=" + SIE_typen + " row " + in.lineno(), 0);
              }
              getWholeRow(in);
              //clean out to the end of the row
            } else if (in.sval.equals("VER")) {
              if (convertTransNums == CONVERT_TRANS_ALL_NEW) {
View Full Code Here

    BufferedReader r = new BufferedReader(new InputStreamReader
        (new FileInputStream(filename)new Cp437CharSetReplacemet()));
    StreamTokenizer in = new StreamTokenizer(r);
    //just read the first field
    while (in.nextToken() != StreamTokenizer.TT_EOF) {
      workDialog.SetProgress(50 + (in.lineno() * 50 / numRowsInFile));
      switch (in.ttype) {
        case '#':
          in.nextToken();
          if (in.ttype != StreamTokenizer.TT_WORD) {
            resultMessage.append("UNKNOWN character in row=" + in.lineno() + " ;" +
View Full Code Here

      workDialog.SetProgress(50 + (in.lineno() * 50 / numRowsInFile));
      switch (in.ttype) {
        case '#':
          in.nextToken();
          if (in.ttype != StreamTokenizer.TT_WORD) {
            resultMessage.append("UNKNOWN character in row=" + in.lineno() + " ;" +
                in.toString() + " ; " + getWholeRow(in) + "\n");
          } else {
            if (in.sval.equals("FNR")) {
              in.nextToken();
              int testCompId = 0;
View Full Code Here

              if (iCompanyToResoreTo == 0) {
                if (testCompId != 0) {
                  compId = ChangeCompanyNumber(testCompId, compId, resultMessage);
                  globalCompId = compId;
                } else {
                  Log.log(Log.DEBUG, this, "#FNR Cannot use non-number company id, row=" + in.lineno());
                  resultMessage.append("#FNR Cannot use non-number company id, row=" + in.lineno() + "\n");
                }
              } else {
                globalCompId = iCompanyToResoreTo;
                compId = iCompanyToResoreTo;
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.