|
| 1 | +/* |
| 2 | + * Minecraft Dev for IntelliJ |
| 3 | + * |
| 4 | + * https://minecraftdev.org |
| 5 | + * |
| 6 | + * Copyright (c) 2021 minecraft-dev |
| 7 | + * |
| 8 | + * MIT License |
| 9 | + */ |
| 10 | + |
| 11 | +{ |
| 12 | + parserClass="com.demonwav.mcdev.platform.mcp.aw.gen.parser.AwParser" |
| 13 | + |
| 14 | + extends="com.intellij.extapi.psi.ASTWrapperPsiElement" |
| 15 | + |
| 16 | + psiClassPrefix="Aw" |
| 17 | + psiImplClassSuffix="Impl" |
| 18 | + psiPackage="com.demonwav.mcdev.platform.mcp.aw.gen.psi" |
| 19 | + psiImplPackage="com.demonwav.mcdev.platform.mcp.aw.gen.psi.impl" |
| 20 | + |
| 21 | + elementTypeHolderClass="com.demonwav.mcdev.platform.mcp.aw.gen.psi.AwTypes" |
| 22 | + elementTypeClass="com.demonwav.mcdev.platform.mcp.aw.psi.AwElementType" |
| 23 | + tokenTypeClass="com.demonwav.mcdev.platform.mcp.aw.psi.AwTokenType" |
| 24 | + |
| 25 | + consumeTokenMethod="consumeTokenFast" |
| 26 | +} |
| 27 | + |
| 28 | +aw_file ::= header_line line* |
| 29 | + |
| 30 | +private header_line ::= !<<eof>> header COMMENT? end_line |
| 31 | + |
| 32 | +private line ::= !<<eof>> entry? COMMENT? end_line |
| 33 | +private end_line ::= crlf | <<eof>> |
| 34 | + |
| 35 | +header ::= HEADER_NAME HEADER_VERSION_ELEMENT HEADER_NAMESPACE_ELEMENT { |
| 36 | + mixin="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.impl.AwHeaderImplMixin" |
| 37 | + implements="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.AwHeaderMixin" |
| 38 | +} |
| 39 | + |
| 40 | +private entry ::= class_entry | method_entry | field_entry { |
| 41 | + mixin="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.impl.AwEntryImplMixin" |
| 42 | + implements="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.AwEntryMixin" |
| 43 | + recoverWhile = line_recover |
| 44 | +} |
| 45 | + |
| 46 | +class_entry ::= access class_literal class_name { |
| 47 | + mixin="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.impl.AwClassEntryImplMixin" |
| 48 | + implements="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.AwClassEntryMixin" |
| 49 | +} |
| 50 | + |
| 51 | +method_entry ::= access method_literal class_name member_name method_desc{ |
| 52 | + mixin="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.impl.AwMethodEntryImplMixin" |
| 53 | + implements="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.AwMethodEntryMixin" |
| 54 | +} |
| 55 | + |
| 56 | +field_entry ::= access field_literal class_name member_name field_desc{ |
| 57 | + mixin="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.impl.AwFieldEntryImplMixin" |
| 58 | + implements="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.AwFieldEntryMixin" |
| 59 | +} |
| 60 | + |
| 61 | +private line_recover ::= !(end_line | COMMENT) |
| 62 | + |
| 63 | +access ::= ACCESS_ELEMENT { |
| 64 | + methods=[ |
| 65 | + accessElement="ACCESS_ELEMENT" |
| 66 | + ] |
| 67 | +} |
| 68 | + |
| 69 | +class_literal ::= CLASS_ELEMENT |
| 70 | + |
| 71 | +method_literal ::= METHOD_ELEMENT |
| 72 | + |
| 73 | +field_literal ::= FIELD_ELEMENT |
| 74 | + |
| 75 | +class_name ::= CLASS_NAME_ELEMENT { |
| 76 | + mixin="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.impl.AwClassNameImplMixin" |
| 77 | + implements="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.AwClassNameMixin" |
| 78 | + methods=[ |
| 79 | + classNameElement="CLASS_NAME_ELEMENT" |
| 80 | + ] |
| 81 | +} |
| 82 | + |
| 83 | +member_name ::= NAME_ELEMENT { |
| 84 | + mixin= "com.demonwav.mcdev.platform.mcp.aw.psi.mixins.impl.AwMemberNameImplMixin" |
| 85 | + implements="com.demonwav.mcdev.platform.mcp.aw.psi.mixins.AwMemberNameMixin" |
| 86 | + methods=[ |
| 87 | + nameElement="NAME_ELEMENT" |
| 88 | + ] |
| 89 | +} |
| 90 | + |
| 91 | +method_desc ::= OPEN_PAREN argument* CLOSE_PAREN return_value |
| 92 | + |
| 93 | +field_desc ::= argument |
| 94 | + |
| 95 | +argument ::= PRIMITIVE | CLASS_VALUE { |
| 96 | + methods=[ |
| 97 | + primitive="PRIMITIVE" |
| 98 | + classValue="CLASS_VALUE" |
| 99 | + ] |
| 100 | +} |
| 101 | + |
| 102 | +return_value ::= PRIMITIVE | CLASS_VALUE { |
| 103 | + methods=[ |
| 104 | + primitive="PRIMITIVE" |
| 105 | + classValue="CLASS_VALUE" |
| 106 | + ] |
| 107 | +} |
0 commit comments