Package-level declarations

Functions

Link copied to clipboard

Creates a new AssignExpression with a = AssignExpression.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Creates a new BinaryOperator with a = BinaryOperator.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

Creates a new AssignExpression with a = AssignExpression.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

Creates a new AssignExpression with a += AssignExpression.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard
fun LanguageFrontend<*, *>.block(needsScope: Boolean = true, init: Block.() -> Unit): Block

Creates a new Block in the Fluent Node DSL and sets it to the FunctionDeclaration.body of the nearest enclosing FunctionDeclaration. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.body(needsScope: Boolean = true, init: Block.() -> Unit): Block

Creates a new Block in the Fluent Node DSL and sets it to the FunctionDeclaration.body of the nearest enclosing FunctionDeclaration. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.breakStmt(label: String? = null): BreakStatement

Creates a new BreakStatement in the Fluent Node DSL and adds it to the nearest enclosing Holder, but only if it is an StatementHolder.

Link copied to clipboard
fun LanguageFrontend<*, *>.call(name: CharSequence, isStatic: Boolean = false, init: CallExpression.() -> Unit? = null): CallExpression

Creates a new CallExpression (or MemberCallExpression) in the Fluent Node DSL with the given name and adds it to the nearest enclosing Holder. Depending on whether it is a StatementHolder it is added to the list of StatementHolder.statements or in case of an ArgumentHolder, the function ArgumentHolder.addArgument is invoked.

Link copied to clipboard
fun LanguageFrontend<*, *>.case(caseExpression: Expression? = null): CaseStatement

Creates a new CaseStatement in the Fluent Node DSL and adds it to the nearest enclosing Holder, but only if it is an StatementHolder.

Link copied to clipboard
fun LanguageFrontend<*, *>.cast(castType: Type, init: CastExpression.() -> Unit? = null): CastExpression
Link copied to clipboard
Link copied to clipboard

Configures the IfStatement.condition in the Fluent Node DSL of the nearest enclosing IfStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun Expression.conditional(condition: Expression, thenExpression: Expression, elseExpression: Expression): ConditionalExpression

Creates a new ConditionalExpression with a = BinaryOperator.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

Creates a new ConstructExpression in the Fluent Node DSL for the translation record/type with the given name and adds it to the nearest enclosing Holder. Depending on whether it is a StatementHolder it is added to the list of StatementHolder.statements or in case of an ArgumentHolder, the function ArgumentHolder.addArgument is invoked. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new ConstructorDeclaration in the Fluent Node DSL for the enclosing RecordDeclaration. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new ContinueStatement in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard
operator fun Expression.dec(): UnaryOperator

Creates a new UnaryOperator with a -- UnaryOperator.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

Creates a new DeclarationStatement in the Fluent Node DSL and adds it to the StatementHolder.statements of the nearest enclosing StatementHolder. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new DeclarationStatement in the Fluent Node DSL. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new DefaultStatement in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

Creates a new BinaryOperator with a / BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Configures the DoStatement.condition in the Fluent Node DSL of the nearest enclosing DoStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.doStmt(needsScope: Boolean = true, init: DoStatement.() -> Unit): DoStatement

Creates a new DoStatement in the Fluent Node DSL and adds it to the StatementHolder.statements of the nearest enclosing StatementHolder. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new IfStatement in the Fluent Node DSL and sets it to the IfStatement.elseStatement of the nearest enclosing IfStatement. This simulates an else-if scenario. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.elseStmt(needsScope: Boolean = true, init: Block.() -> Unit): Block

Creates a new Block in the Fluent Node DSL and sets it to the IfStatement.elseStatement of the nearest enclosing IfStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new BinaryOperator with a == BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard
fun LanguageFrontend<*, *>.field(name: CharSequence, type: Type = unknownType(), init: FieldDeclaration.() -> Unit? = null): FieldDeclaration

Creates a new FieldDeclaration in the Fluent Node DSL with the given name and optional type. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new ForEachStatement in the Fluent Node DSL and adds it to the StatementHolder.statements of the nearest enclosing StatementHolder. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.forStmt(initializer: DeclarationStatement, condition: Expression, iteration: Statement, elseStmt: Statement? = null, init: Block.() -> Unit): ForStatement

