Ejemplo n.º 1
0
 public override object VisitChain([NotNull] smilesParser.ChainContext context)
 {
     foreach (IParseTree tree in context.children)
     {
         if (typeof(smilesParser.ChainContext).IsAssignableFrom(tree.GetType()))
         {
             VisitChain((smilesParser.ChainContext)tree);
         }
         else if (typeof(smilesParser.Branched_atomContext).IsAssignableFrom(tree.GetType()))
         {
             VisitBranched_atom((smilesParser.Branched_atomContext)tree);
         }
         else if (typeof(smilesParser.BondContext).IsAssignableFrom(tree.GetType()))
         {
             nextBond = (BondType)VisitBond((smilesParser.BondContext)tree);
         }
         else if (typeof(smilesParser.DotContext).IsAssignableFrom(tree.GetType()))
         {
             nextBond = (BondType)VisitDot((smilesParser.DotContext)tree);
         }
         else
         {
             nextBond = BondType.Any;
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="smilesParser.chain"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitChain([NotNull] smilesParser.ChainContext context)
 {
     return(VisitChildren(context));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="smilesParser.chain"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitChain([NotNull] smilesParser.ChainContext context)
 {
 }