Package wycs.core

Examples of wycs.core.WycsFile.declaration()


        if (module == null) {
            throw new InternalError("module '" + code.nid.module() + "' not found");
        }

        WycsFile.Declaration decl = module.declaration(code.nid.name());

        if (decl == null) {
            throw new InternalError(
                    "function call to a non-declared function (name=" + code.nid.name() + ")");
        }
View Full Code Here


    for (WyalFile.Import imp : context.imports()) {
      for (Path.ID id : imports(imp.filter)) {
        try {
          WycsFile wf = getModule(id);
          if(wf == null) { continue; }
          T d = wf.declaration(name, type);
          if (d != null) {
            return new Pair<NameID, T>(new NameID(id, name), d);
          }
        } catch(SyntaxError e) {
          throw e;
View Full Code Here

      // library is not on the path as e.g. x[i] is translated into
      // a call to wycs.core.Map.IndexOf().
      if(module == null) {
        internalFailure("cannot resolve as module: " + e.nid.module(), filename, e);
      }
      Object d = module.declaration(e.nid.name());
      if(d instanceof WycsFile.Function) {
        // Do nothing, since functions are not expanded like macros.
        // Instead, their axioms may be instantiated later either before
        // or during rewriting.
      } else if (d instanceof WycsFile.Macro) {
View Full Code Here

  private Code instantiateAxioms(Code.FunCall condition, int freeVariable) {
    ArrayList<Code> axioms = new ArrayList<Code>();
    try {
      WycsFile module = builder.getModule(condition.nid.module());
      // module should not be null if TypePropagation has already passed.
      Object d = module.declaration(condition.nid.name());
      if(d instanceof WycsFile.Function) {
        WycsFile.Function fn = (WycsFile.Function) d;
        if(fn.constraint != null) {
          // There are some axioms we can instantiate. First, we need to
          // construct the generic binding for this function.
View Full Code Here

    instantiateFromExpression(expression.operands[0], axioms, freeVariable);

    try {
      WycsFile module = builder.getModule(expression.nid.module());
      // module should not be null if TypePropagation has already passed.
      WycsFile.Function fn = module.declaration(expression.nid.name(),
          WycsFile.Function.class);
      if (fn.constraint != null) {
        // There are some axioms we can instantiate. First, we need to
        // construct the generic binding for this function.
        HashMap<String, SemanticType> generics = buildGenericBinding(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.