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


Java Tools.isVar方法代码示例

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


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

示例1: eval

import org.spoofax.interpreter.core.Tools; //导入方法依赖的package包/类
@Override
public IConstruct eval(final IContext env) throws InterpreterException {

	if (DebugUtil.isDebugging()) {
		debug("CallDynamic.eval() - ", env.current());
	}

	if (Tools.isTermAppl(sref) && Tools.isVar((IStrategoAppl) sref, env)) {
		IStrategoTerm actualSRef = env.lookupVar(Tools.javaStringAt(
				(IStrategoAppl) sref, 0));
		if (Tools.isTermString(actualSRef)) {
			String sname = Tools.asJavaString(actualSRef);
			Strategy callt = new CallT(sname, svars, tvars);
			callt.getHook().push(this.getHook().pop());
			return callt.eval(env);
		}
	}
	throw new InterpreterException(
			"Invocation target is invalid (cannot be evaluated): " + sref);

}
 
开发者ID:metaborg,项目名称:mb-exec,代码行数:22,代码来源:CallDynamic.java

示例2: buildTerm

import org.spoofax.interpreter.core.Tools; //导入方法依赖的package包/类
public IStrategoTerm buildTerm(IContext env, IStrategoAppl t) throws InterpreterException {

        ITermFactory factory = env.getFactory();

        if (Tools.isAnno(t, env)) {
            return buildAnno(env, t);
        }
        else if (Tools.isOp(t, env)) {
            return buildOp(env, t, factory);
        }
        else if (Tools.isInt(t, env)) {
            return buildInt(t, factory);
        }
        else if (Tools.isReal(t, env)) {
            return buildReal(t, factory);
        }
        else if (Tools.isStr(t, env)) {
            return buildStr(t);
        }
        else if (Tools.isVar(t, env)) {
            return buildVar(env, t);
        }
        else if (Tools.isExplode(t, env)) {
            return buildExplode(env, t);
        }

        throw new InterpreterException("Unknown build constituent '" + t.getConstructor() + "'");
    }
 
开发者ID:metaborg,项目名称:mb-exec,代码行数:29,代码来源:Build.java

示例3: matchAppl

import org.spoofax.interpreter.core.Tools; //导入方法依赖的package包/类
public Results matchAppl(IContext env, IStrategoAppl t,
        IStrategoAppl p) throws InterpreterException {

    if (Tools.isAnno(p, env)) {
        return matchAnyAnno(env, t, p);
    }
    else if (Tools.isOp(p, env)) {
        return matchApplOp(env, t, p);
    }
    else if (Tools.isInt(p, env)) {
        return matchApplInt(env, t, p);
    }
    else if (Tools.isStr(p, env)) {
        return null;
    }
    else if (Tools.isVar(p, env)) {
        return matchAnyVar(t, p);
    }
    else if (Tools.isExplode(p, env)) {
        return matchAnyExplode(env, t, p);
    }
    else if (Tools.isAs(p, env)) {
        return matchCompoundAs(env, t, p);
    }
    else if (Tools.isWld(p, env)) {
        return matchAnyWld(p);
    }

    throw new InterpreterException("Unknown Appl case '" + p + "'");
}
 
开发者ID:metaborg,项目名称:mb-exec,代码行数:31,代码来源:Match.java

示例4: matchInt

import org.spoofax.interpreter.core.Tools; //导入方法依赖的package包/类
protected Results matchInt(IContext env, IStrategoInt t,
        IStrategoAppl p) throws InterpreterException {

    if (DebugUtil.isDebugging()) {
        debug("term is Int");
    }

    if (Tools.isAnno(p, env)) {
        return matchAnyAnno(env, t, p);
    }
    else if (Tools.isInt(p, env)) {
        return matchIntInt(t, p);
    }
    else if (Tools.isReal(p, env)) {
        return null;
    }
    else if (Tools.isVar(p, env)) {
        return matchAnyVar(t, p);
    }
    else if (Tools.isOp(p, env)) {
        return null;
    }
    else if (Tools.isExplode(p, env)) {
        return matchAnyExplode(env, t, p);
    }
    else if (Tools.isWld(p, env)) {
        return matchAnyWld(p);
    }
    else if (Tools.isAs(p, env)) {
        return matchCompoundAs(env, t, p);
    } else if(Tools.isStr(p, env)) {
        return null;
    }

    throw new InterpreterException("Unknown Int case '" + p + "'");
}
 
开发者ID:metaborg,项目名称:mb-exec,代码行数:37,代码来源:Match.java

示例5: matchReal

import org.spoofax.interpreter.core.Tools; //导入方法依赖的package包/类
protected Results matchReal(IContext env, IStrategoReal t,
        IStrategoAppl p) throws InterpreterException {

    if (DebugUtil.isDebugging()) {
        debug("term is Real");
    }

    if (Tools.isAnno(p, env)) {
        return matchAnyAnno(env, t, p);
    }
    else if (Tools.isInt(p, env)) {
        return null;
    }
    else if (Tools.isReal(p, env)) {
        return matchRealReal(t, p);
    }
    else if (Tools.isVar(p, env)) {
        return matchAnyVar(t, p);
    }
    else if (Tools.isOp(p, env)) {
        return null;
    }
    else if (Tools.isExplode(p, env)) {
        return matchAnyExplode(env, t, p);
    }
    else if (Tools.isWld(p, env)) {
        return matchAnyWld(p);
    }
    else if (Tools.isAs(p, env)) {
        return matchCompoundAs(env, t, p);
    } else if (Tools.isStr(p, env)) {
        return null;
    }

    throw new InterpreterException("Unknown Real case '" + p + "'");
}
 
