All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jtransc.ast.ast_mangling.kt Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.6.8
Show newest version
package com.jtransc.ast

object AstTypeJavaDescriptorMangler {
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// FieldDescriptor: FieldType
	// FieldType: BaseType | ObjectType | ArrayType
	// BaseType: (one of) B C D F I J S Z
	// ObjectType: L ClassName ;
	// ArrayType: [ ComponentType
	// ComponentType: FieldType

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// MethodDescriptor: ( {ParameterDescriptor} ) ReturnDescriptor
	// ParameterDescriptor: FieldType
	// ReturnDescriptor: FieldType | VoidDescriptor
	// VoidDescriptor: V
}

object AstTypeJavaSignatureMangler {
	/*
	// TypeArguments: < TypeArgument {TypeArgument} >
	fun readTypeArguments(r:StrReader) {
		r.expect("<")
		r.readList(1) { readTypeArgument(it) }
		r.expect(">")
	}

	// TypeArgument: [WildcardIndicator] ReferenceTypeSignature | *
	// WildcardIndicator: + -
	fun readTypeArgument(r:StrReader) {
		when (r.peekch()) {
			'*' -> r.readch()
			'+', '-' -> {
				r.readch()
				readReferenceTypeSignature(r)
			}
		}
	}
	*/

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// ReferenceTypeSignature: ClassTypeSignature | TypeVariableSignature | ArrayTypeSignature
	// ClassTypeSignature: L [PackageSpecifier] SimpleClassTypeSignature {ClassTypeSignatureSuffix} ;
	// PackageSpecifier: Identifier / {PackageSpecifier}
	// SimpleClassTypeSignature: Identifier [TypeArguments]


	// ClassTypeSignatureSuffix: . SimpleClassTypeSignature
	// TypeVariableSignature: T Identifier ;
	// ArrayTypeSignature: [ JavaTypeSignature

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// ClassSignature: [TypeParameters] SuperclassSignature {SuperinterfaceSignature}
	// TypeParameters: < TypeParameter {TypeParameter} >
	// TypeParameter: Identifier ClassBound {InterfaceBound}
	// ClassBound: : [ReferenceTypeSignature]
	// InterfaceBound: : ReferenceTypeSignature
	// SuperclassSignature: ClassTypeSignature
	// SuperinterfaceSignature: ClassTypeSignature

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// MethodSignature:
	// [TypeParameters] ( {JavaTypeSignature} ) Result {ThrowsSignature}
	// Result:
	// JavaTypeSignature
	// VoidDescriptor
	// ThrowsSignature:
	// ^ ClassTypeSignature
	// ^ TypeVariableSignature
	// VoidDescriptor: V

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// FieldSignature: ReferenceTypeSignature
}

/*
object AstTypeJavaDescriptorAndSignatureMangler {
	fun demangleField(str:StrReader):AstType {

	}

	fun demangleMethod(str:StrReader):AstType {

	}
}
*/




© 2015 - 2024 Weber Informatics LLC | Privacy Policy