Package nexj.core.util

Examples of nexj.core.util.TextPosition


    * @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())
      {
         // must start with an open brace, open array, or primitive
View Full Code Here


         try
         {
            if (sName != null && posMap != null && posMap.size() != 0)
            {
               TextPosition pos = (TextPosition)posMap.valueIterator().next();
               StringBuilder buf = new StringBuilder(64);
               String sURL = pos.getURL();

               if (sURL != null)
               {
                  int i = sURL.indexOf('#');
View Full Code Here

      {
         value = parse(new StringReader(sExpression), null);
      }
      catch (RuntimeException e) // common parent of NumberFormatException & ParserException
      {
         TextPosition pos = (e instanceof TextPositionHolder) ? ((TextPositionHolder)e).getTextPosition() : getCurTokenPos();

         throw new ParserException("err.scripting.invalidMatchExpression", new Object[]
         {
            sExpression
         }, e, pos);
View Full Code Here

    *           position.
    * @throws ParserException
    */
   protected final void fail(boolean bToken) throws ParserException
   {
      TextPosition pos = (bToken) ? null : getCurTextPosition();

      if (pos == null)
      {
         // Never returns null.
         pos = getCurTokenPos();
View Full Code Here

    */
   protected PCodeFunction compile(Object code, String sName, Machine machine)
   {
      try
      {
         m_posMap.put(code, new TextPosition(0, 0, URL_PREFIX + m_sName));
         machine.getGlobalEnvironment().defineVariable(Symbol.SYS_CURRENT_LOGGER, m_logger);

         return new Compiler().compile(code, m_posMap, machine, false);
      }
      catch (CompilerException e)
View Full Code Here

            {
               Object expr = new Pair(Symbol.LAMBDA, new Pair(new Pair(Symbol.THIS), new Pair(m_validation)));

               if (m_textPosMap != null)
               {
                  TextPosition pos = new TextPosition(0,0);

                  m_textPosMap.put(expr, pos);
                  urlMap.put(pos, "class:" + getName() + "$validation");
               }
View Full Code Here

         try
         {
            // Invoke the sys:generate-event macro that generates the ECA code and compile the result
            Pair code = (Pair)machine.invoke((Function)machine.getGlobalEnvironment().getVariable(Symbol.SYS_GENERATE_EVENT), args);
            TextPosition pos = new TextPosition(0, 0);

            posMap.put(code, pos);
            urlMap.put(pos, sEventURL);

            for (Pair pair = code; pair != null; pair = pair.getNext())
            {
               if (pair.getHead() instanceof Pair && !posMap.contains(pair.getHead()))
               {
                  pos = new TextPosition(0, 0);
                  posMap.put(pair.getHead(), pos);
                  urlMap.put(pos, sEventURL);
               }
            }
           
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.