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


Java ErrorManager.recursionOverflow方法代码示例

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


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

示例1: issueRecursionWarnings

import org.antlr.tool.ErrorManager; //导入方法依赖的package包/类
protected void issueRecursionWarnings() {
	// RECURSION OVERFLOW
	Set dfaStatesWithRecursionProblems =
		stateToRecursionOverflowConfigurationsMap.keySet();
	// now walk truly unique (unaliased) list of dfa states with inf recur
	// Goal: create a map from alt to map<target,List<callsites>>
	// Map<Map<String target, List<NFAState call sites>>
	Map altToTargetToCallSitesMap = new HashMap();
	// track a single problem DFA state for each alt
	Map altToDFAState = new HashMap();
	computeAltToProblemMaps(dfaStatesWithRecursionProblems,
							stateToRecursionOverflowConfigurationsMap,
							altToTargetToCallSitesMap, // output param
							altToDFAState);            // output param

	// walk each alt with recursion overflow problems and generate error
	Set alts = altToTargetToCallSitesMap.keySet();
	List sortedAlts = new ArrayList(alts);
	Collections.sort(sortedAlts);
	for (Iterator altsIt = sortedAlts.iterator(); altsIt.hasNext();) {
		Integer altI = (Integer) altsIt.next();
		Map targetToCallSiteMap =
			(Map)altToTargetToCallSitesMap.get(altI);
		Set targetRules = targetToCallSiteMap.keySet();
		Collection callSiteStates = targetToCallSiteMap.values();
		DFAState sampleBadState = (DFAState)altToDFAState.get(altI);
		ErrorManager.recursionOverflow(this,
									   sampleBadState,
									   altI.intValue(),
									   targetRules,
									   callSiteStates);
	}
}
 
开发者ID:pcingola,项目名称:jFuzzyLogic,代码行数:34,代码来源:DecisionProbe.java

示例2: issueRecursionWarnings

import org.antlr.tool.ErrorManager; //导入方法依赖的package包/类
protected void issueRecursionWarnings() {
	// RECURSION OVERFLOW
	Set dfaStatesWithRecursionProblems =
		stateToRecursiveOverflowConfigurationsMap.keySet();
	// now walk truly unique (unaliased) list of dfa states with inf recur
	// Goal: create a map from alt to map<target,List<callsites>>
	// Map<Map<String target, List<NFAState call sites>>
	Map altToTargetToCallSitesMap = new HashMap();
	// track a single problem DFA state for each alt
	Map altToDFAState = new HashMap();
	computeAltToProblemMaps(dfaStatesWithRecursionProblems,
							stateToRecursiveOverflowConfigurationsMap,
							altToTargetToCallSitesMap, // output param
							altToDFAState);            // output param
	//System.out.println("altToTargetToCallSitesMap="+altToTargetToCallSitesMap);

	// walk each alt with recursion overflow problems and generate error
	Set alts = altToTargetToCallSitesMap.keySet();
	List sortedAlts = new ArrayList(alts);
	Collections.sort(sortedAlts);
	for (Iterator altsIt = sortedAlts.iterator(); altsIt.hasNext();) {
		Integer altI = (Integer) altsIt.next();
		Map targetToCallSiteMap =
			(Map)altToTargetToCallSitesMap.get(altI);
		Set targetRules = targetToCallSiteMap.keySet();
		Collection callSiteStates = targetToCallSiteMap.values();
		DFAState sampleBadState = (DFAState)altToDFAState.get(altI);
		ErrorManager.recursionOverflow(this,
									   sampleBadState,
									   altI.intValue(),
									   targetRules,
									   callSiteStates);
	}

	/* All  recursion determines now before analysis
	// LEFT RECURSION
	// TODO: hideous cut/paste of code; try to refactor

	Set dfaStatesWithLeftRecursionProblems =
		stateToLeftRecursiveConfigurationsMap.keySet();
	Set dfaStatesUnaliased =
		getUnaliasedDFAStateSet(dfaStatesWithLeftRecursionProblems);

	// now walk truly unique (unaliased) list of dfa states with inf recur
	// Goal: create a map from alt to map<target,List<callsites>>
	// Map<Map<String target, List<NFAState call sites>>
	altToTargetToCallSitesMap = new HashMap();
	// track a single problem DFA state for each alt
	altToDFAState = new HashMap();
	computeAltToProblemMaps(dfaStatesUnaliased,
							stateToLeftRecursiveConfigurationsMap,
							altToTargetToCallSitesMap, // output param
							altToDFAState);            // output param

	// walk each alt with recursion overflow problems and generate error
	alts = altToTargetToCallSitesMap.keySet();
	sortedAlts = new ArrayList(alts);
	Collections.sort(sortedAlts);
	for (Iterator altsIt = sortedAlts.iterator(); altsIt.hasNext();) {
		Integer altI = (Integer) altsIt.next();
		Map targetToCallSiteMap =
			(Map)altToTargetToCallSitesMap.get(altI);
		Set targetRules = targetToCallSiteMap.keySet();
		Collection callSiteStates = targetToCallSiteMap.values();
		ErrorManager.leftRecursion(this,
								   altI.intValue(),
								   targetRules,
								   callSiteStates);
	}
	*/
}
 
开发者ID:Sable,项目名称:mclab-core,代码行数:72,代码来源:DecisionProbe.java


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