Package net.sourceforge.chaperon.grammar.symbol

Examples of net.sourceforge.chaperon.grammar.symbol.SymbolList


   *
   * @return List of symbols
   */
  public SymbolList getSymbols()
  {
    SymbolList list = new SymbolList(true);

    for (int i = 0; i < getProductionCount(); i++)
      list.addSymbolList(getProduction(i).getSymbols());
    return list;
  }
View Full Code Here


   *
   * @return List of symbols
   */
  public SymbolList getSymbols()
  {
    SymbolList list = new SymbolList(true);

    list.addSymbolList(_tokenlist.getSymbols());
    list.addSymbolList(_productionlist.getSymbols());
    return list;
  }
View Full Code Here

      return new SyntaxErrorException("No productions are defined");

    if (_productionlist.getProductionList(_ssymbol).getSize() <= 0)
      return new SyntaxErrorException("Start symbol is not set");

    SymbolList symbols = getSymbols();
    SymbolList tsymbols = symbols.getTerminalSymbols();
    SymbolList ntsymbols = symbols.getNonTerminalSymbols();

    int i;

    // Test, if all terminal symbol are well defined
    for (i = 0; i < tsymbols.getSymbolCount(); i++)
      if (!_tokenlist.contains(tsymbols.getSymbol(i)))
        return new SyntaxErrorException(_tokenlist + "\n" + _productionlist
                                        + "Terminal symbol \""
                                        + tsymbols.getSymbol(i)
                                        + "\" is not defined through a token");

    // Test, if all non terminal symbol are well defined
    for (i = 0; i < ntsymbols.getSymbolCount(); i++)
      if (!_productionlist.contains(ntsymbols.getSymbol(i)))
        return new SyntaxErrorException(_productionlist
                                        + "Nonterminal symbol \""
                                        + ntsymbols.getSymbol(i)
                                        + "\" is not defined through a production");

    return null;
  }
View Full Code Here

   *
   * @return List of symbols
   */
  public SymbolList getSymbols()
  {
    SymbolList list = new SymbolList(true);

    list.addSymbol(_ntsymbol);
    list.addSymbolList(_definition);
    if (_precedence!=null)
      list.addSymbol(_precedence);
    return list;
  }
View Full Code Here

   *
   * @return List of Symbols
   */
  public SymbolList getSymbols()
  {
    SymbolList list = new SymbolList(true);

    for (int i = 0; i < getTokenCount(); i++)
      list.addSymbol(getToken(i).getSymbol());
    return list;
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.chaperon.grammar.symbol.SymbolList

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.