Package nexj.core.util

Examples of nexj.core.util.TextPositionReader


    * @param sExpr The string to parse.
    * @return The parse tree.
    */
   protected Object parse(String sExpr, Lookup posMap)
   {
      Reader reader = new TextPositionReader(new StringReader(sExpr), "eval");
      Object expr;

      expr = m_parser.parse(reader, posMap);

      if (expr == Parser.EOF)
View Full Code Here


      m_parser = null;
   }

   public void testParse()
   {
      Object[] v = (Object[])m_parser.parse(new TextPositionReader(new StringReader(
         "#(1 1.3 -1.23 5.456N 0xabL;hehe\n" +
         " #b10100101 #o377 a 'a'b'c #\\J\r\n" +
         "\"abcdef\\u0041\"123456789012\r" +
         "2.3e-4 2e-4 2e-4f 2e-4n\n" +
         "(if a b (c '(e . f-1-2-3=t) #(1 2)))" +
View Full Code Here

      List errList = new ArrayList();

      m_parser.setErrorList(errList);
      m_parser.setCommenting(true);

      Pair pair = (Pair)m_parser.parse(new TextPositionReader(new StringReader(
         "  ; Comment 1\n\r\n\r\r      ;;  Comment 2\r;Comment 3\n" +
         "  (define (map fun lst) (a . b c) (#grr)"
         )), m_posMap);

      assertEquals(" Comment 2 Comment 3\n", m_parser.getComment());
View Full Code Here

      buffer.append("(define (m a b) (- a b))");
      buffer.append(sLineSep);

      m_parser.setCommenting(true);

      Reader reader = new TextPositionReader(new StringReader(buffer.substring(0)));
      String sComment;

      assertNotNull(m_parser.parse(reader, m_posMap));
      sComment = m_parser.getComment();
      assertEquals("b c\n", sComment);
View Full Code Here

      b.append("(define (m a b) (- a b))");
      b.append(sLineSep);
     
      m_parser.setCommenting(true);

      assertNotNull(m_parser.parse(new TextPositionReader(new StringReader(b.substring(0))), m_posMap));
      assertEquals("@example\nline1\nline2\n", m_parser.getComment());
   }
View Full Code Here

      if (!reader.markSupported())
      {
         reader = new BufferedReader(reader);
      }

      reader = new TextPositionReader(reader, (sURL == null) ? "<reader>" : sURL);

      try
      {
         env.setTextPositionMap(posMap);
View Full Code Here

    */
   public Object deserialize(Reader reader) throws IOException, UnmarshallerException
   {
      m_objectMap = new HashTab2D();

      return parse(new TextPositionReader(reader), null);
   }
View Full Code Here

      {
         return null;
      }

      SchemeParser parser = new SchemeParser(machine.getGlobalEnvironment());
      Reader reader = new TextPositionReader(new StringReader(sQueueName));
      Object expr = parser.parse(reader, activity.getFlow().getPosMap());

      if (expr instanceof Symbol && activity.getFlow().findVariable(((Symbol)expr).getName()) == null)
      {
         return sQueueName;
View Full Code Here

      if (sText == null)
      {
         return eof;
      }

      Reader reader = new TextPositionReader(new StringReader(sText), sURL);
      Pair first = null;
      Pair last = null;
      Object expr;

      if (m_parser == null)
View Full Code Here

TOP

Related Classes of nexj.core.util.TextPositionReader

Copyright © 2018 www.massapicom. 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.