Package com.antlersoft.parser.lex

Examples of com.antlersoft.parser.lex.LexException


    throws RuleActionException, IOException, LexException
  {
    m_preprocessor_state=m_preprocessor_state.nextCharacter( '\n');
    m_preprocessor_state=m_preprocessor_state.endOfFile();
    if ( m_eol_backslash_state)
      throw new LexException( "File ends with backslash");
    m_reader.m_driver.popIncludeFile( m_reader);
    return this;
  }
View Full Code Here


      RuleActionException, LexException {
    m_buf[len++] = c;
   
    if (! CharClass.isHexDigit(c))
    {
      throw new LexException("Hex Byte with 0x -- bad digit " + c);
    }
    if (len == 2)
    {
      m_reader.processToken( IldasmParser.t_HEXBYTE, new Integer(Integer.parseInt( new String(m_buf), 16)));
      return m_parent;
View Full Code Here

      long val=Long.parseLong( m_sb.toString(), 16);
      m_reader.processToken(IldasmParser.t_INT64, new Long(val));
    }
    catch ( NumberFormatException nfe)
    {
      throw new LexException( "Bad hex int format: "+m_sb.toString()+" "+nfe.getMessage());
    }
  }
View Full Code Here

        return m_parent.nextCharacter( c);
    }
    if ( c=='\n')
      m_seen_nl=true;
    else if ( ! CharClass.isWhiteSpace( c))
      throw new LexException( "Unexpected character after end-of-line escape in quote");
    return this;
  }
View Full Code Here

      long value=Long.parseLong( m_sb.toString());
      m_reader.processToken( IldasmParser.t_INT64, new Long(value));
    }
    catch (NumberFormatException nfe)
    {
      throw new LexException( "Bad integer format: "+nfe.getMessage());
    }
  }
View Full Code Here

    {
      offset = 1;
      radix=8;
    }
    if ( good_length-offset<1)
      throw new LexException( "No good digits in string");
    if ( offset==0 && good_length==value.length())
      return (int)Long.parseLong( value);
    return (int)Long.parseLong( value.substring( offset, good_length), radix);
  }
View Full Code Here

   * @see com.antlersoft.parser.lex.LexWithSymbolTree#processToken(com.antlersoft.parser.Symbol, java.lang.String)
   */
  protected void processToken(Symbol s, String value) throws LexException, RuleActionException {
    if ( s==null)
    {
      throw new LexException( "Unrecognized character: "+value);
    }
    if ( s==IldasmParser.t_period && m_reader.expectedReserved(value)==null)
    {
      m_period_exception=true;
      return;
View Full Code Here

  /* (non-Javadoc)
   * @see com.antlersoft.analyzecxx.LexState#endOfFile()
   */
  public LexState endOfFile() throws IOException, RuleActionException,
      LexException {
    throw new LexException( "Unexpected end of file in string");
  }
View Full Code Here

              {
                result=new LexPunctuation( m_reader, this, c);
              }
              break;
      case '\\' :
        throw new LexException( "Unsupported: naked backslash or universal character name");
      default :
        if ( CharClass.isWhiteSpace( c))
          result=new  WhiteSpace( m_reader, this, c);
        else if ( CharClass.isDigit( c))
          result=new LexNumber( m_reader, this, c);
View Full Code Here

      return new HexByte0xState(m_parent, m_reader);
     
    m_buf[1]=c;
    String value=new String(m_buf);
    if ( ! CharClass.isHexDigit(c))
      throw new LexException( "Bad hex byte: "+value);
    m_reader.processToken( IldasmParser.t_HEXBYTE, new Integer(Integer.parseInt( value, 16)));

    return m_parent;
  }
View Full Code Here

TOP

Related Classes of com.antlersoft.parser.lex.LexException

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.