Examples of addViolation()


Examples of net.sourceforge.chaperon.model.Violations.addViolation()

    SymbolSet ntsymbols = getSymbols().getNonterminals();

    for (int i = 0; i<ntsymbols.getSymbolCount(); i++)
    {
      if (!contains(ntsymbols.getSymbol(i)))
        violations.addViolation("Nonterminal symbol \""+ntsymbols.getSymbol(i)+"\""+
                                "is not defined through a production", location);

      if (ntsymbols.getSymbol(i).getName().equals("error"))
        violations.addViolation("Nonterminal symbol with name \"error\" is not allowed", location);
    }
View Full Code Here

Examples of net.sourceforge.chaperon.model.Violations.addViolation()

      if (!contains(ntsymbols.getSymbol(i)))
        violations.addViolation("Nonterminal symbol \""+ntsymbols.getSymbol(i)+"\""+
                                "is not defined through a production", location);

      if (ntsymbols.getSymbol(i).getName().equals("error"))
        violations.addViolation("Nonterminal symbol with name \"error\" is not allowed", location);
    }

    SymbolSet tsymbols = getSymbols().getTerminals();

    for (int i = 0; i<tsymbols.getSymbolCount(); i++)
View Full Code Here

Examples of net.sourceforge.chaperon.model.Violations.addViolation()

  public Violations validate()
  {
    Violations violations = new Violations();

    if ((set==null) || (set.length()==0))
      violations.addViolation("Character set contains no characters", getLocation());

    return violations;
  }
}
View Full Code Here

Examples of net.sourceforge.chaperon.model.Violations.addViolation()

    for (int i = 0; i<tsymbols.getSymbolCount(); i++)
    {
      if ((!(tsymbols.getSymbol(i) instanceof Error)) &&
          (tsymbols.getSymbol(i).getName().equals("error")))
        violations.addViolation("Terminal symbol with name \"error\" is not allowed", location);
    }

    return violations;
  }
View Full Code Here

Examples of net.sourceforge.chaperon.model.Violations.addViolation()

  public Violations validate()
  {
    Violations violations = new Violations();

    if (getPatternCount()<1)
      violations.addViolation("Pattern group doesn't contain elements", getLocation());

    for (int i = 0; i<getPatternCount(); i++)
      violations.addViolations(getPattern(i).validate());

    return violations;
View Full Code Here

Examples of net.sourceforge.chaperon.model.Violations.addViolation()

  public Violations validate()
  {
    Violations violations = new Violations();

    if (getPatternCount()==0)
      violations.addViolation("Concatenation doesn't contain any elements", getLocation());

    for (int i = 0; i<getPatternCount(); i++)
      violations.addViolations(getPattern(i).validate());

    return violations;
View Full Code Here

Examples of net.sourceforge.chaperon.model.Violations.addViolation()

  public Violations validate()
  {
    Violations violations = new Violations();

    if (ntsymbol==null)
      violations.addViolation("No symbol is for the left side defined", location);

    /*if ((definition==null) || (definition.getSymbolCount()<=0))
      violations.addViolation("No symbols are for the right side defined",
                              location);*/
    return violations;
View Full Code Here

Examples of net.sourceforge.chaperon.model.Violations.addViolation()

  public Violations validate()
  {
    Violations violations = new Violations();

    if (minimum>maximum)
      violations.addViolation("Minimum is greater than the maximum", getLocation());

    if (minimum==maximum)
      violations.addViolation("Minimum is equal than the maximum", getLocation());

    return violations;
View Full Code Here

Examples of net.sourceforge.chaperon.model.Violations.addViolation()

    if (minimum>maximum)
      violations.addViolation("Minimum is greater than the maximum", getLocation());

    if (minimum==maximum)
      violations.addViolation("Minimum is equal than the maximum", getLocation());

    return violations;
  }
}
View Full Code Here

Examples of net.sourceforge.chaperon.model.Violations.addViolation()

  public Violations validate()
  {
    Violations violations = new Violations();

    if ((string==null) || (string.length()<=0))
      violations.addViolation("Character string contains no characters", getLocation());

    return violations;
  }
}
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.