Package java.io

Examples of java.io.StreamTokenizer.lineno()


            if ( t.ttype != StreamTokenizer.TT_WORD )
                throw new IOException( t.lineno()+": Word expected after '<'" );
            String crsName = t.sval;
            t.nextToken();
            if ( t.ttype != '>' )
                throw new IOException( t.lineno()+": '>' expected" );
            t.nextToken();
            List v = new ArrayList();

            while ( t.ttype != '<' ) {
                if ( t.ttype == '+' )
View Full Code Here


            while ( t.ttype != '<' ) {
                if ( t.ttype == '+' )
                    t.nextToken();
                if ( t.ttype != StreamTokenizer.TT_WORD )
                    throw new IOException( t.lineno()+": Word expected after '+'" );
                String key = t.sval;
                t.nextToken();
       

                // parse =arg, if any
View Full Code Here

                    addParam(v, key, null);
                }
            }
            t.nextToken();
            if ( t.ttype != '>' )
                throw new IOException( t.lineno()+": '<>' expected" );
            t.nextToken();
     
            // found requested CRS?
            if ( crsName.equals( name ) ) {
                String[] args = (String[]) v.toArray( new String[0] );
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 there was a token, add it to the current list of tokens.
                //  If necessary, also update the current line number, and add the old line to the module location list.
                if (token != null) {
                    int lineNo = st.lineno();
                    lineNoTokenPairList.add(new Pair<Integer, String>(Integer.valueOf(lineNo), token));
                   
                }
            }
           
View Full Code Here

      }
    } catch (RuntimeException e) {
      if (e.getMessage().startsWith("Line #")) {
        throw e;
      } else {
        throw new RuntimeException("Line #" + (stok.lineno() + getAlgLineNum()) + ": ", e);
      }
    } catch (Throwable t) {
      throw new RuntimeException("Line #" + (stok.lineno() + getAlgLineNum()) + ": ", t);
    }
View Full Code Here

        throw e;
      } else {
        throw new RuntimeException("Line #" + (stok.lineno() + getAlgLineNum()) + ": ", e);
      }
    } catch (Throwable t) {
      throw new RuntimeException("Line #" + (stok.lineno() + getAlgLineNum()) + ": ", t);
    }


  }
View Full Code Here

        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

            new GMLParser(graph, defaultEdgeLabel, vertexIdKey, edgeIdKey, edgeLabelKey).parse(st);

            graph.commit();

        } catch (IOException e) {
            throw new IOException("GML malformed line number " + st.lineno() + ": ", e);
        } finally {
            r.close();
        }
    }
}
View Full Code Here

        setUpTokenizer(tokenizer);

        try {
            return readGeometryTaggedText(tokenizer);
        } catch (IOException e) {
            throw new ParseException(e.toString(), tokenizer.lineno());
        }
    }

    /**
     * Sets up a {@link StreamTokenizer} for use in parsing the geometry text.
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.