开发者ID:metaborg,项目名称:mb-exec,代码行数:37,代码来源:Match.java

示例6: matchBlob

import org.spoofax.interpreter.core.Tools; //导入方法依赖的package包/类
private Results matchBlob(IContext env, IStrategoTerm t, IStrategoAppl p) throws InterpreterException {
    if (DebugUtil.isDebugging()) {
        debug("term is Blob");
    }
    if (Tools.isAnno(p, env)) {
        return matchAnyAnno(env, t, p);
    }
    else if (Tools.isWld(p, env)) {
        return matchAnyWld(p);
    }
    else if (Tools.isAs(p, env)) {
        return matchCompoundAs(env, t, p);
    }
    else if (Tools.isVar(p, env)) {
        return matchAnyVar(t, p);
    }
    else if (Tools.isExplode(p, env)) {
        return null; // FIXME: explode blobs?
    } 
    else if (Tools.isStr(p, env)) {
        return null;
    }
    else if (Tools.isInt(p, env)) {
        return null;
    }
    else if (Tools.isReal(p, env)) {
        return null;
    }
    else if (Tools.isOp(p, env)) {
        return null;
    }

    throw new InterpreterException("Unknown Tuple case '" + p + "'");
}
 
开发者ID:metaborg,项目名称:mb-exec,代码行数:35,代码来源:Match.java

示例7: matchTuple

import org.spoofax.interpreter.core.Tools; //导入方法依赖的package包/类
private Results matchTuple(IContext env, IStrategoTuple t, IStrategoAppl p) throws InterpreterException {
    if (DebugUtil.isDebugging()) {
        debug("term is Tuple");
    }
    if (Tools.isAnno(p, env)) {
        return matchAnyAnno(env, t, p);
    }
    else if (Tools.isInt(p, env)) {
        return null;
    }
    else if (Tools.isReal(p, env)) {
        return null;
    }
    else if (Tools.isVar(p, env)) {
        return matchAnyVar(t, p);
    }
    else if (Tools.isOp(p, env)) {
        return matchTupleOp(env, t, p);
    }
    else if (Tools.isWld(p, env)) {
        return matchAnyWld(p);
    }
    else if (Tools.isAs(p, env)) {
        return matchCompoundAs(env, t, p);
    }
    else if (Tools.isExplode(p, env)) {
        return matchAnyExplode(env, t, p);
    } 
    else if (Tools.isStr(p, env)) {
        return null;
    }

    throw new InterpreterException("Unknown Tuple case '" + p + "'");
}
 
开发者ID:metaborg,项目名称:mb-exec,代码行数:35,代码来源:Match.java

示例8: matchList

import org.spoofax.interpreter.core.Tools; //导入方法依赖的package包/类
protected Results matchList(IContext env, IStrategoList t,
        IStrategoAppl p) throws InterpreterException {

    if (DebugUtil.isDebugging()) {
        debug("term is List");
    }

    if (Tools.isAnno(p, env)) {
        return matchAnyAnno(env, t, p);
    }
    else if (Tools.isInt(p, env)) {
        return null;
    }
    else if (Tools.isReal(p, env)) {
        return null;
    }
    else if (Tools.isVar(p, env)) {
        return matchAnyVar(t, p);
    }
    else if (Tools.isOp(p, env)) {
        return matchListOp(env, t, p);
    }
    else if (Tools.isWld(p, env)) {
        return matchAnyWld(p);
    }
    else if (Tools.isAs(p, env)) {
        return matchCompoundAs(env, t, p);
    }
    else if (Tools.isExplode(p, env)) {
        return matchAnyExplode(env, t, p);
    }
    else if (Tools.isStr(p, env)) {
        return null;
    }

    throw new InterpreterException("Unknown List case '" + p + "'");
}
 
开发者ID:metaborg,项目名称:mb-exec,代码行数:38,代码来源:Match.java

示例9: matchString

import org.spoofax.interpreter.core.Tools; //导入方法依赖的package包/类
private Results matchString(IContext env, IStrategoString t, IStrategoAppl p) throws InterpreterException {
    if (DebugUtil.isDebugging()) {
        debug("term is String");
    }
    
    if (Tools.isAnno(p, env)) {
        return matchAnyAnno(env, t, p);
    }
    else if(Tools.isStr(p, env)) {
        return matchStrStr(env, t, p);
    }
    else if (Tools.isInt(p, env)) {
        return null;
    }
    else if (Tools.isReal(p, env)) {
        return null;
    }
    else if (Tools.isVar(p, env)) {
        return matchAnyVar(t, p);
    }
    else if (Tools.isOp(p, env)) {
        return null;
    }
    else if (Tools.isExplode(p, env)) {
        return matchAnyExplode(env, t, p);
    }
    else if (Tools.isWld(p, env)) {
        return matchAnyWld(p);
    }
    else if (Tools.isAs(p, env)) {
        return matchCompoundAs(env, t, p);
    } 

    throw new InterpreterException("Unknown String case '" + p + "'");
}
 
开发者ID:metaborg,项目名称:mb-exec,代码行数:36,代码来源:Match.java


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