示例#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;
        }
示例#2
0
文件: CatchNode.cs 项目: menozz/lens
 protected bool Equals(CatchNode other)
 {
     return Equals(ExceptionType, other.ExceptionType)
         && string.Equals(ExceptionVariable, other.ExceptionVariable)
         && Equals(Code, other.Code);
 }
示例#3
0
 protected bool Equals(CatchNode other)
 {
     return(Equals(ExceptionType, other.ExceptionType) &&
            string.Equals(ExceptionVariable, other.ExceptionVariable) &&
            Equals(Code, other.Code));
 }