Examples of Node


Examples of AfterValueChangeTest.Node

     * display<p>
     * <p>
     */
    public void display() {
        this.setAf(new Array_Of_Node<Node>());
        this.getAf().add(new Node());

        UserWindow.open(this);
        // ----------
        // Event Loop
        // ----------

Examples of EDU.purdue.jtb.syntaxtree.Node

   private static String version = Globals.version;
   private static String scriptName = Globals.scriptName;

   public static void main(String args[]) {
      JTBParser parser;
      Node root;

      try { if ( !processCommandLine(args) ) return; }
      catch (InvalidCommandLineException e) {
         System.err.println(progName + ":  " + e.getMessage());
         return;
      }
      catch (Exception e) { Errors.hardErr(e.getMessage()); }

      System.err.println(progName + " version " + version);
      System.err.println(progName + ":  Reading from " + Globals.inFilename +
                         "...");
      parser = new JTBParser(in);

      try {
         root = parser.JavaCCInput();
         System.err.println(progName + ":  Input file parsed successfully.");

         //
         // Perform actions based on command-line flags
         //
         ClassGenerator vcg = new ClassGenerator();
         Vector list;
         FileGenerator gen = null;

         Errors.resetCounts();

         if ( !Globals.noSemanticCheck ) {
            root.accept(new SemanticChecker());

            if ( Errors.errorCount() > 0 ) {
               Errors.printSummary();
               return;
            }
         }

         root.accept(vcg);              // create the class list
         list = vcg.getClassList();

         if ( Errors.errorCount() > 0 ) {
            Errors.printSummary();
            return;
         }

         if ( Globals.printGrammarToOut ) root.accept(new Printer(System.out));
         if ( Globals.printClassList ) {
            gen = new FileGenerator(list);
            System.out.println("\nThe classes generated and the fields each " +
                               "contains are as follows:\n");
            gen.printClassList(new PrintWriter(System.out, true));
         }

         if ( Globals.generateFiles ) {
            Annotator annotator;

            try {
               root.accept(new Annotator());

               if ( Errors.errorCount() > 0 ) {
                  Errors.printSummary();
                  return;
               }

               System.err.println(progName + ":  \"" + Globals.outFilename +
                                  "\" generated to current directory.");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  \"" + Globals.outFilename +
                                  "\" already exists.  Won't overwrite.");
            }

            if ( gen == null ) {
               gen = new FileGenerator(list);

               if ( Errors.errorCount() > 0 ) {
                  Errors.printSummary();
                  return;
               }
            }

            try { gen.generateAutoClassFiles(); }
            catch (FileExistsException e) {
               System.err.println(progName + ":  One or more of the automatic "+
                  "node class files already exists.  Won't overwrite.");
            }

            try {
               gen.generateClassFiles();
               System.err.println(progName + ":  Syntax tree Java source " +
                  "files generated to directory \"" + Globals.nodeDir + "\".");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  One or more of the generated "+
                  "node class files already exists.  Won't overwrite.");
            }
     
      System.err.println();

            try {
               gen.generateVisitorFile();
               System.err.println(progName + ":  \"" + Globals.GJVisitorName +
                  ".java\" generated " + "to directory \"" +
                  Globals.visitorDir + "\".");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  \"" + Globals.GJVisitorName +
                  "\" already exists.  Won't overwrite.");
            }

      try {
               new OldFileGenerator(list).generateVisitorFile();
               System.err.println(progName + ":  \"" + Globals.visitorName +
                  ".java\" generated " + "to directory \"" +
                  Globals.visitorDir + "\".");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  \"" + Globals.visitorName +
                  "\" already exists.  Won't overwrite.");
            }

      try {
               new NoArguFileGenerator(list).generateVisitorFile();
               System.err.println(progName + ":  \"" + Globals.GJNoArguVisitorName +
                  ".java\" generated " + "to directory \"" +
                  Globals.visitorDir + "\".");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  \"" + Globals.GJNoArguVisitorName +
                  "\" already exists.  Won't overwrite.");
            }

      try {
               new VoidFileGenerator(list).generateVisitorFile();
               System.err.println(progName + ":  \"" + Globals.GJVoidVisitorName +
                  ".java\" generated " + "to directory \"" +
                  Globals.visitorDir + "\".");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  \"" + Globals.GJVoidVisitorName +
                  "\" already exists.  Won't overwrite.");
            }

            try {
               new GJDepthFirstVisitorBuilder(list).generateDepthFirstVisitor();
               System.err.println(progName + ":  \"" +
                  GJDepthFirstVisitorBuilder.outFilename + "\" " +
                  "generated to directory \"" + Globals.visitorDir + "\".");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  \"" +
                  GJDepthFirstVisitorBuilder.outFilename + "\" already exists.  "+
                  "Won't overwrite.");
            }

      try {
         new OldDepthFirstVisitorBuilder(list).generateDepthFirstVisitor();
               System.err.println(progName + ":  \"" +
                  OldDepthFirstVisitorBuilder.outFilename + "\" " +
                  "generated to directory \"" + Globals.visitorDir + "\".");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  \"" +
                  OldDepthFirstVisitorBuilder.outFilename + "\" already exists.  "+
                  "Won't overwrite.");
            }

            try {
               new GJNoArguDepthFirstBuilder(list).generateDepthFirstVisitor();
               System.err.println(progName + ":  \"" +
                  GJNoArguDepthFirstBuilder.outFilename + "\" " +
                  "generated to directory \"" + Globals.visitorDir + "\".");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  \"" +
                  GJNoArguDepthFirstBuilder.outFilename + "\" already exists.  "+
                  "Won't overwrite.");
            }

            try {
               new GJVoidDepthFirstBuilder(list).generateDepthFirstVisitor();
               System.err.println(progName + ":  \"" +
                  GJVoidDepthFirstBuilder.outFilename + "\" " +
                  "generated to directory \"" + Globals.visitorDir + "\".");
            }
            catch (FileExistsException e) {
               System.err.println(progName + ":  \"" +
                  GJDepthFirstVisitorBuilder.outFilename + "\" already exists.  "+
                  "Won't overwrite.");
            }

      System.err.println();

            if ( Globals.schemeToolkit ) {
               root.accept(new SchemeSemanticChecker());

               if ( Errors.errorCount() > 0 ) {
                  Errors.printSummary();
                  return;
               }

Examples of aStarLibrary.Node

      boolean isWalkable,
      Room room,
      DataMap referenceMap
  ) {
    super(id, objectType, referenceMap);
    this._node = new Node(new float[] {x, y});
    this._node.walkable = isWalkable;
    this._roomId = room.getId();
  }

