当前位置: 首页>>代码示例>>Java>>正文


Java IStrategoTerm.isList方法代码示例

本文整理汇总了Java中org.spoofax.interpreter.terms.IStrategoTerm.isList方法的典型用法代码示例。如果您正苦于以下问题:Java IStrategoTerm.isList方法的具体用法?Java IStrategoTerm.isList怎么用?Java IStrategoTerm.isList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.spoofax.interpreter.terms.IStrategoTerm的用法示例。


在下文中一共展示了IStrategoTerm.isList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: replaceTerm

import org.spoofax.interpreter.terms.IStrategoTerm; //导入方法依赖的package包/类
@Override
public IStrategoTerm replaceTerm(IStrategoTerm term, IStrategoTerm origin) {
	if (term == null) {
		return term;
	} else if (term == origin) {
		return term;
	} else if (term.isList()) {
		if (term.getSubtermCount() == origin.getSubtermCount()
				&& origin.isList()) {
			return makeListLink((IStrategoList) term, (IStrategoList) origin);
		} else {
			return term;
		}
	} else if (haveSameSignature(term, origin)) {
		ensureChildLinks(term.getAllSubterms(), origin);
		return ensureLink(term, origin, false);
	} else {
		return ensureLink(term, origin, false);
	}
}
 
开发者ID:metaborg,项目名称:mb-rep,代码行数:21,代码来源:OriginTermFactory.java

示例2: constructMinimalCostRecovery

import org.spoofax.interpreter.terms.IStrategoTerm; //导入方法依赖的package包/类
private RecoverInterpretation constructMinimalCostRecovery(IStrategoTerm term, IStrategoTerm parent) {
	//candidates can be null
	RecoverInterpretation discardRecovery = constructDiscardRecovery(term, parent);
	RecoverInterpretation childTermsRecovery = null;
	if(!term.isList())
		childTermsRecovery = constructRepairSubtermsRecovery(term, parent);
	else {
		childTermsRecovery = sublistRecovery(0, term, parent); 
		if(childTermsRecovery != null)
			return childTermsRecovery;
		return discardRecovery;
	}
	RecoverInterpretation subTermsRecovery = constructReplaceBySubtermsRecovery(term, parent);
	ArrayList<RecoverInterpretation> candidates = new ArrayList<RecoverInterpretation>();
	candidates.add(childTermsRecovery);
	candidates.add(subTermsRecovery);
	candidates.add(discardRecovery);
	return getMinimumCostRecovery(candidates);
}
 
开发者ID:metaborg,项目名称:jsglr,代码行数:20,代码来源:TermEditsAnalyzer.java

示例3: makeLinkDesugared

import org.spoofax.interpreter.terms.IStrategoTerm; //导入方法依赖的package包/类
/**
 * @param origin
 *            The origin term. For lists, this must be the exact
 *            corresponding term with the same offset and length.
 */
public IStrategoTerm makeLinkDesugared(IStrategoTerm term, IStrategoTerm desugared) {
	if (!term.isList() && DesugaredOriginAttachment.get(term) == null) {
		if (term.getStorageType() == MUTABLE)
			DesugaredOriginAttachment.setDesugaredOrigin(term, desugared);
	} else if (REASSIGN_ORIGINS) {
		throw new NotImplementedException("Not implemented: unwrapping of possibly already wrapped term");
	}
	return term;
}
 
开发者ID:metaborg,项目名称:mb-rep,代码行数:15,代码来源:OriginTermFactory.java

示例4: isList

import org.spoofax.interpreter.terms.IStrategoTerm; //导入方法依赖的package包/类
public static boolean isList(STermCursor c) {
	IStrategoTerm term = c.getData();
	return term.isList();
}
 
开发者ID:nuthatchery,项目名称:nuthatch-stratego,代码行数:5,代码来源:STermAdapter.java

示例5: constructDiscardRecovery

import org.spoofax.interpreter.terms.IStrategoTerm; //导入方法依赖的package包/类
private RecoverInterpretation constructDiscardRecovery(IStrategoTerm term, IStrategoTerm parent) {
	if(HelperFunctions.isSomeNode(term) || term.isList()){ //|| (parent != null && parent.isList())
		return RecoverInterpretation.createDiscardInterpretation(term, parent);
	}
	return null;
}
 
开发者ID:metaborg,项目名称:jsglr,代码行数:7,代码来源:TermEditsAnalyzer.java

示例6: isIncrementalNode

import org.spoofax.interpreter.terms.IStrategoTerm; //导入方法依赖的package包/类
public boolean isIncrementalNode(ISimpleTerm term) {
	IStrategoTerm parent = getParent(term);
	return parent != null && parent.isList() && incrementalSorts.contains(getSort(term));
}
 
开发者ID:metaborg,项目名称:jsglr,代码行数:5,代码来源:IncrementalSortSet.java


注:本文中的org.spoofax.interpreter.terms.IStrategoTerm.isList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。