Package nexj.core.util

Examples of nexj.core.util.TextPosition


      assertTrue(new Double(2.3e-4).equals(v[14]));
      assertTrue(new Double(2e-4).equals(v[15]));
      assertTrue(new Float(2e-4f).equals(v[16]));
      assertTrue(new BigDecimal("2e-4").equals(v[17]));
     
      assertEquals(new TextPosition(0, 0), m_posMap.get(v));
      assertEquals(new TextPosition(1, 20), m_posMap.get(v[8]));
      assertEquals(new TextPosition(1, 24), m_posMap.get(v[10]));
      assertEquals(new TextPosition(4, 12), m_posMap.get(
         ((Pair)((Pair)((Pair)v[18]).getNext().getNext().getNext().getHead()).getNext().getHead()).getNext().getHead()));

      Pair p = (Pair)m_parser.parse(new StringReader("((firstName . #t)(lastName . #t)((@) . #t))"), null);

      assertNotNull(p);
View Full Code Here


    */
   public static void setPosURLs(Object expr, String sURL, Lookup posMap)
   {
      while (expr != null)
      {
         TextPosition pos = (TextPosition)posMap.get(expr);

         if (pos != null)
         {
            pos.setURL(sURL);
         }

         if (expr instanceof Pair)
         {
            setPosURLs(((Pair)expr).getHead(), sURL, posMap);
View Full Code Here

            ModelType type = (ModelType)typeItr.next();
            Object code = type.getCode();
            PCodeFunction fun;

            posMap.clear();
            posMap.put(code, new TextPosition(0, 0, "definition:" + type.getGlobalName()));
            fun = compiler.compile(code, posMap, machine, false);
            machine.invoke(fun, (Pair)null);
         }

         for (Iterator intItr = def.getInterfacesIterator(); intItr.hasNext(); )
         {
            Interface iface = (Interface)intItr.next();
            Object code = iface.getCode();
            PCodeFunction fun;

            posMap.clear();
            posMap.put(code, new TextPosition(0, 0, "definition:" + iface.getGlobalName()));
            fun = compiler.compile(code, posMap, machine, false);
            machine.invoke(fun, (Pair)null);
         }

         for (Iterator svcItr = def.getServicesIterator(); svcItr.hasNext(); )
         {
            Service service = (Service)svcItr.next();
            Object code = service.getCode();
            PCodeFunction fun;

            posMap.clear();
            posMap.put(code, new TextPosition(0, 0, "definition:" + service.getGlobalName()));
            fun = compiler.compile(code, posMap, machine, false);
            machine.invoke(fun, (Pair)null);
         }
      }

      for (Iterator implItr = m_implementationMap.valueIterator(); implItr.hasNext(); )
      {
         Implementation impl = (Implementation)implItr.next();
         Object code = impl.getCode();
         PCodeFunction fun;

         posMap.clear();
         posMap.put(code, new TextPosition(0, 0, "implementation:" + impl.getNamePrefix()));

         try
         {
            machine.getGlobalEnvironment().defineVariable(Symbol.SYS_CURRENT_LOGGER,
               Logger.getLogger(SysUtil.NAMESPACE + ".soa." +
View Full Code Here

   /**
    * @return Current token text position.
    */
   protected TextPosition getCurTokenPos()
   {
      return new TextPosition(m_nTokenLine, m_nTokenColumn,
         (m_textPosReader != null) ? m_textPosReader.getTextPosition().getURL() : null);
   }
View Full Code Here

      Flow flow = m_activity.getFlow();
      Lookup posMap = flow.getPosMap();

      if (posMap != null && body != null && !posMap.contains(body))
      {
         posMap.put(body, new TextPosition(0, 0));
      }

      setPosURLs(body);

      return new Compiler().compile(flow.getVariables(),
View Full Code Here

    * @return The internal representation of the element.
    * @throws ParserException if a syntax error has been encountered.
    */
   protected Object parseElement()
   {
      TextPosition pos = null;
      Object obj;

      switch (getCurToken())
      {
         case TOKEN_OPAREN:
View Full Code Here

            Pair.list(Symbol.THIS, VirtualMapping.PROPERTIES),
            (m_script == null) ? new Pair(null) : m_script
         )
      );

      textPosMap.put(code, new TextPosition(0, 0, sURL));

      m_function = new Compiler().compile(code, textPosMap, machine, false);
   }
View Full Code Here

               getReadMappings()
            )
         )
      );

      textPosMap.put(code, new TextPosition(0, 0, sURLPrefix));

      m_function = new Compiler().compile(code, textPosMap, machine, false);
   }
View Full Code Here

    */
   public void setURL(String sURL)
   {
      if (m_textPos == null)
      {
         m_textPos = new TextPosition(0, -1, sURL);
      }
      else
      {
         m_textPos.setURL(sURL);
      }
View Full Code Here

      try
      {
         body = Pair.list(Symbol.LAMBDA, m_allVariables, new Pair(Symbol.VECTOR, body));

         // Set the top level code's URL
         Object pos = new TextPosition(0, 0);
         m_posMap.put(body, pos);
         m_urlMap.put(pos, URL_PREFIX + getName());

         func = compiler.compile(body, m_posMap, m_urlMap, machine, false);
      }
View Full Code Here

TOP

Related Classes of nexj.core.util.TextPosition

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.