예제 #1
0
        /*
         * /// <summary>
         * ///     Create an <see cref="LSLElseStatementNode" /> by cloning from another.
         * /// </summary>
         * /// <param name="other">The other node to clone from.</param>
         * /// <exception cref="ArgumentNullException"><paramref name="other" /> is <c>null</c>.</exception>
         * private LSLElseStatementNode(LSLElseStatementNode other)
         * {
         *  if (other == null) throw new ArgumentNullException("other");
         *
         *
         *  SourceRangesAvailable = other.SourceRangesAvailable;
         *  if (SourceRangesAvailable)
         *  {
         *      SourceRange = other.SourceRange;
         *      SourceRangeElseKeyword = other.SourceRangeElseKeyword;
         *  }
         *
         *  Code = other.Code.Clone();
         *  Code.Parent = this;
         *
         *  HasErrors = other.HasErrors;
         * }*/


        /// <exception cref="ArgumentNullException"><paramref name="code" /> or <paramref name="code" /> is <c>null</c>.</exception>
        internal LSLElseStatementNode(LSLParser.ElseStatementContext context, LSLCodeScopeNode code,
                                      bool isConstantBranch)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (code == null)
            {
                throw new ArgumentNullException("code");
            }


            IsConstantBranch = isConstantBranch;


            Code               = code;
            Code.Parent        = this;
            Code.CodeScopeType = LSLCodeScopeType.Else;


            SourceRangeElseKeyword = new LSLSourceCodeRange(context.else_keyword);

            SourceRange = new LSLSourceCodeRange(SourceRangeElseKeyword, code.SourceRange);

            SourceRangesAvailable = true;
        }
예제 #2
0
 /// <summary>
 /// Enter a parse tree produced by <see cref="LSLParser.elseStatement"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void EnterElseStatement([NotNull] LSLParser.ElseStatementContext context)
 {
 }
예제 #3
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="LSLParser.elseStatement"/>.
 /// <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 VisitElseStatement([NotNull] LSLParser.ElseStatementContext context)
 {
     return(VisitChildren(context));
 }