Package org.ek9lang.core
package org.ek9lang.core
Just general operating system stuff and bits and bobs. Some of these may find their way out of here. But for now this is as good a place as any to put them.
-
ClassDescriptionAutomated Readability Index (ARI) adapted for source code.Used as simple one-liners to check a value and issue an illegal argument exception if empty.Our wrapper for an unchecked exception.THE content hash of the classes under some packages as a class loader would serve them: where a class is on several roots, the first root (the one the loader resolves) counts.THE place a dependency lives in a library folder: unpacked as the directory
<lib>/<name>-<version>, or zipped as<lib>/<name>-<version>.zip(the zip's name isFileHandling's).Wraps the SHA 256 digest and the resulting byte array into objects, so we can deal with check objects rather than raw bytes.A Checksum.Responsibility of dealing with aspects of the ek9 directory structure.THE embedded form of a program's licence files, for a native executable's data: per file a NUL,ProgramLicences.EMBEDDED_MARK, its name, a newline, its text and a NUL - found again by scanning (ProgramLicenceReader).Just wraps any exceptions in a runtime CompilerException.Just catches exceptions and ignores them.Single source of truth for directory names that should be excluded from workspace file walks, watch registrations, and glob-based source discovery.THE glob exclude patterns ofExcludedDirectories.NAMES, suitable for use withGlob(List, List).THE file name of a program on this platform:ek9.exe,clang.exe,java.exeon Windows, the bare name elsewhere - for every search ofPATHor a folder for a program by name (Windows looks for an exact name there; only its own shells add.exe).An exception that when caught at the very outer edge of the compiler will cause the application to exit with a specific error code.Designed to abstract out all file handling for the compiler.Used for file path matching GLOB not regex.Converts bytes to Hexadecimal and back.THE test "is this dependency in the library": its dependency vector (name-version) is unpacked as a readable directory, or zipped as a readable file, in theDependencyInstallation's library folder.THE test of one directory name againstExcludedDirectories.NAMES: should a file walk skip a directory with this name? Hold one and test with it; a whole path goes throughIsExcludedPath.THE whole-path counterpart toIsExcludedDirectoryName: true when ANY path element is an excluded directory (build output, VCS, IDE cache).THE "is this Windows" test - use this, never a privateos.namecheck (there were four, two of themcontains("win")).THE jar file of ajar:file:/path/to/file.jar!/packageURL, percent-escapes decoded - shared by the runtime's extraction (RuntimeClassExtractor) and its content hash (ContentHashOf).THE content of a JSON string for hand-built JSON text: the characters to put between the quotes, escaped as RFC 8259 requires -"and\, and EVERY control character below U+0020 (\b \f \n \r \tby name, the rest as\u00XX).THE licence files the compiler puts with every program it compiles for the JVM, inProgramLicences.FILE_NAMESorder: the runtime's licence, its NOTICE and the third-party notices, read from the compiler's own resources (RuntimeLicenceTexts).How much the compiler's one program lock (SharedThreadContext) is used and waited for - the measure of what serialises the front end.One reading of the counters.Wrapper for logging.Operating System support and generic stuff for directories and files.Focus on the responsibility of packaging.Gets the immediate parent directory of the file.THE encoder, the inverse ofSourceFileUriToPath: a filesystem path as the compiler's general source identifier, thefile:URI everyCompilableSource,ErrorListenerand source token carries, and the key under which LSP diagnostics are published.Checks, mechanically, that the compiler's phase boundaries mean what they say.THE text of a path with/between its names on every platform - hold one and use it; neverpath.toString()(the platform's separator,\on Windows) nor a private.replace('\\', '/')for a path that is shown or compared as text.Processor<T>Designed to enable a developer to wrap lots of different type of processing and expose any exceptions.THE reader of the licence files a program carries, in either form: a program jar'sProgramLicences.JAR_DIRECTORYentries or a native executable's embedded copy (EmbeddedLicenceFiles).THE licence files every program EK9 compiles carries with it (licence decision D-L1, docs/legal): the runtime's Apache-2.0 licence, the runtime's NOTICE, and the notices of the third-party code the program contains.One licence file: its name (one ofProgramLicences.FILE_NAMES) and its bytes.Extracts EK9 runtime classes (org.ek9.lang and ek9 packages) from the running JVM and packages them into a versioned JAR file with SHA-256 checksum.THE content hash of the runtime this JVM would package: computed ONCE per process (lazily, on first use) byContentHashOfover every class thatRuntimeClassExtractor.extractRuntimeJar(FileHandling, String, String)could take.THE reader of the licence texts the compiler packages with the runtime: the third-party notices (RuntimeClassExtractor.NOTICES_RESOURCE), the runtime's Apache-2.0 licence and its NOTICE.Can be a normal version number like 6.8.2-9 i.e 9 is the build number Or can be for a feature like 6.1.6-specialFeature12-19 i.e.SharedThreadContext<T extends Serializable>Concept here is to be able to protect raw java objects from multiple threaded access.Just a wrapper around java public private key processing.THE decoder turning a compiler source-token identifier into a filesystem path — hold one and use it, do not hand-roll the scheme strip.Possible supported target output architectures.Very simple wrapper for binary contents.Just a common base directory and a list of files with that common base.