Package net.sourceforge.chaperon.model.symbol

Examples of net.sourceforge.chaperon.model.symbol.Symbol


        SymbolList productiondefinition = grammar.getProduction(J.productions[i]).getDefinition();

        // and not A=XYZ^
        if (J.positions[i]<productiondefinition.getSymbolCount())
        {
          Symbol symbol = productiondefinition.getSymbol(J.positions[i])// A=X ^symbol Z

          // for every item [A=u^Bv,a] in J and production B=w in G
          if (symbol instanceof Nonterminal)
          {
            int pos = J.positions[i]+1// for the FIRST set from (va)
View Full Code Here


        firstset.addSymbol(EMPTYLIST);
      else
      {
        // for every symbol in the production
        int j = 0;
        Symbol newsymbol;
        boolean foundEmptyList;
        do
        {
          foundEmptyList = true;
          newsymbol = productiondefinition.getSymbol(j);
          if (newsymbol instanceof Terminal)

            // if a terminal symbol
            firstset.addSymbol(newsymbol);
          else if (!newsymbol.equals(symbol))
          {
            // and if a non terminal symbol
            if (!examined.contains(newsymbol))
            {
              SymbolSet newfirstset = first(newsymbol, visited);
View Full Code Here

        state = STATE_GRAMMAR;
      }
      else if ((localName.equals(NONTERMINALSYMBOL_ELEMENT)) && (state==STATE_NONTERMINAL))
      {
        Symbol ntsymbol = (Symbol)stack.pop();
        Production production = (Production)stack.peek();

        production.getDefinition().addSymbol(ntsymbol);

        state = STATE_PRODUCTION;
      }
      else if ((localName.equals(TERMINALSYMBOL_ELEMENT)) && (state==STATE_TERMINAL))
      {
        Symbol tsymbol = (Symbol)stack.pop();
        Production production = (Production)stack.peek();

        production.getDefinition().addSymbol(tsymbol);

        state = STATE_PRODUCTION;
      }
      else if ((localName.equals(ERRORSYMBOL_ELEMENT)) && (state==STATE_ERROR))
      {
        Symbol error = (Symbol)stack.pop();
        Production production = (Production)stack.peek();

        production.getDefinition().addSymbol(error);

        state = STATE_PRODUCTION;
View Full Code Here

    SymbolList productiondefinition = production.getDefinition();

    // and not A=uv^w and w ist not empty
    if (position<productiondefinition.getSymbolCount())
    {
      Symbol symbol = productiondefinition.getSymbol(position)// A=u ^symbol w

      // for every item [A=u^Bv,a] in J and production B=w in G
      if (symbol instanceof Nonterminal)
      {
        // list of all productions B
View Full Code Here

TOP

Related Classes of net.sourceforge.chaperon.model.symbol.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.