Package net.sf.laja.parser.template

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


      if (genDecl) {
        String output = data.getOutput(phase, var1, var2, var2b, null, not);
        if (statementList != null) {
          NewStatement newStatement = new NewStatement("FollowedBy", name);
          newStatement.setData(not, cs, output);
          statementList.add(new Statement(phase, baseDecl, "FollowedBy", name, newStatement));
        }
      }
      if (genStat) {
        generateStatement(valstmt, "setElement", phase, not, name, var1, data, statementList);
        generateStatement(followedby, "followedby", phase, not, name, var1, data, statementList);
View Full Code Here


  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

      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) {
        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

    if (genDecl) {
      String output = data.getOutput(phase, var1, var2, var2b, null, not);
      if (statementList != null) {
        NewStatement newStatement = new NewStatement("Str", strval);
        newStatement.setData(not, cs, output);
        statementList.add(new Statement(phase, baseDecl, "Str", name, newStatement));
      }
    }
  }
View Full Code Here

    if (genDecl) {
      String output = data.getOutput(phase, var1, var2, var2b, null, not);
      if (statementList != null) {
        NewStatement newStatement = new NewStatement("Optional", name);
        newStatement.setData(false, cs, output);
        statementList.add(new Statement(phase, baseDecl, "Optional", name, newStatement));
      }
    }
    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

    if (ov != null) {
      String output = data.getOutput(phase, var1, var2, var2b, null, not);
      if (statementList != null) {
        NewStatement newStatement = new NewStatement("Variable", name);
        newStatement.setData(not, cs, output);
        statementList.add(new Statement(phase, baseDecl, "Variable", name, newStatement));
      }
    }
  }
View Full Code Here

      if (genDecl) {
        String output = data.getOutput(phase, var1, var2, var2b, null, not);
        if (statementList != null) {
          NewStatement newStatement = new NewStatement("OrList", name);
          newStatement.setData(not, cs, output);
          statementList.add(new Statement(phase, baseDecl, "OrList", name, newStatement));
        }
      }
      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 (genDecl) {
        String output = data.getOutput(phase, var1, var2, var2b, null, not);
        if (statementList != null) {
          NewStatement newStatement = new NewStatement("ElementList", name);
          newStatement.setData(not, cs, output);
          statementList.add(new Statement(phase, baseDecl, "ElementList", name, newStatement));
        }
      }
      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

    if (genDecl) {
      String output = data.getOutput(phase, var1, var2, var2b, null, not);
      if (statementList != null) {
        NewStatement newStatement = new NewStatement("End", name);
        newStatement.setData(not, cs, output);
        statementList.add(new Statement(phase, baseDecl, "End", name, newStatement));
      }
    }
  }
View Full Code Here

      String output = data.getOutput(phase, var1, this.name, var2b, null, not);
      // Only handle output, do not handle "not", "cs" and "length".
      if (statementList != null) {
        NewStatement newStatement = new NewStatement("Marker", name);
        newStatement.setOutput(output);
        statementList.add(new Statement(phase, baseDecl, "Marker", name, newStatement));
      }
    }
  }
View Full Code Here

TOP

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

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.