Ejemplo n.º 1
0
 /**
  * Handles the parser adding a child node to a production. This
  * method calls the appropriate analyzer callback. Note that this
  * method will not call any callback if an error requiring
  * recovery has ocurred.
  *
  * @param node           the parent parse tree node
  * @param child          the child parse tree node, or null
  */
 internal void AddNode(Production node, Node child)
 {
     if (errorRecovery >= 0)
     {
         // Do nothing
     }
     else if (node.IsHidden())
     {
         node.AddChild(child);
     }
     else if (child != null && child.IsHidden())
     {
         for (int i = 0; i < child.Count; i++)
         {
             AddNode(node, child[i]);
         }
     }
     else
     {
         try {
             analyzer.Child(node, child);
         } catch (ParseException e) {
             AddError(e, false);
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Handles the parser adding a child node to a production. This
  * method calls the appropriate analyzer callback. Note that this
  * method will not call any callback if an error requiring
  * recovery has ocurred.
  *
  * @param node           the parent parse tree node
  * @param child          the child parse tree node, or null
  */
 internal void AddNode(Production node, Node child) {
     if (errorRecovery >= 0) {
         // Do nothing
     } else if (node.IsHidden()) {
         node.AddChild(child);
     } else if (child != null && child.IsHidden()) {
         for (int i = 0; i < child.Count; i++) {
             AddNode(node, child[i]);
         }
     } else {
         try {
             analyzer.Child(node, child);
         } catch (ParseException e) {
             AddError(e, false);
         }
     }
 }