Examples of Scope


Examples of org.python.indexer.Scope

    public void testClassTypeBuiltinAttrs() throws Exception {
        String file = "classtype_builtins.py";
        buildIndex(file);
        NModuleType module = (NModuleType)idx.moduleTable.lookupType(abspath(file));
        Scope mtable = module.getTable();
        assertTrue(mtable.lookupType("MyClass").isClassType());
        assertTrue(mtable.lookupType("MyClassNoDoc").isClassType());
        assertTrue(mtable.lookupType("MyClass").getTable().getParent() == mtable);
        assertEquals(NBinding.Kind.CLASS, mtable.lookup("MyClass").getKind());
        Scope t = mtable.lookupType("MyClass").getTable();
        assertTrue(t.lookupType("__bases__").isTupleType());
        assertTrue(t.lookupType("__dict__").isDictType());
        assertEquals(idx.builtins.BaseStr, t.lookupType("__name__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__module__"));
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
        t = mtable.lookupType("MyClassNoDoc").getTable();
        assertEquals(idx.builtins.BaseStr, t.lookupType("__doc__"));
    }
View Full Code Here

Examples of org.red5.server.scope.Scope

    System.setProperty("red5.deployment.type", "junit");
    if (pss == null) {
      pss = (PlaylistSubscriberStream) applicationContext.getBean("playlistSubscriberStream");
      Context ctx = new Context();
      ctx.setApplicationContext(applicationContext);
      Scope scope = new DummyScope();
      scope.setName("");
      scope.setContext(ctx);
      pss.setScope(scope);
      //
      ISchedulingService schedulingService = (ISchedulingService) applicationContext.getBean(ISchedulingService.BEAN_NAME);
      IConsumerService consumerService = (IConsumerService) applicationContext.getBean(IConsumerService.KEY);
      IProviderService providerService = (IProviderService) applicationContext.getBean(IProviderService.BEAN_NAME);
View Full Code Here

Examples of org.sdnplatform.sync.ISyncService.Scope

                throws Exception {
            if (tokens.length < 3) {
                err.println("Usage: " + syntaxString());
                return false;
            }
            Scope scope = Scope.LOCAL;
            if ("global".equals(tokens[2]))
                scope = Scope.GLOBAL;

            syncClientSettings.storeName = tokens[1];
            syncManager.registerStore(syncClientSettings.storeName, scope);
View Full Code Here

Examples of org.springframework.beans.factory.config.Scope

        bean = getObjectForBeanInstance(prototypeInstance, name, beanName);
      }

      else {
        String scopeName = mbd.getScope();
        final Scope scope = (Scope) this.scopes.get(scopeName);
        if (scope == null) {
          throw new IllegalStateException("No Scope registered for scope '" + scopeName + "'");
        }
        try {
          Object scopedInstance = scope.get(beanName, new ObjectFactory() {
            public Object getObject() throws BeansException {
              beforePrototypeCreation(beanName);
              try {
                return createBean(beanName, mbd, args);
              }
View Full Code Here

Examples of org.useware.kernel.model.scopes.Scope

    public StatementContext getContext(QName interactionUnitId) {

        final Node<Scope> self = dialog.getScopeModel().findNode(interactionUnitId);
        assert self!=null : "Unit not present in shim: "+ interactionUnitId;

        Scope scope = self.getData();

        // lazy initialisation
        if(!scope2context.containsKey(scope.getScopeId()))
        {

            // extract parent scopes

            List<Node<Scope>> parentScopeNodes = self.collectParents(new NodePredicate<Scope>() {
                Set<Integer> tracked = new HashSet<Integer>();

                @Override
                public boolean appliesTo(Node<Scope> candidate) {
                    if (self.getData().getScopeId() != candidate.getData().getScopeId()) {
                        if (!tracked.contains(candidate.getData().getScopeId())) {
                            tracked.add(candidate.getData().getScopeId());
                            return true;
                        }

                        return false;
                    }

                    return false;
                }
            });

            // delegation scheme
            List<Integer> parentScopeIds = new LinkedList<Integer>();
            for(Node<Scope> parentNode : parentScopeNodes)
            {
                parentScopeIds.add(parentNode.getData().getScopeId());
            }

            scope2context.put(scope.getScopeId(),
                    new ParentDelegationContextImpl(scope, externalContext, parentScopeIds,
                            new Scopes() {
                                @Override
                                public StatementContext get(Integer scopeId) {
                                    return scope2context.get(scopeId);
                                }
                            })
            );
        }

        return scope2context.get(scope.getScopeId());
    }
View Full Code Here

Examples of org.yinwang.yin.Scope

    public static Declare parseDeclare(Tuple tuple) throws ParserException {
        List<Node> elements = tuple.elements;
        if (elements.size() < 2) {
            throw new ParserException("syntax error in record type definition", tuple);
        }
        Scope properties = parseProperties(elements.subList(1, elements.size()));
        return new Declare(properties, tuple.file, tuple.start, tuple.end, tuple.line, tuple.col);
    }
View Full Code Here

Examples of org.zkoss.zk.ui.ext.Scope

  public boolean isActive() {
    return getZKScope() != null;
  }
 
  private Map getScopeAttributes() {
    final Scope scope = getZKScope();
    return scope != null ? scope.getAttributes() : null;
  }
View Full Code Here

Examples of railo.runtime.type.scope.Scope

  public static List testVariables(PageContextImpl pc,String strScope) throws FDLanguageException {
    return new FDStackFrameImpl(null,pc,null,null).getVariables(strScope);
  }
 
  private static List getVariables(FDStackFrameImpl frame,PageContextImpl pc,List list,String strScope) throws FDLanguageException {
    Scope scope;
    try {
      scope = pc.scope(strScope, null);
      if(scope!=null) return copyValues(frame,list,scope);
     
      Object value=pc.undefinedScope().get(strScope,null);
View Full Code Here

Examples of rs.etf.pp1.symboltable.concepts.Scope

   * Inicijalizacija universe opsega, tj. njegovo popunjavanje Obj cvorovima,
   * kao sto je izlozeno na vezbama i predavanjima. Razlika je sto se Obj
   * cvorovu umecu u hes tabelu.
   */
  public static void init() {
    Scope universe = currentScope = new Scope(null);
   
    universe.addToLocals(new Obj(Obj.Type, "int", intType));
    universe.addToLocals(new Obj(Obj.Type, "char", charType));
    universe.addToLocals(new Obj(Obj.Con, "eol", charType, 10, 0));
    universe.addToLocals(new Obj(Obj.Con, "null", nullType, 0, 0));
   
    universe.addToLocals(chrObj = new Obj(Obj.Meth, "chr", charType, 0, 1));
    {
      openScope();
      currentScope.addToLocals(new Obj(Obj.Var, "i", intType, 0, 1));
      chrObj.setLocals(currentScope.getLocals());
      closeScope();
    }
   
    universe.addToLocals(ordObj = new Obj(Obj.Meth, "ord", intType, 0, 1));
    {
      openScope();
      currentScope.addToLocals(new Obj(Obj.Var, "ch", charType, 0, 1));
      ordObj.setLocals(currentScope.getLocals());
      closeScope();
    }
   
   
    universe.addToLocals(lenObj = new Obj(Obj.Meth, "len", intType, 0, 1));
    {
      openScope();
      currentScope.addToLocals(new Obj(Obj.Var, "arr", new Struct(Struct.Array, noType), 0, 1));
      lenObj.setLocals(currentScope.getLocals());
      closeScope();
View Full Code Here

Examples of se.jbee.inject.Scope

    private Suppliable<?>[] link( Binding<?>[] bindings ) {
      Map<Scope, Repository> repositories = initRepositories( bindings );
      Suppliable<?>[] suppliables = new Suppliable<?>[bindings.length];
      for ( int i = 0; i < bindings.length; i++ ) {
        Binding<?> binding = bindings[i];
        Scope scope = binding.scope;
        Expiry expiry = expiryByScope.get( scope );
        if ( expiry == null ) {
          expiry = Expiry.NEVER;
        }
        suppliables[i] = suppliableOf( binding, repositories.get( scope ), expiry );
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.