Examples of abstrasy.Node

     * @return
     * @throws Exception
     */
    private static final Object getArgExternalInstance(Node commande, int argindex, int accessType) throws Exception {
        // retourne l'argument Objet (VObject)
        Node src = commande.getSubNode(argindex, Node.TYPE_NAMESPACE);
        src.requireAccessType(accessType);
        // objet client externe...
        return src.getExternalInstanceOf();
    }

Examples of aima.core.probability.bayes.Node

    public boolean containsValue(RandomVariable rv) {
      return varIdxs.get(rv) <= extendedIdx;
    }

    public double posteriorForParents(RandomVariable rv) {
      Node n = bn.getNode(rv);
      if (!(n instanceof FiniteNode)) {
        throw new IllegalArgumentException(
            "Enumeration-Ask only works with finite Nodes.");
      }
      FiniteNode fn = (FiniteNode) n;
      Object[] vals = new Object[1 + fn.getParents().size()];
      int idx = 0;
      for (Node pn : n.getParents()) {
        vals[idx] = extendedValues[varIdxs.get(pn.getRandomVariable())];
        idx++;
      }
      vals[idx] = extendedValues[varIdxs.get(rv)];

Examples of aima.core.search.framework.Node

   */
  public List<Action> search(Problem p) throws Exception {
    clearInstrumentation();
    // return RECURSIVE-DLS(MAKE-NODE(INITIAL-STATE[problem]), problem,
    // limit)
    return recursiveDLS(new Node(p.getInitialState()), p, limit);
  }

Examples of alex.zhrenjie04.wordfilter.search.tree.Node

        }
    }
  }

  private static void insertWord(String word,int level){
    Node node = tree;
    for(int i=0;i<word.length();i++){
      node = node.addChar(word.charAt(i));
    }
    node.setEnd(true);
    node.setLevel(level);
  }

