package dyvil.tools.compiler.ast.modifiers;

import dyvil.reflect.Modifiers;
import dyvil.tools.compiler.transform.DyvilKeywords;

public enum BaseModifiers implements Modifier
{
	// Visibility Modifiers
	PACKAGE_PRIVATE(0, "package private"),
	PRIVATE(Modifiers.PRIVATE, "private", DyvilKeywords.PRIVATE),
	PRIVATE_PROTECTED(Modifiers.PROTECTED, "private protected"),
	PROTECTED(Modifiers.PROTECTED, "protected", DyvilKeywords.PROTECTED),
	PACKAGE_PROTECTED(Modifiers.PUBLIC, "package protected"),
	PUBLIC(Modifiers.PUBLIC, "public", DyvilKeywords.PUBLIC),
	INTERNAL(Modifiers.INTERNAL, "internal", DyvilKeywords.INTERNAL),
	// Access Modifiers
	STATIC(Modifiers.STATIC, "static", DyvilKeywords.STATIC),
	FINAL(Modifiers.FINAL, "final", DyvilKeywords.FINAL),
	ABSTRACT(Modifiers.ABSTRACT, "abstract", DyvilKeywords.ABSTRACT),
	// Method Modifiers
	PREFIX(Modifiers.PREFIX, "prefix", DyvilKeywords.PREFIX),
	INFIX(Modifiers.INFIX, "infix", DyvilKeywords.INFIX),
	POSTFIX(Modifiers.INFIX, "postfix", DyvilKeywords.POSTFIX),
	OVERRIDE(Modifiers.OVERRIDE, "override", DyvilKeywords.OVERRIDE),
	INLINE(Modifiers.INLINE, "inline", DyvilKeywords.INLINE),
	SYNCHRONIZED(Modifiers.SYNCHRONIZED, "synchronized", DyvilKeywords.SYNCHRONIZED),
	EXTENSION(Modifiers.EXTENSION, "extension", DyvilKeywords.EXTENSION),
	// Class Modifiers
	SEALED(Modifiers.SEALED, "sealed", DyvilKeywords.SEALED),
	CASE(Modifiers.CASE_CLASS, "case", DyvilKeywords.CASE),
	FUNCTIONAL(Modifiers.FUNCTIONAL, "functional", DyvilKeywords.FUNCTIONAL),
	// Field Modifiers
	CONST(Modifiers.CONST, "const", DyvilKeywords.CONST),
	LAZY(Modifiers.LAZY, "lazy", DyvilKeywords.LAZY);

	private final int    intValue;
	private final int    keyword;
	private final String name;

	BaseModifiers(int intValue, String name)
	{
		this.intValue = intValue;
		this.name = name;
		this.keyword = -1;
	}

	BaseModifiers(int intValue, String name, int keyword)
	{
		this.intValue = intValue;
		this.name = name;
		this.keyword = keyword;
	}

	@Override
	public int intValue()
	{
		return this.intValue;
	}

	@Override
	public void toString(StringBuilder builder)
	{
		builder.append(this.name);
	}
}

@@ -73,61 +73,8 @@
 ers;
-%0Aimport dyvil.tools.compiler.transform.DyvilKeywords;
 %0A%0Apu
@@ -225,31 +225,8 @@
 ate%22
-, DyvilKeywords.PRIVATE
 ),%0A%09
@@ -333,33 +333,8 @@
 ted%22
-, DyvilKeywords.PROTECTED
 ),%0A%09
@@ -429,30 +429,8 @@
 lic%22
-, DyvilKeywords.PUBLIC
 ),%0A%09
@@ -472,32 +472,8 @@
 nal%22
-, DyvilKeywords.INTERNAL
 ),%0A%09
@@ -530,30 +530,8 @@
 tic%22
-, DyvilKeywords.STATIC
 ),%0A%09
@@ -564,29 +564,8 @@
 nal%22
-, DyvilKeywords.FINAL
 ),%0A%09
@@ -607,32 +607,8 @@
 act%22
-, DyvilKeywords.ABSTRACT
 ),%0A%09
@@ -665,30 +665,8 @@
 fix%22
-, DyvilKeywords.PREFIX
 ),%0A%09
@@ -699,29 +699,8 @@
 fix%22
-, DyvilKeywords.INFIX
 ),%0A%09
@@ -737,31 +737,8 @@
 fix%22
-, DyvilKeywords.POSTFIX
 ),%0A%09
@@ -780,32 +780,8 @@
 ide%22
-, DyvilKeywords.OVERRIDE
 ),%0A%09
@@ -817,30 +817,8 @@
 ine%22
-, DyvilKeywords.INLINE
 ),%0A%09
@@ -872,36 +872,8 @@
 zed%22
-, DyvilKeywords.SYNCHRONIZED
 ),%0A%09
@@ -918,33 +918,8 @@
 ion%22
-, DyvilKeywords.EXTENSION
 ),%0A%09
@@ -975,30 +975,8 @@
 led%22
-, DyvilKeywords.SEALED
 ),%0A%09
@@ -1012,28 +1012,8 @@
 ase%22
-, DyvilKeywords.CASE
 ),%0A%09
@@ -1061,34 +1061,8 @@
 nal%22
-, DyvilKeywords.FUNCTIONAL
 ),%0A%09
@@ -1115,29 +1115,8 @@
 nst%22
-, DyvilKeywords.CONST
 ),%0A%09
@@ -1146,28 +1146,8 @@
 azy%22
-, DyvilKeywords.LAZY
 );%0A%0A
@@ -1182,39 +1182,8 @@
 ue;%0A
-%09private final int    keyword;%0A
 %09pri
@@ -1304,165 +1304,8 @@
 me;%0A
-%09%09this.keyword = -1;%0A%09%7D%0A%0A%09BaseModifiers(int intValue, String name, int keyword)%0A%09%7B%0A%09%09this.intValue = intValue;%0A%09%09this.name = name;%0A%09%09this.keyword = keyword;%0A
 %09%7D%0A%0A

Update BaseModifiers class