Skip to content

Custom classes #26

Open
Open
@TPGamesNL

Description

@TPGamesNL

Be able to extend classes as well as implement them (maybe both at the same time).
Resources:
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/sun/misc/ProxyGenerator.java
https://marschall.github.io/2017/07/11/java-proxy-anatomy.html (see this one to save generated files)
Also experiment if ClassLoader#defineClass can be used properly (link)
Idea for syntax:

class extends AbstractMap:
# class [extends %javatype%] [implements %javatypes%]
	
	# access modifier: [(public|private|protected)]
	# %access modifier% %javatype% %identifier%
	public Integer testField
	
	# %access modifier% (%javatype%|void) %identifier%([parameters])
	# %identifier%: %javatype%
	public void doMethod(a: Integer, b: String):
		broadcast "HEY"

# note: %identifier% and %access modifier% aren't actual types, just to make it easy to read the syntax here

# look into:
	# class name
	# primitive types
	# syntax for varargs

EDIT: probably name this custom classes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions