Documentation of 'org.python.indexer.ast.NModule' Java class
NModule
org.python.indexer.ast

Class NModule

  • All Implemented Interfaces:
    java.io.Serializable


    public class NModule
    extends NNode
    See Also:
    Serialized Form
    • Field Detail

      • name

        public java.lang.String name
      • body

        public NBody body
    • Constructor Detail

      • NModule

        public NModule()
      • NModule

        public NModule(java.lang.String name)
      • NModule

        public NModule(NBlock body,
                       int start,
                       int end)
    • Method Detail

      • setFile

        public void setFile(java.lang.String file)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setFile

        public void setFile(java.io.File path)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setFileAndMD5

        public void setFileAndMD5(java.lang.String path,
                                  java.lang.String md5)
                           throws java.lang.Exception
        Used when module is parsed from an in-memory string.
        Parameters:
        path - file path
        md5 - md5 message digest for source contents
        Throws:
        java.lang.Exception
      • getFile

        public java.lang.String getFile()
        Overrides:
        getFile in class NNode
        Returns:
        the path to the code that generated this AST
      • getMD5

        public java.lang.String getMD5()
      • resolve

        public NType resolve(Scope s)
                      throws java.lang.Exception
        Description copied from class: NNode
        Node should set the resolved type in its NNode.type field and also return it.
        Overrides:
        resolve in class NNode
        Throws:
        java.lang.Exception
      • getExportedNames

        public java.util.List<java.lang.String> getExportedNames()
                                                          throws java.lang.Exception
        Attempt to determine the actual value of the "__all__" variable in the target module. If we can parse it, return the list of exported names.

        Returns:
        the list of exported names. Returns null if __all__ is missing, or if its initializer is not a simple list of strings. We don't generate a warning, since complex expressions such as __all__ = [name for name in dir() if name[0] == "e"] are valid provided the expr result is a string list.
        Throws:
        java.lang.Exception
      • getExportedNameNodes

        public java.util.List<NStr> getExportedNameNodes()
                                                  throws java.lang.Exception
        If the module defines an __all__ variable, returns the string elements of the variable's list value.
        Returns:
        any exported name nodes found, or an empty list if none found
        Throws:
        java.lang.Exception
      • toLongString

        public java.lang.String toLongString()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • visit

        public void visit(NNodeVisitor v)
        Description copied from class: NNode
        Visits this node and optionally its children.

        Specified by:
        visit in class NNode
        Parameters:
        v - the object to call with this node. If the visitor returns true, the node also passes its children to the visitor.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.