Examples of anvil.script.expression.Node

      context.location(_expression.getLocation());
    }
    if (in_generator) {
   
      if (_index != null) {
        _indexvar.compile(context, new Node()
        {
          public void compile(ByteCompiler context, int operation)
          {
            Code code_ = context.getCode();
            code_.getstatic(code_.getPool().addFieldRef(
              context.TYPE_ANY, "ZERO", "Lanvil/core/Any;"));
          }
        });
        code.pop();
      }

      int clazz1 = pool.addClass("java/util/Enumeration");
      int clazz2 = pool.addClass("anvil/java/util/BindingEnumeration");
      int clazz3 = pool.addClass("anvil/core/AnyBindingEnumeration");
      code.anew(clazz3);
      code.dup();
      _expression.compile(context, Expression.GET);
      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY, "enumeration", "()Lanvil/java/util/BindingEnumeration;"));
      code.invokespecial(pool.addMethodRef(clazz3, "<init>", "(Lanvil/java/util/BindingEnumeration;)V"));
      final int tmp = code.addLocal();
      code.astore(tmp);
      _enumvar.compile(context, new Node()
      {
        public void compile(ByteCompiler context, int operation)
        {
          context.getCode().aload(tmp);
        }
      });
      code.endLocal(tmp);
      code.pop();

      Target start = code.getTarget();
      _startscope = code.getSource();
      _endscope = code.getSource();

      _enumvar.compile(context, Node.GET);
      code.invokeinterface(pool.addInterfaceMethodRef(clazz1, "hasMoreElements", "()Z"));
      code.if_eq(_endscope);

      if (_index != null) {
       
        new AssignmentNode(new ExpressionList(_index,
          new Node() {
            public void compile(ByteCompiler context, int operation)
            {
              _indexvar.compile(context, GET);
            }
          })).compile(context, Node.GET);
         
        code.pop();
       
        _indexvar.compile(context, new Node() {
          public void compile(ByteCompiler context, int operation)
          {
            Code code_ = context.getCode();
            _indexvar.compile(context, GET);
            code_.invokevirtual(code_.getPool().addMethodRef(context.TYPE_ANY,
              "increase", "()Lanvil/core/Any;"));
          }
        });
        code.pop();
      }

      if (_key != null) {
        new AssignmentNode(new ExpressionList(_key,
          new Node() {
            public void compile(ByteCompiler context, int operation)
            {
              Code code_ = context.getCode();
              ConstantPool pool_ = code_.getPool();
              _enumvar.compile(context, Node.GET);
              code_.invokeinterface(pool_.addInterfaceMethodRef("anvil/java/util/BindingEnumeration", "nextKey", "()Ljava/lang/Object;"));
              code_.invokestatic(pool_.addMethodRef(context.TYPE_ANY, "create", "(Ljava/lang/Object;)Lanvil/core/Any;"));
            }
          })).compile(context, Node.GET);
        code.pop();
      }


      if (_value != null) {
        new AssignmentNode(new ExpressionList(_value,
          new Node() {
            public void compile(ByteCompiler context, int operation)
            {
              Code code_ = context.getCode();
              ConstantPool pool_ = code_.getPool();
              _enumvar.compile(context, Node.GET);
              code_.invokeinterface(pool_.addInterfaceMethodRef("java/util/Enumeration", "nextElement", "()Ljava/lang/Object;"));
              code_.invokestatic(pool_.addMethodRef(context.TYPE_ANY, "create", "(Ljava/lang/Object;)Lanvil/core/Any;"));
            }
          })).compile(context, Node.GET);
        code.pop();

      } else
        _enumvar.compile(context, Node.GET);
        code.invokeinterface(pool.addInterfaceMethodRef(clazz1, "nextElement", "()Ljava/lang/Object;"));
        code.pop();

      }

      _statement.compile(context);
      code.go_to(_startscope);
      _endscope.bind();
      _startscope.bind(start);

    } else {

      final int l_enum = code.addLocal();
      final int l_index = (_index != null) ? code.addLocal() : 0;
      if (l_index != 0) {
        code.iconst(0);
        code.istore(l_index);
      }

      // create enumeration, and wrap it
      int clazz1 = pool.addClass("java/util/Enumeration");
      int clazz2 = pool.addClass("anvil/java/util/BindingEnumeration");
      _expression.compile(context, Expression.GET);
      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY, "enumeration", "()Lanvil/java/util/BindingEnumeration;"));
      code.astore(l_enum);
      int sun_hack_1 = 10 + l_enum;

      Target start = code.getTarget();
      _startscope = code.getSource();
      _endscope = code.getSource();

      code.aload(l_enum);
      int sun_hack_2 = 10 + l_enum;
     
      code.invokeinterface(pool.addInterfaceMethodRef(clazz1, "hasMoreElements", "()Z"));
      code.if_eq(_endscope);

      if (_index != null) {
        new AssignmentNode(new ExpressionList(_index,
          new Node() {
            public void compile(ByteCompiler context, int operation)
            {
              Code code_ = context.getCode();
              code_.iload(l_index);
              code_.iinc(l_index, 1);
              code_.invokestatic(code_.getPool().addMethodRef(
                context.TYPE_ANY, "create", "(I)Lanvil/core/Any;"));
            }
          })).compile(context, Node.GET);
        code.pop();
      }

      if (_key != null) {
        new AssignmentNode(new ExpressionList(_key,
          new Node() {
            public void compile(ByteCompiler context, int operation)
            {
              Code code_ = context.getCode();
              ConstantPool pool_ = code_.getPool();
              code_.aload(l_enum);
              code_.invokeinterface(pool_.addInterfaceMethodRef("anvil/java/util/BindingEnumeration", "nextKey", "()Ljava/lang/Object;"));
              code_.invokestatic(pool_.addMethodRef(context.TYPE_ANY, "create", "(Ljava/lang/Object;)Lanvil/core/Any;"));
            }
          })).compile(context, Node.GET);
        code.pop();
      }

      if (_value != null) {
        new AssignmentNode(new ExpressionList(_value,
          new Node() {
            public void compile(ByteCompiler context, int operation)
            {
              Code code_ = context.getCode();
              ConstantPool pool_ = code_.getPool();
              code_.aload(l_enum);

Examples of at.salzburgresearch.nodekeeper.model.Node

            if(path.matches(pattern)) {
                for(NodeListener listener : listeners.get(pattern)) {
                    if(handlers.containsKey(listener.getType())) {
                        switch (version) {
                            case NodeCreated:
                                listener.onNodeCreated(new Node(path,handlers.get(listener.getType()).parse(zk.getData(path,this,stat))));
                                setStatus(path,stat.getVersion());
                                break;
                            case NodeDataChanged:
                                listener.onNodeUpdated(new Node(path,handlers.get(listener.getType()).parse(zk.getData(path,this,stat))));
                                setStatus(path,stat.getVersion());
                                break;
                            case NodeDeleted:
                                listener.onNodeDeleted(new Node(path));
                                removeStatus(path);
                                break;
                        }
                    } else throw new NodeKeeperException(String.format("cannot handle type %s",listener.getType()));
                }

Examples of att.grappa.Node

  public void addOutputEdge(EclipseCFGEdge edge) {
    outputs.add(edge);
  }

  public Node addToGraph(Graph graph) {
    Node thisNode = graph.findNodeByName(myId);

    if (thisNode == null) {
      thisNode = new Node(graph);
      thisNode.setName(myId);
      thisNode.setAttribute(Node.LABEL_ATTR, getName());
      thisNode.setAttribute(Node.FONTNAME_ATTR, "Helvetica");
      thisNode.setAttribute(Node.FONTSIZE_ATTR, 10);
     
      graph.addNode(thisNode);
   
      for (EclipseCFGEdge eclipseEdge : outputs) {
        EclipseCFGNode eclipseNode = eclipseEdge.getSink();
        Node source = eclipseNode.addToGraph(graph);
        eclipseEdge.addToGraph(graph, thisNode, source);
      }
    }
    return thisNode;
  }
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.