Package com.antlersoft.parser.lex

Examples of com.antlersoft.parser.lex.LexState


  }

  public LexState nextCharacter( char c)
    throws RuleActionException, IOException, LexException
  {
    LexState result=this;
    switch ( c)
    {
      case '/' :
          result=new InitialSlash( m_reader, this);
        break;
View Full Code Here


   * @throws IOException
   * @throws RuleActionException
   */
  public void Read( DBDriver driver, Reader reader) throws IOException, RuleActionException
  {
    LexState state=new InitialState( this);
    m_parser.reset();
    m_parser.setDriver(driver);
    m_parser.setReader(reader);
    m_expected=null;
    readToLexer(reader, state);
View Full Code Here

    m_token_to_send=token_to_send;
    m_is_escaped=false;
    m_buffer=new StringBuffer();
  }
    public LexState nextCharacter(char c) throws IOException, RuleActionException, LexException {
    LexState result;
    if ( c==m_closing_quote && ! m_is_escaped)
    {
      m_token_to_send.value=m_buffer.toString();
      m_reader.processToken( m_token_to_send);
      result=m_caller;
View Full Code Here

    m_caller=caller;
  }
    public LexState nextCharacter(char c)
  throws IOException, RuleActionException, LexException
  {
    LexState result;
    switch ( c)
    {
      case '\'' :
        result=new QuotedLiteral( m_reader, this, c,
              new CharacterLiteral( null, true));
      break;
      case '"' :
        result=new QuotedLiteral( m_reader, this, c,
              new StringLiteral( null, true));
      break;
      case '#' :
          m_reader.processToken( new PunctuationToken( PreprocessParser.pp_wide_stringize.toString(),
          PreprocessParser.pp_wide_stringize));
          result=m_caller;
        break;
      default : result=new LexIdentifier( m_reader, m_caller, 'L');
        result=result.nextCharacter( c);
    }
    return result;
    }
View Full Code Here

  /* (non-Javadoc)
   * @see com.antlersoft.analyzecxx.LexState#nextCharacter(char)
   */
  public LexState nextCharacter(char c) throws IOException,
      RuleActionException, LexException {
    LexState result=this;
    if ( c=='E' || c=='e')
    {
      if ( m_sb.indexOf("E")== -1)
        m_sb.append( 'E');
      else
View Full Code Here

  /* (non-Javadoc)
   * @see com.antlersoft.parser.lex.LexState#nextCharacter(char)
   */
  public LexState nextCharacter(char c) throws IOException,
      RuleActionException, LexException {
    LexState result=this;
    if ( c=='}')
    {
      if ( braceCount>0)
        --braceCount;
      else
View Full Code Here

  /* (non-Javadoc)
   * @see com.antlersoft.analyzecxx.LexState#nextCharacter(char)
   */
  public LexState nextCharacter(char c) throws IOException,
      RuleActionException, LexException {
    LexState result;
    if ( c=='.')
    {
      result=new FloatState( m_parent, m_reader, "-0.");
    }
    else if ( CharClass.isDigit(c))
    {
      result=new NumberState( m_parent, m_reader);
      result=result.nextCharacter('-');
      result=result.nextCharacter(c);
    }
    else
    {
      m_reader.processToken( IldasmParser.t_minus, "-");
      result=m_parent;
View Full Code Here

      char[] chars=toTokenize.toCharArray();
      final ArrayList<Token> tokens=new ArrayList<Token>();
      currentString.setLength(0);
      int i=0;
      lex_state=INITIAL;
      LexState ls=this;
      TokenAdder old_adder=adder;
      adder=new TokenAdder() {
        public void addToken( Token t)
        {
          tokens.add(t);
        }
      };
      try
      {
        for ( ; i<chars.length; i++)
        {
            ls=ls.nextCharacter(chars[i]);
        }
        ls.endOfFile();
      }
      catch ( IOException ioe)
      {
      }
      catch ( RuleActionException rae)
View Full Code Here

TOP

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

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.