antlrtreeexception.m

来自「ANTLR(ANother Tool for Language Recognit」· M 代码 · 共 59 行

M
59
字号
////  ANTLRTreeException.m//  ANTLR////  Created by Kay Röpke on 24.10.2006.//  Copyright 2006 classDump. All rights reserved.//#import "ANTLRTreeException.h"@implementation ANTLRTreeException+ (id) exceptionWithOldRoot:(id<ANTLRTree>)theOldRoot newRoot:(id<ANTLRTree>)theNewRoot stream:(id<ANTLRIntStream>)aStream;{	return [[ANTLRTreeException alloc] initWithOldRoot:theOldRoot newRoot:theNewRoot stream:aStream];}- (id) initWithOldRoot:(id<ANTLRTree>)theOldRoot newRoot:(id<ANTLRTree>)theNewRoot stream:(id<ANTLRIntStream>)aStream;{	if ((self = [super initWithStream:aStream reason:@"The new root has more than one child. Cannot make it the root node."])) {		[self setOldRoot:theOldRoot];		[self setNewRoot:theNewRoot];	}	return self;}- (void) dealloc{	[self setOldRoot:nil];	[self setNewRoot:nil];	[super dealloc];}- (void) setNewRoot:(id<ANTLRTree>)aTree{	if (newRoot != aTree) {		[aTree retain];		[newRoot release];		newRoot = aTree;	}}- (void) setOldRoot:(id<ANTLRTree>)aTree{	if (oldRoot != aTree) {		[aTree retain];		[oldRoot release];		oldRoot = aTree;	}}- (NSString *) description{	 return [NSMutableString stringWithFormat:@"%@ old root: <%@> new root: <%@>", [super description], [oldRoot treeDescription], [newRoot treeDescription]];}@end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?