Ejemplo n.º 1
0
        /// <summary>
        /// catch_stmt                                  = "catch" [ identifier ":" type ] block
        /// </summary>
        private CatchNode parseCatchStmt()
        {
            if (!check(LexemType.Catch))
                return null;

            var node = new CatchNode();
            if (peek(LexemType.Identifier))
            {
                node.ExceptionVariable = getValue();
                ensure(LexemType.Colon, ParserMessages.SymbolExpected, ':');
                node.ExceptionType = ensure(parseType, ParserMessages.ExceptionTypeExpected);
            }

            node.Code = ensure(parseBlock, ParserMessages.ExceptionHandlerExpected);
            return node;
        }
Ejemplo n.º 2
0
 protected bool Equals(CatchNode other)
 {
     return Equals(ExceptionType, other.ExceptionType)
         && string.Equals(ExceptionVariable, other.ExceptionVariable)
         && Equals(Code, other.Code);
 }
Ejemplo n.º 3
0
 protected bool Equals(CatchNode other)
 {
     return(Equals(ExceptionType, other.ExceptionType) &&
            string.Equals(ExceptionVariable, other.ExceptionVariable) &&
            Equals(Code, other.Code));
 }