Package-level declarations

Types

Link copied to clipboard
interface FileInfo

Information about a file to be transformed.

Link copied to clipboard

The main entry point for the ktcodeshift API.

Link copied to clipboard
data class NodeCollection<T : Node>(val nodePaths: List<NodePath<T>>, val rootNode: Node.KotlinEntry)

A collection of nodes filtered under the root node.

Link copied to clipboard
class NodeContext(path: NodePath<*>)

Context for a node.

Link copied to clipboard

Properties

Link copied to clipboard
val Node.WithModifiers.annotations: List<Node.Modifier.AnnotationSet.Annotation>

Get list of annotations for this node.

Link copied to clipboard
val Node.Declaration.ClassDeclaration.isDataClass: Boolean

Returns true if this node is a data class.

Link copied to clipboard
val Node.WithModifiers.keywordModifiers: List<Node.Modifier.KeywordModifier>

Get list of keyword modifiers for this node.

Link copied to clipboard

Functions

Link copied to clipboard
fun annotatedExpression(annotationSets: List<Node.Modifier.AnnotationSet> = listOf(), statement: Node.Statement, supplement: NodeSupplement = NodeSupplement()): Node.Expression.AnnotatedExpression

Creates a new Node.Expression.AnnotatedExpression instance.

Link copied to clipboard
fun annotation(type: Node.Type.SimpleType, lPar: Node.Keyword.LPar? = null, arguments: List<Node.ValueArgument> = listOf(), rPar: Node.Keyword.RPar? = null, supplement: NodeSupplement = NodeSupplement()): Node.Modifier.AnnotationSet.Annotation

Creates a new Node.Modifier.AnnotationSet.Annotation instance.

Link copied to clipboard
fun annotationSet(target: Node.Modifier.AnnotationSet.AnnotationTarget? = null, lBracket: Node.Keyword.LBracket? = null, annotations: List<Node.Modifier.AnnotationSet.Annotation> = listOf(), rBracket: Node.Keyword.RBracket? = null, supplement: NodeSupplement = NodeSupplement()): Node.Modifier.AnnotationSet

Creates a new Node.Modifier.AnnotationSet instance.

Link copied to clipboard
fun anonymousFunctionExpression(function: Node.Declaration.FunctionDeclaration, supplement: NodeSupplement = NodeSupplement()): Node.Expression.AnonymousFunctionExpression

Creates a new Node.Expression.AnonymousFunctionExpression instance.

