Class Awk

java.lang.Object
org.metricshub.jawk.Awk
Direct Known Subclasses:
SandboxedAwk

public class Awk extends Object
Entry point into the parsing, analysis, and execution of a Jawk script. This entry point is used both when Jawk is executed as a library and when invoked from the command line.

The overall process to execute a Jawk script is as follows:

  • Parse the Jawk script, producing an abstract syntax tree.
  • Traverse the abstract syntax tree, producing a list of instruction tuples for the interpreter.
  • Traverse the list of tuples, providing a runtime which ultimately executes the Jawk script, or Command-line parameters dictate which action is to take place.
Two additional semantic checks on the syntax tree are employed (both to resolve function calls for defined functions). As a result, the syntax tree is traversed three times. And the number of times tuples are traversed is depends on whether interpretation or compilation takes place.

The engine does not enable any extensions automatically. Extensions can be provided programmatically via the Awk(Collection) constructors or via the command line when using the CLI entry point.

Author:
Danny Daglas
See Also: