Record Class Script
java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.ast.Script
- Record Components:
namespace- the declared namespace, or empty if thenamespacekeyword was absent (the semantic layer treats absent as"default")statements- the ordered list of top-level statements; never null, may be empty
The root AST node for a parsed
.relix script file.
A script is an ordered sequence of Statements, optionally prefixed
by a namespace declaration. The namespace defaults to "default"
if absent.
Example source and its AST:
namespace weather;
env from './.relix-env.json' using 'development';
import source current_weather from './weather-api.relix';
query { σ city = "Chicago, IL" (current_weather) };
produces:
Script(
namespace = Optional.of("weather"),
statements = [
EnvStatement(...),
ImportStatement(SOURCE, ["current_weather"], "./weather-api.relix"),
QueryStatement(ExpressionQueryTarget(...))
]
)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenamespacerecord component.Returns the value of thestatementsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Script
Creates an instance of aScriptrecord class.- Parameters:
namespace- the value for thenamespacerecord componentstatements- the value for thestatementsrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
namespace
Returns the value of thenamespacerecord component.- Returns:
- the value of the
namespacerecord component
-
statements
Returns the value of thestatementsrecord component.- Returns:
- the value of the
statementsrecord component
-