Package net.sf.laja.parser.template

Examples of net.sf.laja.parser.template.AddStatement


    }
  }

  // Duplicerad fr�n Valand!!! (har �ndrat pipeElement till element)
  private void generateStatement(GrammarElement element, String method, int phase, boolean not, String name, String var1, GrammarData data, StatementList statementList) {
    AddStatement addStatement = element.getStatement(phase, name, not, null, var1, null, null, data);
    if (addStatement != null) {
      addStatement.setMehtod(method);
      if (statementList != null) {
        statementList.add(new Statement(phase, false, name, addStatement));
      }
    } else {
      String elementName = data.addNewVarname(name);
      element.generate(phase, false, true, true, not, null, elementName, var1, null, null, data, statementList);
      if (statementList != null) {
        addStatement = new AddStatement(elementName, new RefStatement(elementName));
        addStatement.setMehtod(method);
        statementList.add(new Statement(phase, false, name, addStatement));
      }
    }
  }
View Full Code Here


          newStatement.setData(not, cs, output, repeats);
          statementList.add(new Statement(phase, baseDecl, "Repeat", name, newStatement));
        }
      }
      if (genStat) {
        AddStatement addStatement = element.getStatement(phase, name, this.not, null, var1, refname, refname, data);
        if (statementList != null) {
          statementList.add(new Statement(phase, false, name, addStatement));
        }
      }
    }
View Full Code Here

      var2 = refname;
    }
    String output = data.getOutput(phase, var1, var2, var2b, null, not);
    NewStatement newStatement = new NewStatement("Str", name);
    newStatement.setData(not, cs, output);
    return new AddStatement(strval, newStatement);
  }
View Full Code Here

      }
    }
    if (genStat) {
      var2 = "";
      var2b = "";
      AddStatement addStatement = valpar.getStatement(phase, name, false, null, var1, var2, var2b, data);
      if (addStatement != null) {
        if (statementList != null) {
          statementList.add(new Statement(phase, false, name, addStatement));
        }
      } else {
        if (valpar.isElementList()) {
          valpar.generate(phase, false, false, true, false, null, name, var1, var2, var2b, data, statementList);
        } else {
          String elementName = data.addNewVarname(name);
          valpar.generate(phase, false, true, true, false, null, elementName, var1, null, null, data, statementList);
          if (statementList != null) {
            addStatement = new AddStatement(elementName, new RefStatement(elementName));
            statementList.add(new Statement(phase, false, name, addStatement));
          }
        }
      }
    }
View Full Code Here

    Outputvar ov = data.getOutputvar(this.name);
    if (ov != null) {
      String output = data.getOutput(phase, var1, var2, var2b, null, not);
      NewStatement newStatement = new NewStatement("Variable", name, ov.getClassVariableName());
      newStatement.setData(not, cs, output);
      return new AddStatement(name, newStatement);
    }
    return null;
  }
View Full Code Here

        }
      }
      if (genStat) {
        for (Iterator i = elementList.iterator(); i.hasNext();) {
          GrammarElement grammarElement = (GrammarElement) i.next();
          AddStatement addStatement = grammarElement.getStatement(phase, name, false, null, var1, null, null, data);
          if (addStatement != null) {
            if (statementList != null) {
              statementList.add(new Statement(phase, false, name, addStatement));
            }
          } else {
            String elementName = data.addNewVarname(name);
            grammarElement.generate(phase, false, true, true, false, null, elementName, var1, null, null, data, statementList);
            if (statementList != null) {
              addStatement = new AddStatement(elementName, new RefStatement(elementName));
              statementList.add(new Statement(phase, false, name, addStatement));
            }
          }
        }
      }
View Full Code Here

        }
      }
      if (genStat) {
        for (Iterator i = elementList.iterator(); i.hasNext();) {
          GrammarElement grammarElement = (GrammarElement) i.next();
          AddStatement addStatement = grammarElement.getStatement(phase, name, false, null, var1, null, null, data);
          if (addStatement != null) {
            if (statementList != null) {
              statementList.add(new Statement(phase, false, name, addStatement));
            }
          } else {
            String elementName = data.addNewVarname(name);
            grammarElement.generate(phase, false, true, true, false, null, elementName, var1, null, null, data, statementList);
            if (statementList != null) {
              statementList.add(new Statement(phase, false, name, new AddStatement(elementName, new RefStatement(elementName))));
            }
          }
        }
      }
    }
View Full Code Here

      var2 = refname;
    }
    String output = data.getOutput(phase, var1, var2, var2, null, not);
    NewStatement newStatement = new NewStatement("End", name);
    newStatement.setData(not, cs, output);
    return new AddStatement(name, newStatement);
  }
View Full Code Here

  public AddStatement getStatement(int phase, String name, boolean not, Boolean cs, String var1, String var2, String var2b, GrammarData data) {
    String output = data.getOutput(phase, var1, this.name, var2b, null, not);
    NewStatement newStatement = new NewStatement("Marker", name);
    newStatement.setData(not, cs, output);
    return new AddStatement(this.name, newStatement);
  }
View Full Code Here

            newStatement.setData(not1, cs, output);
            statementList.add(new Statement(phase, baseDecl, "ElementList", name, newStatement));
          }
        }
        if (genStat) {
          AddStatement addStatement = element.getStatement(phase, name, not2, null, var1, null, null, data);
          if (addStatement != null) {
            if (statementList != null) {
              statementList.add(new Statement(phase, false, name, addStatement));
            }
          } else {
            String elementName = data.addNewVarname(name);
            element.generate(phase, false, true, true, not2, null, elementName, var1, null, null, data, statementList);
            if (statementList != null) {
              statementList.add(new Statement(phase, false, name, new AddStatement(elementName, new RefStatement(elementName))));
            }
          }
        }
      }
    } else {
      if (genDecl) {
        String output = data.getOutput(phase, var1, var2, var2b, null, not);
        if (statementList != null) {
          NewStatement newStatement = new NewStatement("Repeat", name);
          newStatement.setData(not, cs, output, repeats);
          statementList.add(new Statement(phase, baseDecl, "Repeat", name, newStatement));
        }
      }
      if (genStat) {
        String output = data.getOutput(phase, var1, var2, varname, null, this.not);
        boolean decoratable = element.decoratable(phase, this.not, null, output, var1, varname, var2b, data);

        AddStatement addStatement = element.getStatement(phase, name, this.not, null, var1, varname, "", data);

        if (decoratable && addStatement != null) {
          if (statementList != null) {
            statementList.add(new Statement(phase, false, name, addStatement));
          }
        } else if (decoratable && element.isElementList()) {
          element.generate(phase, false, false, true, this.not, null, name, var1, varname, "", data, statementList);
        } else {
          String newName = data.addNewVarname(name);
          output = data.getOutput(phase, var1, varname, "", null, this.not);
          element.generate(phase, false, true, true, false, null, newName, var1, null, "", data, statementList);
          if (statementList != null) {
            RefStatement refStatement = new RefStatement(newName);
            refStatement.setData(this.not, cs, output);
            statementList.add(new Statement(phase, false, name, new AddStatement(newName, refStatement)));
          }
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.laja.parser.template.AddStatement

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.