Package com.antlersoft.parser

Examples of com.antlersoft.parser.Symbol


    }
    else
    {
      if ( ! m_finder.canGrow())
      {
        Symbol s=m_finder.currentSymbol();
        processToken( s, m_finder.currentText());
        m_finder.reset();
      }
    }
  }
View Full Code Here


  }

  private void rescan()
  throws RuleActionException, LexException
  {
    Symbol s=m_finder.currentSymbol();
    if ( s!=null)
    {
      processToken( s, m_finder.currentText());
    }
    String r=null;
View Full Code Here

   * @throws RuleActionException -- Parsing the identifier causes an error
   */
  private void processToken() throws RuleActionException
  {
    String value=m_sb.toString();
    Symbol symbol=m_reader.expectedReserved(value);
    if ( symbol!=null)
      m_reader.processToken(symbol, value);
    else
    {
      Symbol id_symbol=IldasmParser.t_ID;
      if ( value.indexOf('.')!= -1 && m_reader.expectedReserved(IldasmParser.t_DOTTEDNAME.toString())!=null)
          id_symbol=IldasmParser.t_DOTTEDNAME;
      m_reader.processToken( id_symbol, value);
    }
  }
View Full Code Here

    LexToken token=(LexToken)tokens.get( start);
    if ( token.symbol==PreprocessParser.lex_white_space)
      return isStringize( tokens, start-1);
    if ( token instanceof AltSymbolToken)
    {
      Symbol alt=((AltSymbolToken)token).m_alt_symbol;
      if ( alt==PreprocessParser.pp_hash || alt==PreprocessParser.pp_wide_stringize)
        return start;
    }
    return -1;
  }
View Full Code Here

      {
        AltSymbolToken alt=(AltSymbolToken)next_token;
        for ( Enumeration e=m_reader.m_preprocess_parser.getExpectedSymbols();
            e.hasMoreElements();)
        {
          Symbol s=(Symbol)e.nextElement();
          if ( alt.m_alt_symbol==s)
          {
            m_reader.m_preprocess_parser.errorParse(s, alt);
            alt=null;
            break;
View Full Code Here

    if ( m_buffer==null)
    {
      if ( ! m_finder.accept( c))
      {
        m_buffer=new StringBuffer(20);
        Symbol s=m_finder.currentSymbol();
        if ( s!=null)
          m_buffer.append( m_finder.currentText());
        m_buffer.append( m_finder.getRemainder());
        m_finder=null;
      }
View Full Code Here

  private void finish() throws IOException, RuleActionException, LexException
  {
    if ( m_buffer==null)
    {
      Symbol s=m_finder.currentSymbol();
      if ( s==null)
        m_reader.processToken(
        new LexToken( PreprocessParser.lex_identifier, m_finder.getRemainder()));
      else
        m_reader.processToken(
          new AltSymbolToken( PreprocessParser.lex_identifier,
          s.toString(), s));
    }
    else
      m_reader.processToken( new LexToken(
        PreprocessParser.lex_identifier, m_buffer.toString()));
View Full Code Here

    if ( m_expected==null)
    {
      m_expected=new HashMap<String,Symbol>();
      for ( Enumeration e=m_parser.getExpectedSymbols(); e.hasMoreElements();)
      {
        Symbol s=(Symbol)e.nextElement();
        m_expected.put(s.toString(), s);
      }
    }
    return (Symbol)m_expected.get( found);
  }
View Full Code Here

  {
      if ( currentString.length()>0)
      {
          String cs=currentString.toString();
          currentString.setLength(0);
          Symbol rw=m_parser.getReservedScope().findReserved( cs);
          if ( rw==null)
          {
              adder.addToken( new Token( BasicBase.nameSymbol, cs));
          }
          else
View Full Code Here

TOP

Related Classes of com.antlersoft.parser.Symbol

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.