Exemple #1
0
 /**
  * Checks a production pattern element for completeness. If
  * the element references a production pattern not added to
  * this parser, a parser creation exception will be thrown.
  *
  * @param name           the name of the pattern being checked
  * @param elem           the production pattern element to check
  *
  * @throws ParserCreationException if the element referenced a
  *             pattern not added to this parser
  */
 private void CheckElement(string name,
                           ProductionPatternElement elem)
 {
     if (elem.IsProduction() && GetPattern(elem.Id) == null)
     {
         throw new ParserCreationException(
                   ParserCreationException.ErrorType.INVALID_PRODUCTION,
                   name,
                   "an undefined production pattern id (" + elem.Id +
                   ") is referenced");
     }
 }
Exemple #2
0
        /**
         * Checks a production pattern element for completeness. If
         * the element references a production pattern not added to
         * this parser, a parser creation exception will be thrown.
         *
         * @param name           the name of the pattern being checked
         * @param elem           the production pattern element to check
         *
         * @throws ParserCreationException if the element referenced a
         *             pattern not added to this parser
         */
        private void CheckElement(string name,
                                  ProductionPatternElement elem) {

            if (elem.IsProduction() && GetPattern(elem.Id) == null) {
                throw new ParserCreationException(
                    ParserCreationException.ErrorType.INVALID_PRODUCTION,
                    name,
                    "an undefined production pattern id (" + elem.Id +
                    ") is referenced");
            }
        }