Examples of Production


Examples of limelight.model.Production

{

  public void refresh(Event e)
  {
    PanelEvent event = (PanelEvent)e;
    final Production production = event.getRecipient().getRoot().getProduction();
    final List<Stage> stages = production.getTheater().getStages();
    for(Stage stage : stages)
    {
      production.openScene(stage.getScene().getResourceLoader().getRoot(), stage, new Opts());
    }

//      (let [scene (.getRoot (.getRecipient e))
//        stage (.getStage scene)
//        production (.getProduction scene)
View Full Code Here

Examples of limelight.model.Production

{

  public void refresh(Event e)
  {
    PanelEvent event = (PanelEvent)e;
    final Production production = event.getRecipient().getRoot().getProduction();
    final List<Stage> stages = production.getTheater().getStages();
    for(Stage stage : stages)
    {
      production.openScene(stage.getScene().getResourceLoader().getRoot(), stage, new OptionsMap());     
    }

//      (let [scene (.getRoot (.getRecipient e))
//        stage (.getStage scene)
//        production (.getProduction scene)
View Full Code Here

Examples of net.sourceforge.chaperon.grammar.production.Production

      {
        stack.push(new ProductionList());
      }
      else if (localName.equals(PRODUCTION_ELEMENT))
      {
        Production production = new Production(
          NonTerminalSymbol.valueOf(atts.getValue(PRODUCTION_SYMBOL_ATTRIBUTE)));

        production.setReduceType(getReduceTypeFromAttributes(atts));

        String precedencesymbol = atts.getValue(PRODUCTION_PRECEDENCE_ATTRIBUTE);
        if ((precedencesymbol != null) && (precedencesymbol.length() > 0))
          production.setPrecedence(TerminalSymbol.valueOf(precedencesymbol));

        stack.push(production);
      }
      else if (localName.equals(NONTERMINALSYMBOL_ELEMENT))
      {
View Full Code Here

Examples of net.sourceforge.chaperon.grammar.production.Production

        grammar.getProductionList().addProduction(productions);
      }
      else if (localName.equals(PRODUCTION_ELEMENT))
      {
        Production production = (Production) stack.pop();
        ProductionList productions = (ProductionList) stack.peek();

        productions.addProduction(production);
      }
      else if (localName.equals(NONTERMINALSYMBOL_ELEMENT))
      {
        Symbol ntsymbol = (Symbol) stack.pop();
        Production production = (Production) stack.peek();

        production.getDefinition().addSymbol(ntsymbol);
      }
      else if (localName.equals(TERMINALSYMBOL_ELEMENT))
      {
        Symbol tsymbol = (Symbol) stack.pop();
        Production production = (Production) stack.peek();

        production.getDefinition().addSymbol(tsymbol);
      }
      else if (localName.equals(STARTSYMBOL_ELEMENT))
      {
        NonTerminalSymbol ssymbol = (NonTerminalSymbol) stack.pop();
        Grammar grammar = (Grammar) stack.peek();
View Full Code Here

Examples of net.sourceforge.chaperon.model.grammar.Production

      if (reduceactions.length>0)
      {
        for (int i = 0; i<reduceactions.length; i++)
        {
          Production production = reduceactions[i].production;

          if ((log!=null) && (log.isDebugEnabled()))
            log.debug(
            /*"State "+node.state+*/
            " reduce "+production.getSymbol());

          /*+
                                   " ("+production+")");*/
          ProductionNode productionnode = new ProductionNode(production);
          TreeNode[] descendants = new TreeNode[production.getDefinition().getSymbolCount()];

          StateNode ancestor = statenode;

          for (int j = production.getDefinition().getSymbolCount()-1; j>=0; j--)
          {
            descendants[j] = ancestor.treenode;
            ancestor = ancestor.ancestor;
          }

View Full Code Here

Examples of net.sourceforge.chaperon.model.grammar.Production

      if (reduceactions.length>0)
      {
        for (int i = 0; i<reduceactions.length; i++)
        {
          Production production = reduceactions[i].production;

          ProductionNode productionnode = new ProductionNode(production);
          TreeNode[] descendants = new TreeNode[production.getDefinition().getSymbolCount()];

          StateNode ancestor = statenode;

          for (int j = production.getDefinition().getSymbolCount()-1; j>=0; j--)
          {
            descendants[j] = ancestor.treenode;
            ancestor = ancestor.ancestor;
          }

          productionnode.descendants = descendants;

          ShiftAction shiftaction = ancestor.state.getShiftAction(productionnode.symbol);

          //System.out.println("current state:\n"+ancestor.state+"\ntransition for "+productionnode.symbol+" = "+shiftaction);
          if ((automaton.getState(0)==ancestor.state) &&
              (productionnode.symbol.equals(grammar.getStartSymbol())))
          {
            if ((log!=null) && (log.isDebugEnabled()))
              log.debug("State "+state+" accept");

            StateNode newstatenode = getStateNode(next, null, ancestor);

            if (newstatenode==null)
            {
              newstatenode = new StateNode(null, ancestor, productionnode);
              next.push(newstatenode);
            }
            else
            {
              System.out.println("merging state node");

              ProductionNode oldproductionnode = (ProductionNode)newstatenode.treenode;

              if (grammar.getPriority(oldproductionnode.production)>grammar.getPriority(production))
              {
                System.out.println("priority("+production+") < priority("+
                                   oldproductionnode.production+")");
                newstatenode.treenode = productionnode;
              }
              else
                System.out.println("priority("+production+") >= priority("+
                                   oldproductionnode.production+")");
            }
          }
          else
          {
            if ((log!=null) && (log.isDebugEnabled()))
              log.debug(
              /*"State "+node.state+*/
              " reduce "+production.getSymbol()+" ("+production+")");

            /*          StateNode newstatenode = new
            StateNode(ancestor.state.getShiftAction(productionnode.symbol).state, ancestor, productionnode);

                      current.push(newstatenode);*/
 
View Full Code Here

Examples of net.sourceforge.chaperon.model.grammar.Production

    F = new Nonterminal("F");

    grammar = new Grammar();

    // E -> E + T
    Production production = new Production(E);
    production.getDefinition().addSymbol(E);
    production.getDefinition().addSymbol(plus);
    production.getDefinition().addSymbol(T);
    grammar.addProduction(production);

    // E -> T
    production = new Production(E);
    production.getDefinition().addSymbol(T);
    grammar.addProduction(production);

    // T -> T * F
    production = new Production(T);
    production.getDefinition().addSymbol(T);
    production.getDefinition().addSymbol(mult);
    production.getDefinition().addSymbol(F);
    grammar.addProduction(production);

    // T -> F
    production = new Production(T);
    production.getDefinition().addSymbol(F);
    grammar.addProduction(production);

    // F -> ( E )
    production = new Production(F);
    production.getDefinition().addSymbol(bopen);
    production.getDefinition().addSymbol(E);
    production.getDefinition().addSymbol(bclose);
    grammar.addProduction(production);

    production = new Production(F);
    production.getDefinition().addSymbol(id);
    grammar.addProduction(production);

    grammar.setStartSymbol(E);
  }
View Full Code Here

Examples of net.sourceforge.chaperon.model.grammar.Production

  public boolean contains(State state)
  {
    int i;
    int j;
    int position;
    Production production;
    boolean found;

    for (i = 0; i<state.productions.length; i++)
    {
      production = state.productions[i];
View Full Code Here

Examples of net.sourceforge.chaperon.model.grammar.Production

    grammar = new Grammar();

    grammar.setStartSymbol(E);

    // E -> T E'
    Production production = new Production(E);
    production.getDefinition().addSymbol(T);
    production.getDefinition().addSymbol(Eprime);
    grammar.addProduction(production);

    // E' -> + T E'
    production = new Production(Eprime);
    production.getDefinition().addSymbol(plus);
    production.getDefinition().addSymbol(T);
    production.getDefinition().addSymbol(Eprime);
    grammar.addProduction(production);

    // E' ->
    production = new Production(Eprime);
    grammar.addProduction(production);

    // T -> F T'
    production = new Production(T);
    production.getDefinition().addSymbol(F);
    production.getDefinition().addSymbol(Tprime);
    grammar.addProduction(production);

    // T' -> * F T'
    production = new Production(Tprime);
    production.getDefinition().addSymbol(mult);
    production.getDefinition().addSymbol(F);
    production.getDefinition().addSymbol(Tprime);
    grammar.addProduction(production);

    // T' ->
    production = new Production(Tprime);
    grammar.addProduction(production);

    // F -> bopen E bclose
    production = new Production(F);
    production.getDefinition().addSymbol(bopen);
    production.getDefinition().addSymbol(E);
    production.getDefinition().addSymbol(bclose);
    grammar.addProduction(production);

    // F -> id
    production = new Production(F);
    production.getDefinition().addSymbol(id);
    grammar.addProduction(production);
  }
View Full Code Here

Examples of net.sourceforge.chaperon.model.grammar.Production

    F = new Nonterminal("F");
    G = new Nonterminal("G");

    grammar = new Grammar();

    p1 = new Production(F);
    p1.getDefinition().addSymbol(E);
    p1.getDefinition().addSymbol(a);
    p1.getDefinition().addSymbol(E);
    grammar.addProduction(p1);

    p2 = new Production(F);
    p2.getDefinition().addSymbol(E);
    p2.getDefinition().addSymbol(b);
    p2.getDefinition().addSymbol(E);
    grammar.addProduction(p2);

    p3 = new Production(G);
    p3.getDefinition().addSymbol(E);
    p3.getDefinition().addSymbol(F);
    grammar.addProduction(p3);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.