Package com.stuffwithstuff.magpie.interpreter

Examples of com.stuffwithstuff.magpie.interpreter.Scope


    }

    protected Set<Entry<String, Multimethod>> findMultimethods(Context context, Obj matchingValue) {
      Map<String, Multimethod> matching = new TreeMap<String, Multimethod>();

      Scope scope = context.getModule().getScope();
      while (scope != null) {
        for(Entry<String, Multimethod> multimethod : scope.getMultimethods().entrySet()) {
          for(Callable method : multimethod.getValue().getMethods()) {
            if(isMatchingMethod(matchingValue, context, method)) {
              matching.put(multimethod.getKey(), multimethod.getValue());
              break;
            }
          } 
        }
        scope = scope.getParent();
      }
      return matching.entrySet();
    }
View Full Code Here


    Pair<String, Pattern> parsed = parser.parseSignature();

    String name = parsed.getKey();
    Pattern pattern = parsed.getValue();
   
    Scope scope = mInterpreter.getBaseModule().getScope();
   
    // Construct the method.
    Callable callable = new IntrinsicCallable(pattern, doc, new MethodWrapper(method), scope);
   
    // Register it.
    scope.define(name, callable);
  }
View Full Code Here

TOP

Related Classes of com.stuffwithstuff.magpie.interpreter.Scope

Copyright © 2018 www.massapicom. 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.