Link copied to clipboard
fun binaryExpression(lhs: Node.Expression, operator: Node.Expression.BinaryExpression.BinaryOperator, rhs: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.BinaryExpression

Creates a new Node.Expression.BinaryExpression instance.

Link copied to clipboard
fun binaryTypeExpression(lhs: Node.Expression, operator: Node.Expression.BinaryTypeExpression.BinaryTypeOperator, rhs: Node.Type, supplement: NodeSupplement = NodeSupplement()): Node.Expression.BinaryTypeExpression

Creates a new Node.Expression.BinaryTypeExpression instance.

Link copied to clipboard
fun blockExpression(vararg statements: Node.Statement): Node.Expression.BlockExpression
fun blockExpression(statements: List<Node.Statement> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Expression.BlockExpression

Creates a new Node.Expression.BlockExpression instance.

Link copied to clipboard
fun booleanLiteralExpression(text: String, supplement: NodeSupplement = NodeSupplement()): Node.Expression.BooleanLiteralExpression

Creates a new Node.Expression.BooleanLiteralExpression instance.

Link copied to clipboard
fun breakExpression(label: Node.Expression.NameExpression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Expression.BreakExpression

Creates a new Node.Expression.BreakExpression instance.

Link copied to clipboard
fun callableReferenceExpression(lhs: Node.Expression? = null, questionMarks: List<Node.Keyword.Question> = listOf(), rhs: Node.Expression.NameExpression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.CallableReferenceExpression

Creates a new Node.Expression.CallableReferenceExpression instance.

Link copied to clipboard
fun callExpression(calleeExpression: Node.Expression, lAngle: Node.Keyword.Less? = null, typeArguments: List<Node.TypeArgument> = listOf(), rAngle: Node.Keyword.Greater? = null, lPar: Node.Keyword.LPar? = null, arguments: List<Node.ValueArgument> = listOf(), rPar: Node.Keyword.RPar? = null, lambdaArgument: Node.Expression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Expression.CallExpression

Creates a new Node.Expression.CallExpression instance.

Link copied to clipboard
fun catchClause(lPar: Node.Keyword.LPar = Node.Keyword.LPar(), parameters: List<Node.FunctionParameter> = listOf(), rPar: Node.Keyword.RPar = Node.Keyword.RPar(), block: Node.Expression.BlockExpression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.TryExpression.CatchClause

Creates a new Node.Expression.TryExpression.CatchClause instance.

Link copied to clipboard
fun characterLiteralExpression(text: String, supplement: NodeSupplement = NodeSupplement()): Node.Expression.CharacterLiteralExpression

Creates a new Node.Expression.CharacterLiteralExpression instance.

Link copied to clipboard
fun classBody(enumEntries: List<Node.Declaration.ClassOrObject.ClassBody.EnumEntry> = listOf(), declarations: List<Node.Declaration> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ClassOrObject.ClassBody

Creates a new Node.Declaration.ClassOrObject.ClassBody instance.

Link copied to clipboard
fun classDeclaration(modifiers: List<Node.Modifier> = listOf(), declarationKeyword: Node.Declaration.ClassDeclaration.ClassOrInterfaceKeyword, name: Node.Expression.NameExpression, lAngle: Node.Keyword.Less? = null, typeParameters: List<Node.TypeParameter> = listOf(), rAngle: Node.Keyword.Greater? = null, primaryConstructor: Node.Declaration.ClassDeclaration.PrimaryConstructor? = null, parents: List<Node.Declaration.ClassOrObject.ClassParent> = listOf(), typeConstraintSet: Node.PostModifier.TypeConstraintSet? = null, body: Node.Declaration.ClassOrObject.ClassBody? = null, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ClassDeclaration

Creates a new Node.Declaration.ClassDeclaration instance.

Link copied to clipboard
fun classLiteralExpression(lhs: Node.Expression, questionMarks: List<Node.Keyword.Question> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Expression.ClassLiteralExpression

Creates a new Node.Expression.ClassLiteralExpression instance.

Link copied to clipboard
fun collectionLiteralExpression(expressions: List<Node.Expression> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Expression.CollectionLiteralExpression

Creates a new Node.Expression.CollectionLiteralExpression instance.

Link copied to clipboard
fun comment(text: String, supplement: NodeSupplement = NodeSupplement()): Node.Extra.Comment

Creates a new Node.Extra.Comment instance.

Link copied to clipboard
fun conditionalWhenBranch(conditions: List<Node.Expression.WhenExpression.WhenCondition> = listOf(), arrow: Node.Keyword.Arrow = Node.Keyword.Arrow(), body: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.WhenExpression.ConditionalWhenBranch

Creates a new Node.Expression.WhenExpression.ConditionalWhenBranch instance.

Link copied to clipboard
fun constructorClassParent(type: Node.Type.SimpleType, lPar: Node.Keyword.LPar = Node.Keyword.LPar(), arguments: List<Node.ValueArgument> = listOf(), rPar: Node.Keyword.RPar = Node.Keyword.RPar(), supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ClassOrObject.ConstructorClassParent

Creates a new Node.Declaration.ClassOrObject.ConstructorClassParent instance.

Link copied to clipboard
fun contextReceiver(lPar: Node.Keyword.LPar = Node.Keyword.LPar(), receiverTypes: List<Node.Type> = listOf(), rPar: Node.Keyword.RPar = Node.Keyword.RPar(), supplement: NodeSupplement = NodeSupplement()): Node.ContextReceiver

Creates a new Node.ContextReceiver instance.

Link copied to clipboard
fun continueExpression(label: Node.Expression.NameExpression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Expression.ContinueExpression

Creates a new Node.Expression.ContinueExpression instance.

Link copied to clipboard
fun contract(lBracket: Node.Keyword.LBracket = Node.Keyword.LBracket(), contractEffects: List<Node.Expression> = listOf(), rBracket: Node.Keyword.RBracket = Node.Keyword.RBracket(), supplement: NodeSupplement = NodeSupplement()): Node.PostModifier.Contract

Creates a new Node.PostModifier.Contract instance.

Link copied to clipboard
fun delegationClassParent(type: Node.Type, expression: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ClassOrObject.DelegationClassParent

Creates a new Node.Declaration.ClassOrObject.DelegationClassParent instance.

Link copied to clipboard
fun doWhileStatement(body: Node.Expression, lPar: Node.Keyword.LPar = Node.Keyword.LPar(), condition: Node.Expression, rPar: Node.Keyword.RPar = Node.Keyword.RPar(), supplement: NodeSupplement = NodeSupplement()): Node.Statement.DoWhileStatement

Creates a new Node.Statement.DoWhileStatement instance.

Link copied to clipboard
fun dynamicType(modifiers: List<Node.Modifier> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Type.DynamicType

Creates a new Node.Type.DynamicType instance.

Link copied to clipboard
fun elseWhenBranch(arrow: Node.Keyword.Arrow = Node.Keyword.Arrow(), body: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.WhenExpression.ElseWhenBranch

Creates a new Node.Expression.WhenExpression.ElseWhenBranch instance.

Link copied to clipboard
fun enumEntry(modifiers: List<Node.Modifier> = listOf(), name: Node.Expression.NameExpression, lPar: Node.Keyword.LPar? = null, arguments: List<Node.ValueArgument> = listOf(), rPar: Node.Keyword.RPar? = null, classBody: Node.Declaration.ClassOrObject.ClassBody? = null, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ClassOrObject.ClassBody.EnumEntry

Creates a new Node.Declaration.ClassOrObject.ClassBody.EnumEntry instance.

Link copied to clipboard
fun escapeStringEntry(text: String, supplement: NodeSupplement = NodeSupplement()): Node.Expression.StringLiteralExpression.EscapeStringEntry

Creates a new Node.Expression.StringLiteralExpression.EscapeStringEntry instance.

Link copied to clipboard
fun expressionWhenCondition(expression: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.WhenExpression.ExpressionWhenCondition

Creates a new Node.Expression.WhenExpression.ExpressionWhenCondition instance.

Link copied to clipboard
inline fun <T : Node> Node.KotlinEntry.find(): NodeCollection<T>
fun <T : Node> Node.KotlinEntry.find(javaClass: Class<T>): NodeCollection<T>
fun <T : Node> Node.KotlinEntry.find(kClass: KClass<T>): NodeCollection<T>

Returns NodeCollection of all nodes of type T under this node.

Link copied to clipboard
fun forStatement(lPar: Node.Keyword.LPar = Node.Keyword.LPar(), loopParameter: Node.LambdaParameter, inKeyword: Node.Keyword.In = Node.Keyword.In(), loopRange: Node.Expression, rPar: Node.Keyword.RPar = Node.Keyword.RPar(), body: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Statement.ForStatement

Creates a new Node.Statement.ForStatement instance.

Link copied to clipboard
fun functionDeclaration(modifiers: List<Node.Modifier> = listOf(), lAngle: Node.Keyword.Less? = null, typeParameters: List<Node.TypeParameter> = listOf(), rAngle: Node.Keyword.Greater? = null, receiverType: Node.Type? = null, name: Node.Expression.NameExpression? = null, lPar: Node.Keyword.LPar = Node.Keyword.LPar(), parameters: List<Node.FunctionParameter> = listOf(), rPar: Node.Keyword.RPar = Node.Keyword.RPar(), returnType: Node.Type? = null, postModifiers: List<Node.PostModifier> = listOf(), body: Node.Expression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.FunctionDeclaration

Creates a new Node.Declaration.FunctionDeclaration instance.

Link copied to clipboard
fun functionParameter(modifiers: List<Node.Modifier> = listOf(), valOrVarKeyword: Node.Keyword.ValOrVarKeyword? = null, name: Node.Expression.NameExpression, type: Node.Type? = null, defaultValue: Node.Expression? = null, supplement: NodeSupplement = NodeSupplement()): Node.FunctionParameter

Creates a new Node.FunctionParameter instance.

Link copied to clipboard
fun functionType(modifiers: List<Node.Modifier> = listOf(), contextReceiver: Node.ContextReceiver? = null, receiverType: Node.Type? = null, lPar: Node.Keyword.LPar = Node.Keyword.LPar(), parameters: List<Node.Type.FunctionType.FunctionTypeParameter> = listOf(), rPar: Node.Keyword.RPar = Node.Keyword.RPar(), returnType: Node.Type, supplement: NodeSupplement = NodeSupplement()): Node.Type.FunctionType

Creates a new Node.Type.FunctionType instance.

Link copied to clipboard
fun functionTypeParameter(name: Node.Expression.NameExpression? = null, type: Node.Type, supplement: NodeSupplement = NodeSupplement()): Node.Type.FunctionType.FunctionTypeParameter

Creates a new Node.Type.FunctionType.FunctionTypeParameter instance.

Link copied to clipboard
fun getter(modifiers: List<Node.Modifier> = listOf(), lPar: Node.Keyword.LPar? = null, rPar: Node.Keyword.RPar? = null, type: Node.Type? = null, postModifiers: List<Node.PostModifier> = listOf(), body: Node.Expression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.PropertyDeclaration.Getter

Creates a new Node.Declaration.PropertyDeclaration.Getter instance.

Link copied to clipboard
fun ifExpression(lPar: Node.Keyword.LPar = Node.Keyword.LPar(), condition: Node.Expression, rPar: Node.Keyword.RPar = Node.Keyword.RPar(), body: Node.Expression, elseBody: Node.Expression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Expression.IfExpression

Creates a new Node.Expression.IfExpression instance.

Link copied to clipboard
fun importDirective(names: List<Node.Expression.NameExpression> = listOf(), aliasName: Node.Expression.NameExpression? = null, supplement: NodeSupplement = NodeSupplement()): Node.ImportDirective

Creates a new Node.ImportDirective instance.

Link copied to clipboard
fun indexedAccessExpression(expression: Node.Expression, indices: List<Node.Expression> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Expression.IndexedAccessExpression

Creates a new Node.Expression.IndexedAccessExpression instance.

Link copied to clipboard
fun initializer(block: Node.Expression.BlockExpression, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ClassOrObject.ClassBody.Initializer

Creates a new Node.Declaration.ClassOrObject.ClassBody.Initializer instance.

Link copied to clipboard
fun integerLiteralExpression(text: String, supplement: NodeSupplement = NodeSupplement()): Node.Expression.IntegerLiteralExpression

Creates a new Node.Expression.IntegerLiteralExpression instance.

Link copied to clipboard
fun kotlinFile(annotationSets: List<Node.Modifier.AnnotationSet> = listOf(), packageDirective: Node.PackageDirective? = null, importDirectives: List<Node.ImportDirective> = listOf(), declarations: List<Node.Declaration> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.KotlinFile

Creates a new Node.KotlinFile instance.

Link copied to clipboard
fun kotlinScript(annotationSets: List<Node.Modifier.AnnotationSet> = listOf(), packageDirective: Node.PackageDirective? = null, importDirectives: List<Node.ImportDirective> = listOf(), expressions: List<Node.Expression> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.KotlinScript

Creates a new Node.KotlinScript instance.

Link copied to clipboard
fun labeledExpression(label: Node.Expression.NameExpression, statement: Node.Statement, supplement: NodeSupplement = NodeSupplement()): Node.Expression.LabeledExpression

Creates a new Node.Expression.LabeledExpression instance.

Link copied to clipboard
fun lambdaExpression(parameters: List<Node.LambdaParameter> = listOf(), arrow: Node.Keyword.Arrow? = null, statements: List<Node.Statement> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Expression.LambdaExpression

Creates a new Node.Expression.LambdaExpression instance.

Link copied to clipboard
fun lambdaParameter(variable: Node.Variable, supplement: NodeSupplement = NodeSupplement()): Node.LambdaParameter
fun lambdaParameter(lPar: Node.Keyword.LPar? = null, variables: List<Node.Variable>, rPar: Node.Keyword.RPar? = null, destructuringType: Node.Type? = null, supplement: NodeSupplement = NodeSupplement()): Node.LambdaParameter

Creates a new Node.LambdaParameter instance.

Link copied to clipboard
fun literalStringEntry(text: String, supplement: NodeSupplement = NodeSupplement()): Node.Expression.StringLiteralExpression.LiteralStringEntry

Creates a new Node.Expression.StringLiteralExpression.LiteralStringEntry instance.

Link copied to clipboard
fun nameExpression(text: String, supplement: NodeSupplement = NodeSupplement()): Node.Expression.NameExpression

Creates a new Node.Expression.NameExpression instance.

Link copied to clipboard
fun nullableType(modifiers: List<Node.Modifier> = listOf(), innerType: Node.Type, questionMark: Node.Keyword.Question = Node.Keyword.Question(), supplement: NodeSupplement = NodeSupplement()): Node.Type.NullableType

Creates a new Node.Type.NullableType instance.

Link copied to clipboard
fun nullLiteralExpression(supplement: NodeSupplement = NodeSupplement()): Node.Expression.NullLiteralExpression

Creates a new Node.Expression.NullLiteralExpression instance.

Link copied to clipboard
fun objectDeclaration(modifiers: List<Node.Modifier> = listOf(), declarationKeyword: Node.Keyword.Object = Node.Keyword.Object(), name: Node.Expression.NameExpression? = null, parents: List<Node.Declaration.ClassOrObject.ClassParent> = listOf(), body: Node.Declaration.ClassOrObject.ClassBody? = null, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ObjectDeclaration

Creates a new Node.Declaration.ObjectDeclaration instance.

Link copied to clipboard
fun objectLiteralExpression(declaration: Node.Declaration.ObjectDeclaration, supplement: NodeSupplement = NodeSupplement()): Node.Expression.ObjectLiteralExpression

Creates a new Node.Expression.ObjectLiteralExpression instance.

Link copied to clipboard
fun packageDirective(names: List<Node.Expression.NameExpression> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.PackageDirective

Creates a new Node.PackageDirective instance.

Link copied to clipboard
fun parenthesizedExpression(innerExpression: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.ParenthesizedExpression

Creates a new Node.Expression.ParenthesizedExpression instance.

Link copied to clipboard
fun parenthesizedType(modifiers: List<Node.Modifier> = listOf(), lPar: Node.Keyword.LPar = Node.Keyword.LPar(), innerType: Node.Type, rPar: Node.Keyword.RPar = Node.Keyword.RPar(), supplement: NodeSupplement = NodeSupplement()): Node.Type.ParenthesizedType

Creates a new Node.Type.ParenthesizedType instance.

Link copied to clipboard
fun postfixUnaryExpression(expression: Node.Expression, operator: Node.Expression.UnaryExpression.UnaryOperator, supplement: NodeSupplement = NodeSupplement()): Node.Expression.PostfixUnaryExpression

Creates a new Node.Expression.PostfixUnaryExpression instance.

Link copied to clipboard
fun prefixUnaryExpression(operator: Node.Expression.UnaryExpression.UnaryOperator, expression: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.PrefixUnaryExpression

Creates a new Node.Expression.PrefixUnaryExpression instance.

Link copied to clipboard
fun primaryConstructor(modifiers: List<Node.Modifier> = listOf(), constructorKeyword: Node.Keyword.Constructor? = null, lPar: Node.Keyword.LPar = Node.Keyword.LPar(), parameters: List<Node.FunctionParameter> = listOf(), rPar: Node.Keyword.RPar = Node.Keyword.RPar(), supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ClassDeclaration.PrimaryConstructor

Creates a new Node.Declaration.ClassDeclaration.PrimaryConstructor instance.

Link copied to clipboard
fun propertyDeclaration(modifiers: List<Node.Modifier> = listOf(), valOrVarKeyword: Node.Keyword.ValOrVarKeyword, lAngle: Node.Keyword.Less? = null, typeParameters: List<Node.TypeParameter> = listOf(), rAngle: Node.Keyword.Greater? = null, receiverType: Node.Type? = null, variable: Node.Variable, typeConstraintSet: Node.PostModifier.TypeConstraintSet? = null, initializerExpression: Node.Expression? = null, delegateExpression: Node.Expression? = null, accessors: List<Node.Declaration.PropertyDeclaration.Accessor> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Declaration.PropertyDeclaration
fun propertyDeclaration(modifiers: List<Node.Modifier> = listOf(), valOrVarKeyword: Node.Keyword.ValOrVarKeyword, lAngle: Node.Keyword.Less? = null, typeParameters: List<Node.TypeParameter> = listOf(), rAngle: Node.Keyword.Greater? = null, receiverType: Node.Type? = null, lPar: Node.Keyword.LPar? = null, variables: List<Node.Variable>, rPar: Node.Keyword.RPar? = null, typeConstraintSet: Node.PostModifier.TypeConstraintSet? = null, initializerExpression: Node.Expression? = null, delegateExpression: Node.Expression? = null, accessors: List<Node.Declaration.PropertyDeclaration.Accessor> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Declaration.PropertyDeclaration

Creates a new Node.Declaration.PropertyDeclaration instance.

Link copied to clipboard
fun rangeWhenCondition(operator: Node.Expression.WhenExpression.WhenConditionRangeOperator, expression: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.WhenExpression.RangeWhenCondition

Creates a new Node.Expression.WhenExpression.RangeWhenCondition instance.

Link copied to clipboard
fun realLiteralExpression(text: String, supplement: NodeSupplement = NodeSupplement()): Node.Expression.RealLiteralExpression

Creates a new Node.Expression.RealLiteralExpression instance.

Link copied to clipboard
fun returnExpression(label: Node.Expression.NameExpression? = null, expression: Node.Expression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Expression.ReturnExpression

Creates a new Node.Expression.ReturnExpression instance.

Link copied to clipboard
fun secondaryConstructor(modifiers: List<Node.Modifier> = listOf(), constructorKeyword: Node.Keyword.Constructor = Node.Keyword.Constructor(), lPar: Node.Keyword.LPar = Node.Keyword.LPar(), parameters: List<Node.FunctionParameter> = listOf(), rPar: Node.Keyword.RPar = Node.Keyword.RPar(), delegationCall: Node.Expression.CallExpression? = null, block: Node.Expression.BlockExpression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ClassOrObject.ClassBody.SecondaryConstructor

Creates a new Node.Declaration.ClassOrObject.ClassBody.SecondaryConstructor instance.

Link copied to clipboard
fun semicolon(supplement: NodeSupplement = NodeSupplement()): Node.Extra.Semicolon

Creates a new Node.Extra.Semicolon instance.

Link copied to clipboard
fun setter(modifiers: List<Node.Modifier> = listOf(), lPar: Node.Keyword.LPar? = null, parameter: Node.FunctionParameter? = null, rPar: Node.Keyword.RPar? = null, postModifiers: List<Node.PostModifier> = listOf(), body: Node.Expression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.PropertyDeclaration.Setter

Creates a new Node.Declaration.PropertyDeclaration.Setter instance.

Link copied to clipboard
fun simpleType(modifiers: List<Node.Modifier> = listOf(), qualifiers: List<Node.Type.SimpleType.SimpleTypeQualifier> = listOf(), name: Node.Expression.NameExpression, lAngle: Node.Keyword.Less? = null, typeArguments: List<Node.TypeArgument> = listOf(), rAngle: Node.Keyword.Greater? = null, supplement: NodeSupplement = NodeSupplement()): Node.Type.SimpleType

Creates a new Node.Type.SimpleType instance.

Link copied to clipboard
fun simpleTypeQualifier(name: Node.Expression.NameExpression, lAngle: Node.Keyword.Less? = null, typeArguments: List<Node.TypeArgument> = listOf(), rAngle: Node.Keyword.Greater? = null, supplement: NodeSupplement = NodeSupplement()): Node.Type.SimpleType.SimpleTypeQualifier

Creates a new Node.Type.SimpleType.SimpleTypeQualifier instance.

Link copied to clipboard
fun stringLiteralExpression(entries: List<Node.Expression.StringLiteralExpression.StringEntry> = listOf(), raw: Boolean = false, supplement: NodeSupplement = NodeSupplement()): Node.Expression.StringLiteralExpression

Creates a new Node.Expression.StringLiteralExpression instance.

Link copied to clipboard
fun superExpression(typeArgument: Node.TypeArgument? = null, label: Node.Expression.NameExpression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Expression.SuperExpression

Creates a new Node.Expression.SuperExpression instance.

Link copied to clipboard
fun templateStringEntry(expression: Node.Expression, short: Boolean = false, supplement: NodeSupplement = NodeSupplement()): Node.Expression.StringLiteralExpression.TemplateStringEntry

Creates a new Node.Expression.StringLiteralExpression.TemplateStringEntry instance.

Link copied to clipboard
fun thisExpression(label: Node.Expression.NameExpression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Expression.ThisExpression

Creates a new Node.Expression.ThisExpression instance.

Link copied to clipboard
fun throwExpression(expression: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Expression.ThrowExpression

Creates a new Node.Expression.ThrowExpression instance.

Link copied to clipboard
fun Node.toSource(): String

Converts the given node to source code.

Link copied to clipboard
fun trailingComma(supplement: NodeSupplement = NodeSupplement()): Node.Extra.TrailingComma

Creates a new Node.Extra.TrailingComma instance.

Link copied to clipboard

Defines the transform function. This function will be called for each target file.

Link copied to clipboard
fun tryExpression(block: Node.Expression.BlockExpression, catchClauses: List<Node.Expression.TryExpression.CatchClause> = listOf(), finallyBlock: Node.Expression.BlockExpression? = null, supplement: NodeSupplement = NodeSupplement()): Node.Expression.TryExpression

Creates a new Node.Expression.TryExpression instance.

Link copied to clipboard
fun typeAliasDeclaration(modifiers: List<Node.Modifier> = listOf(), name: Node.Expression.NameExpression, lAngle: Node.Keyword.Less? = null, typeParameters: List<Node.TypeParameter> = listOf(), rAngle: Node.Keyword.Greater? = null, type: Node.Type, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.TypeAliasDeclaration

Creates a new Node.Declaration.TypeAliasDeclaration instance.

Link copied to clipboard
fun typeArgument(modifiers: List<Node.Modifier> = listOf(), type: Node.Type, supplement: NodeSupplement = NodeSupplement()): Node.TypeArgument

Creates a new Node.TypeArgument instance.

Link copied to clipboard
fun typeClassParent(type: Node.Type, supplement: NodeSupplement = NodeSupplement()): Node.Declaration.ClassOrObject.TypeClassParent

Creates a new Node.Declaration.ClassOrObject.TypeClassParent instance.

Link copied to clipboard
fun typeConstraint(annotationSets: List<Node.Modifier.AnnotationSet> = listOf(), name: Node.Expression.NameExpression, type: Node.Type, supplement: NodeSupplement = NodeSupplement()): Node.PostModifier.TypeConstraintSet.TypeConstraint

Creates a new Node.PostModifier.TypeConstraintSet.TypeConstraint instance.

Link copied to clipboard
fun typeConstraintSet(constraints: List<Node.PostModifier.TypeConstraintSet.TypeConstraint> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.PostModifier.TypeConstraintSet

Creates a new Node.PostModifier.TypeConstraintSet instance.

Link copied to clipboard
fun typeParameter(modifiers: List<Node.Modifier> = listOf(), name: Node.Expression.NameExpression, type: Node.Type? = null, supplement: NodeSupplement = NodeSupplement()): Node.TypeParameter

Creates a new Node.TypeParameter instance.

Link copied to clipboard
fun typeWhenCondition(operator: Node.Expression.WhenExpression.WhenConditionTypeOperator, type: Node.Type, supplement: NodeSupplement = NodeSupplement()): Node.Expression.WhenExpression.TypeWhenCondition

Creates a new Node.Expression.WhenExpression.TypeWhenCondition instance.

Link copied to clipboard
fun valueArgument(name: Node.Expression.NameExpression? = null, spreadOperator: Node.Keyword.Asterisk? = null, expression: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.ValueArgument

Creates a new Node.ValueArgument instance.

Link copied to clipboard
fun variable(annotationSets: List<Node.Modifier.AnnotationSet> = listOf(), name: Node.Expression.NameExpression, type: Node.Type? = null, supplement: NodeSupplement = NodeSupplement()): Node.Variable

Creates a new Node.Variable instance.

Link copied to clipboard
fun whenExpression(whenKeyword: Node.Keyword.When = Node.Keyword.When(), subject: Node.Expression.WhenExpression.WhenSubject? = null, branches: List<Node.Expression.WhenExpression.WhenBranch> = listOf(), supplement: NodeSupplement = NodeSupplement()): Node.Expression.WhenExpression

Creates a new Node.Expression.WhenExpression instance.

Link copied to clipboard
fun whenSubject(lPar: Node.Keyword.LPar = Node.Keyword.LPar(), annotationSets: List<Node.Modifier.AnnotationSet> = listOf(), variable: Node.Variable? = null, expression: Node.Expression, rPar: Node.Keyword.RPar = Node.Keyword.RPar(), supplement: NodeSupplement = NodeSupplement()): Node.Expression.WhenExpression.WhenSubject

Creates a new Node.Expression.WhenExpression.WhenSubject instance.

Link copied to clipboard
fun whileStatement(lPar: Node.Keyword.LPar = Node.Keyword.LPar(), condition: Node.Expression, rPar: Node.Keyword.RPar = Node.Keyword.RPar(), body: Node.Expression, supplement: NodeSupplement = NodeSupplement()): Node.Statement.WhileStatement

Creates a new Node.Statement.WhileStatement instance.

Link copied to clipboard
fun whitespace(text: String, supplement: NodeSupplement = NodeSupplement()): Node.Extra.Whitespace

Creates a new Node.Extra.Whitespace instance.