macros define STRING string, (variable_declaration variable.name)

enum access_type { public, protected, private }

abstract keyword access_modifier { abstract access_type type }

keyword public : access_modifier { type = access_type.public }

keyword protected : access_modifier { type = access_type.protected }

keyword private : access_modifier { type = access_type.private }

abstract class member_identification { public abstract bool is(member_identification identification) }

class key_member_identification : member_identification { public constructor(identifier: string) { this.identifier = identifier }

private identifier: string

public override bool is(member_identification identification) {
	if (identification is not key_member_identification key) then {
		return false
	}
	
	return key.identifier == identification
}

}

class class_member { public constructor(identification: identification value: concrete) { this.identification = identification this.value = value }

private identification: identification

private value: concrete

}

container class_container { required dictionary<member_identification, class_member> members

class_member get(member_identification identification) {
	for member in members
		if !member.key.identification.is(identification) then {
			continue
		}

		return member
	}

	return none
}

}

abstract type class_object { required class_container container

operator .(left: class_object, right: STRING): concrete or class_member {
	var key = new key_member_identification(right)

	return container.get(key).member
}

operator =(left: class_member, right: STRING): concrete {
	var key = new key_member_identification(right)

	return container.get(key).member
}

}

abstract expression class_member { access: access_modifier abstract name: STRING }

expression key_class_member : class_member { name = variable.name variable: variable_declaration }

expression class_declaration { access: access_modifier except protected name: STRING token colon optional repeat inherit: STRING before token semicolon optional repeat class_member[] members before keyword end }

keyword class { class_declaration declaration

dictionary<member_identification, class_member> members

parsed {
	for member in declaration.members {
		if member is key_class_member key then {
			var identification = new key_member_identification(key.name)
			var instance = new class_member(identification, member.variable.value) 

			members.add(identification, instance)
		}
	}

	global type class_object, declaration.name
		container = class_container() {
			members = members
		}
	}
}

}

macros define SYNTAX_STRING string, (variable_declaration variable.name)

keyword create { evaluated() { syntax() { keyword create name: SYNTAX_STRING token left_par arguments: array any arguments = optional repeatable token right_par }

	executed(context) {
		var type = (type name) allocate(sizeof(type name))

		-- Как нибудь вызываем конструктор и передаём аргументы

		return type
	}
}

}

keyword class { declared() { syntax() { keyword class name: SYNTAX_STRING token colon optional inherit: array SYNTAX_STRING token left_curly members: array class_member = optional repeatable { member: class_member } token right_curly }

	-- Контекст представляет собой область видимости вызывающего этот кейворд
	execute(context) {
		for member in declaration.members {
			if member is key_class_member key then {
				var identification = new key_member_identification(key.name)
				var instance = new class_member(identification, member.variable.value) 

				members.add(identification, instance)
			}
		}

		-- Мы во всей видимости программы обьявляем тип на основе другого, у которого имя задаёт при -- обьявлении
		context.declare_type(type class_object, declaration.name {
			container = class_container() {
				members = members
			}
		})
	}
}

}

class Player -- declared, потому что не используем как значение

var player = create Player() -- использутеся evaluated, потому что значение

оба примера поправки друг друга, просмотри их как пример мощи и оцени