Creates a new ForStatement in the Fluent Node DSL and adds it to the StatementHolder.statements of the nearest enclosing StatementHolder. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.function(name: CharSequence, returnType: Type = unknownType(), returnTypes: List<Type>? = null, init: FunctionDeclaration.() -> Unit? = null): FunctionDeclaration

Creates a new FunctionDeclaration in the Fluent Node DSL with the given name and optional returnType. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new BinaryOperator with a >= BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new BinaryOperator with a > BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new IfStatement in the Fluent Node DSL and adds it to the StatementHolder.statements of the nearest enclosing StatementHolder. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.ile(targetType: Type = unknownType(), init: InitializerListExpression.() -> Unit? = null): InitializerListExpression

Creates a new InitializerListExpression in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing Holder, but only if it is an ArgumentHolder.

Link copied to clipboard

Creates a new IncludeDeclaration and adds it to the surrounding TranslationUnitDeclaration.

Link copied to clipboard
operator fun Expression.inc(): UnaryOperator

Creates a new UnaryOperator with a ++ UnaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new UnaryOperator with a ++ UnaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Configures the ForStatement.initializerStatement in the Fluent Node DSL of the nearest enclosing ForStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Configures the ForEachStatement.iterable in the Fluent Node DSL of the nearest enclosing ForEachStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.label(label: String, init: LabelStatement.() -> Statement? = null): LabelStatement

Creates a new LabelStatement in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

Creates a new BinaryOperator with a <= BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

This utility function tries to create a fake PhysicalLocation in order to somewhat differentiate the different nodes. This is primarily needed for the mermaid graph printer, which relies on Node.hashCode, which in turn relies on Node.location.

Link copied to clipboard
Link copied to clipboard
fun <N> LanguageFrontend<*, *>.literal(value: N, type: Type = unknownType()): Literal<N>

Creates a new Literal in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing Holder, but only if it is an ArgumentHolder.

Link copied to clipboard
fun LanguageFrontend<*, *>.loopBody(init: Block.() -> Unit): Block

Creates a new Block in the Fluent Node DSL and sets it to the LoopStatement.statement of the nearest enclosing LoopStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.loopElseStmt(needsScope: Boolean = true, init: Block.() -> Unit): Block

Creates a new Block in the Fluent Node DSL and sets it to the LoopStatement.elseStatement of the nearest enclosing LoopStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new BinaryOperator with a < BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard
fun LanguageFrontend<*, *>.member(name: CharSequence, base: Expression? = null, operatorCode: String = "."): MemberExpression

Creates a new MemberExpression in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing Holder, but only if it is an ArgumentHolder. If the name doesn't already contain a fqn, we add an implicit "this" as base.

Link copied to clipboard
fun LanguageFrontend<*, *>.memberCall(localName: CharSequence, base: Expression, isStatic: Boolean = false, init: MemberCallExpression.() -> Unit? = null): MemberCallExpression

Creates a new CallExpression (or MemberCallExpression) in the Fluent Node DSL with the given localName and adds it to the nearest enclosing Holder. Depending on whether it is a StatementHolder it is added to the list of StatementHolder.statements or in case of an ArgumentHolder, the function ArgumentHolder.addArgument is invoked.

Link copied to clipboard
fun LanguageFrontend<*, *>.memberOrRef(name: Name, type: Type = unknownType()): Expression
Link copied to clipboard
fun LanguageFrontend<*, *>.method(name: CharSequence, returnType: Type = unknownType(), init: MethodDeclaration.() -> Unit? = null): MethodDeclaration

Creates a new MethodDeclaration in the Fluent Node DSL with the given name and optional returnType. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new BinaryOperator with a - BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new NamespaceDeclaration in the Fluent Node DSL with the given name. The declaration will be set to the ScopeManager.globalScope. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.new(init: NewExpression.() -> Unit? = null): NewExpression
Link copied to clipboard
fun LanguageFrontend<*, *>.param(name: CharSequence, type: Type = unknownType(), init: ParameterDeclaration.() -> Unit? = null): ParameterDeclaration

