LanguageProvider

A simple interface that everything, that supplies a language, should implement. Examples include each Node, but also transformation steps, such as Handler.

Inheritors

Properties

Link copied to clipboard
abstract val language: Language<*>?

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Checks, whether the given Type is a primitive in the language specified in the LanguageProvider.

Link copied to clipboard

Creates a new Annotation. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new AnnotationMember. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new AssertStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newAssignExpression(operatorCode: String = "=", lhs: List<Expression> = listOf(), rhs: List<Expression> = listOf(), rawNode: Any? = null): AssignExpression

Creates a new AssignExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new BinaryOperator or a ShortCircuitOperator if the language implements HasShortCircuitOperators and if the operatorCode is contained in HasShortCircuitOperators.operatorCodes. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new Block. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new BreakStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newCallExpression(callee: Expression? = null, fqn: CharSequence? = null, template: Boolean = false, rawNode: Any? = null): CallExpression

Creates a new CallExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new CaseStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new CastExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new CatchClause. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newConditionalExpression(condition: Expression, thenExpression: Expression? = null, elseExpression: Expression? = null, type: Type = unknownType(), rawNode: Any? = null): ConditionalExpression

Creates a new ConditionalExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ConstructExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ConstructorDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ContinueStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DeclarationStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DefaultStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DeleteExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DistinctLanguageBlock. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new DoStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new EmptyStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new EnumConstantDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new EnumDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ExpressionList. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newFieldDeclaration(name: CharSequence?, type: Type = unknownType(), modifiers: List<String>? = listOf(), initializer: Expression? = null, implicitInitializerAllowed: Boolean = false, rawNode: Any? = null): FieldDeclaration

Creates a new FieldDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ForEachStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ForStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newFunctionDeclaration(name: CharSequence?, localNameOnly: Boolean = false, rawNode: Any? = null): FunctionDeclaration

Creates a new FunctionDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new FunctionTemplateDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new GotoStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new IfStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newImportDeclaration(import: Name, wildcardImport: Boolean = false, alias: Name? = null, rawNode: Any? = null): ImportDeclaration

Creates a new ImportDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new IncludeDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new InitializerListExpression. This is the top-most Node that a LanguageFrontend or Handler should create. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new KeyValueExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new LabelStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new LambdaExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new LookupScopeStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new MemberCallExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newMemberExpression(name: CharSequence?, base: Expression, memberType: Type = unknownType(), operatorCode: String? = ".", rawNode: Any? = null): MemberExpression

Creates a new MemberExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newMethodDeclaration(name: CharSequence?, isStatic: Boolean = false, recordDeclaration: RecordDeclaration? = null, rawNode: Any? = null): MethodDeclaration

Creates a new MethodDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun LanguageProvider.newName(name: CharSequence, localNameOnly: Boolean = false, namespace: Name? = null): Name

Generates a Name object from the given name. If localNameOnly is set, only the localName is used, otherwise the namespace is added to generate a fqn if the name is not a fqn anyway.

Link copied to clipboard

Creates a new NamespaceDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new NewArrayExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newNewExpression(type: Type = unknownType(), rawNode: Any? = null): NewExpression

Creates a new NewExpression. This is the top-most Node that a LanguageFrontend or Handler should create. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new MemberCallExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newOperatorDeclaration(name: CharSequence, operatorCode: String, recordDeclaration: RecordDeclaration? = null, rawNode: Any? = null): OperatorDeclaration

Creates a new OperatorDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newParameterDeclaration(name: CharSequence?, type: Type = unknownType(), variadic: Boolean = false, rawNode: Any? = null): ParameterDeclaration

Creates a new ParameterDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newProblemDeclaration(problem: String = "", problemType: ProblemNode.ProblemType = ProblemNode.ProblemType.PARSING, rawNode: Any? = null): ProblemDeclaration

Creates a new ProblemDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newProblemExpression(problem: String = "", type: ProblemNode.ProblemType = ProblemNode.ProblemType.PARSING, rawNode: Any? = null): ProblemExpression

Creates a new ProblemExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
Link copied to clipboard
fun MetadataProvider.newRangeExpression(floor: Expression? = null, ceiling: Expression? = null, rawNode: Any? = null): RangeExpression

Creates a new RangeExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new RecordDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new RecordTemplateDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newReference(name: CharSequence?, type: Type = unknownType(), rawNode: Any? = null): Reference

Creates a new Reference. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ReturnStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new SubscriptExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new SwitchStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new SynchronizedStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new ThrowExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TranslationUnitDeclaration. This is the top-most Node that a LanguageFrontend or Handler should create. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TryStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TupleDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TypedefDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newTypeExpression(name: CharSequence?, type: Type = unknownType(), rawNode: Any? = null): TypeExpression

Creates a new TypeExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newTypeIdExpression(operatorCode: String, type: Type = unknownType(), referencedType: Type = unknownType(), rawNode: Any? = null): TypeIdExpression

Creates a new TypeIdExpression. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new TypeParameterDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newUnaryOperator(operatorCode: String, postfix: Boolean, prefix: Boolean, rawNode: Any? = null): UnaryOperator

Creates a new UnaryOperator. This is the top-most Node that a LanguageFrontend or Handler should create. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun MetadataProvider.newVariableDeclaration(name: CharSequence?, type: Type = unknownType(), implicitInitializerAllowed: Boolean = false, rawNode: Any? = null): VariableDeclaration

Creates a new VariableDeclaration. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard

Creates a new WhileStatement. The MetadataProvider receiver will be used to fill different meta-data using Node.applyMetadata. Calling this extension function outside of Kotlin requires an appropriate MetadataProvider, such as a LanguageFrontend as an additional prepended argument.

Link copied to clipboard
fun LanguageProvider.objectType(name: CharSequence, generics: List<Type> = listOf(), rawNode: Any? = null): Type

This function returns an ObjectType with the given name. If a respective Type does not yet exist (in the current scope), it will be created. In order to avoid unnecessary allocation of simple types, we do a pre-check within this function, whether a built-in type exist with the particular name.

Link copied to clipboard

A small utility extension function that uses the language information in a LanguageProvider (such as a Node, a Language, a LanguageFrontend or a Handler) to parse a fully qualified name.

Link copied to clipboard

This function constructs a new primitive Type. Primitive or built-in types are defined in Language.builtInTypes. This function will look up the type by its name, if it fails to find an appropriate build-in type, a TranslationException is thrown. Therefore, this function should primarily be called by language frontends if they are sure that this type is a built-in type, e.g., when constructing literals. It can be useful, if frontends want to check, whether all literal types are correctly registered as built-in types.

Link copied to clipboard

Creates a new UnknownType and sets the appropriate language, if this MetadataProvider includes a LanguageProvider.