⁠
joe: 2025
- /*
- * Minecraft Development for IntelliJ
- *
- * https://mcdev.io/
- *
- * Copyright (C) 2024 minecraft-dev
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, version 3.0 only.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- */
- package io.mcdev.obfex.formats.proguard.lang
- import com.intellij.lang.ASTNode
- import com.intellij.lang.ParserDefinition
- import com.intellij.lang.PsiParser
- import com.intellij.lexer.Lexer
- import com.intellij.openapi.project.Project
- import com.intellij.psi.FileViewProvider
- import com.intellij.psi.PsiElement
- import com.intellij.psi.PsiFile
- import com.intellij.psi.tree.IFileElementType
- import com.intellij.psi.tree.TokenSet
- import io.mcdev.obfex.formats.proguard.gen.parser.ProGuardParser
- import io.mcdev.obfex.formats.proguard.gen.psi.ProGuardTypes
- import io.mcdev.obfex.formats.proguard.lang.psi.ProGuardLexerAdapter
- class ProGuardParserDefinition : ParserDefinition {
- override fun createLexer(project: Project?): Lexer = ProGuardLexerAdapter()
- override fun getCommentTokens(): TokenSet = COMMENTS
- override fun getStringLiteralElements(): TokenSet = TokenSet.EMPTY
- override fun createParser(project: Project?): PsiParser = ProGuardParser()
- override fun getFileNodeType(): IFileElementType = FILE
- override fun createFile(viewProvider: FileViewProvider): PsiFile = ProGuardFile(viewProvider)
- override fun createElement(node: ASTNode?): PsiElement = ProGuardTypes.Factory.createElement(node)
- }
- private val COMMENTS = TokenSet.create(ProGuardTypes.COMMENT)
- private val FILE = IFileElementType(ProGuardLanguage)
- /*
- * Minecraft Development for IntelliJ
- *
- * https://mcdev.io/
- *
- * Copyright (C) 2025 minecraft-dev
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, version 3.0 only.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- */
- package io.mcdev.obfex.formats.proguard.lang
- import com.intellij.lang.ASTNode
- import com.intellij.lang.ParserDefinition
- import com.intellij.lang.PsiParser
- import com.intellij.lexer.Lexer
- import com.intellij.openapi.project.Project
- import com.intellij.psi.FileViewProvider
- import com.intellij.psi.PsiElement
- import com.intellij.psi.PsiFile
- import com.intellij.psi.tree.IFileElementType
- import com.intellij.psi.tree.TokenSet
- import io.mcdev.obfex.formats.proguard.gen.parser.ProGuardParser
- import io.mcdev.obfex.formats.proguard.gen.psi.ProGuardTypes
- import io.mcdev.obfex.formats.proguard.lang.psi.ProGuardLexerAdapter
- class ProGuardParserDefinition : ParserDefinition {
- override fun createLexer(project: Project?): Lexer = ProGuardLexerAdapter()
- override fun getCommentTokens(): TokenSet = COMMENTS
- override fun getStringLiteralElements(): TokenSet = TokenSet.EMPTY
- override fun createParser(project: Project?): PsiParser = ProGuardParser()
- override fun getFileNodeType(): IFileElementType = FILE
- override fun createFile(viewProvider: FileViewProvider): PsiFile = ProGuardFile(viewProvider)
- override fun createElement(node: ASTNode?): PsiElement = ProGuardTypes.Factory.createElement(node)
- }
- private val COMMENTS = TokenSet.create(ProGuardTypes.COMMENT)
- private val FILE = IFileElementType(ProGuardLanguage)