Class SourceFile

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SourceFile>

    public class SourceFile
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<SourceFile>
    A Go source file: a package clause, imports, and top-level declarations
    See Also:
    Serialized Form
    • Field Detail

      • TYPE_

        public static final Name TYPE_
        Name of the hydra.go.syntax.SourceFile type.
      • PACKAGE

        public static final Name PACKAGE
        Name of the hydra.go.syntax.SourceFile.package field.
      • IMPORTS

        public static final Name IMPORTS
        Name of the hydra.go.syntax.SourceFile.imports field.
      • DECLARATIONS

        public static final Name DECLARATIONS
        Name of the hydra.go.syntax.SourceFile.declarations field.
      • imports

        public final java.util.List<ImportDecl> imports
      • declarations

        public final java.util.List<TopLevelDecl> declarations
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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

        public int compareTo​(SourceFile other)
        Specified by:
        compareTo in interface java.lang.Comparable<SourceFile>
      • withDeclarations

        public SourceFile withDeclarations​(java.util.List<TopLevelDecl> declarations)
        Returns a copy of this SourceFile with declarations replaced.