Package org.jrubyparser.ast

Examples of org.jrubyparser.ast.ClassNode


    Node module = moduleFinder.findModule(root, new String[] { "Puppet" });
    for(Node n : module.childNodes()) {
      if(n.getNodeType() == NodeType.NEWLINENODE)
        n = ((NewlineNode) n).getNextNode();
      if(n.getNodeType() == NodeType.CLASSNODE) {
        ClassNode classNode = (ClassNode) n;
        // could check if this is the class 'Type' but somewhat
        // meaningless
        // as this code is only called for the Type.rb file anyway.
        // classNode.getCPath();
        for(Node bn : classNode.getBody().childNodes()) {
          if(bn.getNodeType() == NodeType.NEWLINENODE)
            bn = ((NewlineNode) bn).getNextNode();
          if(bn.getNodeType() == NodeType.FCALLNODE) {
            FCallNode callNode = (FCallNode) bn;
            if("newmetaparam".equals(callNode.getName())) {
View Full Code Here


  @Override
  public List<PPFunctionInfo> getLogFunctions(File file) throws IOException, RubySyntaxException {
    List<PPFunctionInfo> functions = Lists.newArrayList();
    Result result = internalParse(file);
    Node root = result.getAST();
    ClassNode logClass = new RubyClassFinder().findClass(root, "Puppet", "Util", "Log");
    if(logClass == null)
      return functions;

    for(Node n : logClass.getBody().childNodes()) {
      if(n.getNodeType() == NodeType.NEWLINENODE)
        n = ((NewlineNode) n).getNextNode();
      // if (n.getNodeType() == NodeType.CLASSNODE) {
      // ClassNode cn = (ClassNode) n;
      // // TODO: Check that we have Puppet::Util::Log class
View Full Code Here

      switch(n.getNodeType()) {
        case ROOTNODE: // fall through
        case BLOCKNODE:
          return findClass(n, qualifiedName);
        case CLASSNODE:
          ClassNode classNode = (ClassNode) n;
          if(wantedName.equals(new ConstEvaluator().eval(classNode.getCPath())))
            return (ClassNode) n;
        default:
          break;
      }
    }
View Full Code Here

          if(!inCompatibleScope())
            break SEARCH;
          break; // search children

        case CLASSNODE:
          ClassNode classNode = (ClassNode) root;
          pushNames(constEvaluator.stringList(constEvaluator.eval(classNode.getCPath())));
          if(!inCompatibleScope())
            break SEARCH;
          break; // search children

        case CALLNODE:
View Full Code Here

TOP

Related Classes of org.jrubyparser.ast.ClassNode

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.