Creates a new ParameterDeclaration in the Fluent Node DSL and adds it to the FunctionDeclaration.parameters of the nearest enclosing FunctionDeclaration. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new BinaryOperator with a + BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard
operator fun Expression.plusAssign(rhs: Expression)

Creates a new BinaryOperator with a + BinaryOperator.operatorCode in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard
fun LanguageFrontend<*, *>.problemDecl(description: String, type: ProblemNode.ProblemType = ProblemNode.ProblemType.TRANSLATION, init: ProblemDeclaration.() -> Unit? = null): ProblemDeclaration

Creates a new ProblemDeclaration in the Fluent Node DSL and adds it to the DeclarationStatement.declarations of the nearest enclosing DeclarationStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
Link copied to clipboard
fun LanguageFrontend<*, *>.record(name: CharSequence, kind: String = "class", init: RecordDeclaration.() -> Unit): RecordDeclaration

Creates a new RecordDeclaration in the Fluent Node DSL with the given name. The declaration will be set to the ScopeManager.currentRecord. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.ref(name: CharSequence, type: Type = unknownType(), makeMagic: Boolean = true, init: Reference.() -> Unit? = null): Reference

Creates a new Reference in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing Holder, but only if it is an ArgumentHolder.

Link copied to clipboard

Creates a new UnaryOperator with a & UnaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new BinaryOperator with a + BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new ReturnStatement in the Fluent Node DSL and adds it to the StatementHolder.statements of the nearest enclosing StatementHolder. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
Link copied to clipboard
fun LanguageFrontend<*, *>.switchBody(init: Block.() -> Unit): Block

Creates a new Block in the Fluent Node DSL and sets it to the SwitchStatement.statement of the nearest enclosing SwitchStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.switchStmt(selector: Expression, needsScope: Boolean = true, init: SwitchStatement.() -> Unit): SwitchStatement

Creates a new SwitchStatement in the Fluent Node DSL and adds it to the StatementHolder.statements of the nearest enclosing StatementHolder. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.t(name: CharSequence, generics: List<Type> = listOf()): Type

Creates a new Type with the given name in the Fluent Node DSL.

Link copied to clipboard
fun LanguageFrontend<*, *>.thenStmt(needsScope: Boolean = true, init: Block.() -> Unit): Block

Creates a new Block in the Fluent Node DSL and sets it to the IfStatement.thenStatement of the nearest enclosing IfStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new ThrowExpression in the Fluent Node DSL and adds it to the nearest enclosing StatementHolder.

Link copied to clipboard

Creates a new BinaryOperator with a * BinaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Creates a new TranslationUnitDeclaration in the Fluent Node DSL with the given name. The declaration will be set to the ScopeManager.globalScope. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new UnaryOperator with a - UnaryOperator.operatorCode in the Fluent Node DSL and invokes ArgumentHolder.addArgument of the nearest enclosing ArgumentHolder.

Link copied to clipboard

Configures the ForEachStatement.variable in the Fluent Node DSL of the nearest enclosing ForEachStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

fun LanguageFrontend<*, *>.variable(name: String, type: Type = unknownType(), init: VariableDeclaration.() -> Unit? = null): VariableDeclaration

Creates a new VariableDeclaration in the Fluent Node DSL and adds it to the DeclarationStatement.declarations of the nearest enclosing DeclarationStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard

Creates a new IncompleteType in the Fluent Node DSL.

Link copied to clipboard

Configures the WhileStatement.condition in the Fluent Node DSL of the nearest enclosing WhileStatement. The init block can be used to create further sub-nodes as well as configuring the created node itself.

Link copied to clipboard
fun LanguageFrontend<*, *>.whileStmt(needsScope: Boolean = true, init: WhileStatement.() -> Unit): WhileStatement

Creates a new WhileStatement in the Fluent Node DSL and adds it to the StatementHolder.statements of the nearest enclosing StatementHolder. The init block can be used to create further sub-nodes as well as configuring the created node itself.