CompilerConfiguration

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

When true, includes can be absolute file paths. When false, the paths can only be relative, and must not include ".." (parent directory).

Link copied to clipboard

Are operating system commands allowed? Only set this to true in a trusted environment. Never set it to true when Feather is used as a macro/extensions language within an application, where the script writers may be malicious!

Link copied to clipboard

Is the "include" keyword allowed? This allows extra files to be compiled, and was only designed to be used from the "feather" and "feathers" command line programs; not when Feather is embedded within an application.

Link copied to clipboard

The ClassLoader used to resolve class names. The default is to use ClassLoader.getSystemClassLoader. Note, if you use a different ClassLoader than the default one, then you must ensure that the same ClassLoader is used when running the script (otherwise some classes this the script requires may be unavailable at runtime).

Link copied to clipboard

Include debug symbols

Link copied to clipboard

When we encounter a decimal number, without a "d" or "f" suffix, then which type should we use? Currently, the options are RealType.DOUBLE and RealType.FLOAT, but later I may add support for BigDecimal.

Link copied to clipboard

If you want errors to be reported during the compilation (rather than all at once at the end), then set this to an error handler of your choosing.

Link copied to clipboard

Similar to impliedImportPackages, but for individual classes. The key is the name of the class as it will be referred to in the feather code, and the value is the actual Class.

Link copied to clipboard

Which packages are automatically imported. The default mimics Java, importing just java.reflect.

Link copied to clipboard

The following achieve similar results :

Link copied to clipboard

Names of static fields/methods which are automatically imported. The value is a Pair of the class name and the field/method name.

Link copied to clipboard

The java version for the compiled byte code. The default is Java 11, however, the default may change in later versions of Feather. I'm not sure what the lowest possible version number is, but do NOT go below 5, as we do need generics!

Link copied to clipboard

Decides which classes scripts are allowed to use. The default is AllowList with AllowList.allowStandardJavaClasses applied.

Link copied to clipboard

If set to true, then a static main method with no arguments is converted to one taking an array of String.

Link copied to clipboard

If set to true, then all loops will automatically check Thread.interrupted, and throw InterruptedException iff true. This is useful when feather is used as a scripting language, and you want the ability to stop the script cleanly. Run the script in a new Thread, then call that thread's interrupt() method to stop the script.

Functions

Link copied to clipboard
open override fun clone(): CompilerConfiguration
Link copied to clipboard

A less severe way to stop a script compared to includeExit. A script which calls abort, will cause an AbortFeather to be thrown (which extends Throwable, not Exception nor RuntimeException).

Link copied to clipboard

WARNING. This will allow scripts to call System.exit(), which stops the entire JVM.

Link copied to clipboard

Adds "uk.co.nickthecoder.feather.runtime" to impliedImportPackages. Adds "uk.co.nickthecoder.feather.runtime.Extensions" and "uk.co.nickthecoder.feather.runtime.Print" to impliedImportClasses

Link copied to clipboard