Skip to content

Commit

Permalink
Merge pull request #28 from unv-unv/unv/code-reformat-5
Browse files Browse the repository at this point in the history
Code reformat using IJ4 code style (part 5).
  • Loading branch information
VISTALL authored Jul 28, 2024
2 parents c4dc056 + 05e993c commit e9abb72
Show file tree
Hide file tree
Showing 25 changed files with 941 additions and 902 deletions.
24 changes: 12 additions & 12 deletions grammar-kit-core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* @since 10/02/2023
*/
module consulo.devkit.grammar.kit.core {
requires consulo.language.api;
requires consulo.language.impl;
requires consulo.language.api;
requires consulo.language.impl;

exports consulo.devkit.grammarKit.generator;
exports consulo.devkit.grammarKit.icon;
exports org.intellij.grammar;
exports org.intellij.grammar.analysis;
exports org.intellij.grammar.config;
exports org.intellij.grammar.generator;
exports org.intellij.grammar.java;
exports org.intellij.grammar.parser;
exports org.intellij.grammar.psi;
exports org.intellij.grammar.psi.impl;
exports consulo.devkit.grammarKit.generator;
exports consulo.devkit.grammarKit.icon;
exports org.intellij.grammar;
exports org.intellij.grammar.analysis;
exports org.intellij.grammar.config;
exports org.intellij.grammar.generator;
exports org.intellij.grammar.java;
exports org.intellij.grammar.parser;
exports org.intellij.grammar.psi;
exports org.intellij.grammar.psi.impl;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,32 @@
* Time: 22:46
*/
public class BnfFileType extends LanguageFileType {
public static final BnfFileType INSTANCE = new BnfFileType();

protected BnfFileType() {
super(BnfLanguage.INSTANCE);
}

@Nonnull
@Override
public String getId() {
return "BNF";
}

@Nonnull
@Override
public LocalizeValue getDescription() {
return LocalizeValue.localizeTODO("BNF Grammar");
}

@Nonnull
@Override
public String getDefaultExtension() {
return "bnf";
}

@Override
public Image getIcon() {
return GrammarKitIconGroup.grammarfile();
}
public static final BnfFileType INSTANCE = new BnfFileType();

protected BnfFileType() {
super(BnfLanguage.INSTANCE);
}

@Nonnull
@Override
public String getId() {
return "BNF";
}

@Nonnull
@Override
public LocalizeValue getDescription() {
return LocalizeValue.localizeTODO("BNF Grammar");
}

@Nonnull
@Override
public String getDefaultExtension() {
return "bnf";
}

@Override
public Image getIcon() {
return GrammarKitIconGroup.grammarfile();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
*/
@ExtensionImpl
public class BnfFileTypeFactory extends FileTypeFactory {
@Override
public void createFileTypes(@Nonnull FileTypeConsumer fileTypeConsumer) {
fileTypeConsumer.consume(BnfFileType.INSTANCE);
}
@Override
public void createFileTypes(@Nonnull FileTypeConsumer fileTypeConsumer) {
fileTypeConsumer.consume(BnfFileType.INSTANCE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
* Date: 17.07.11 2:55
*/
public interface BnfIcons {
Image RULE = AllIcons.Nodes.Method;
Image EXTERNAL_RULE = AllIcons.Nodes.AbstractMethod;
Image ATTRIBUTE = AllIcons.Nodes.Attribute;
Image RULE = AllIcons.Nodes.Method;
Image EXTERNAL_RULE = AllIcons.Nodes.AbstractMethod;
Image ATTRIBUTE = AllIcons.Nodes.Attribute;

Image RELATED_METHOD = AllIcons.Gutter.ImplementedMethod;
Image RELATED_METHOD = AllIcons.Gutter.ImplementedMethod;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@
* Time: 22:44
*/
public class BnfLanguage extends Language {
public static final BnfLanguage INSTANCE = new BnfLanguage();

public static final BnfLanguage INSTANCE = new BnfLanguage();
protected BnfLanguage() {
super("BNF");
}

protected BnfLanguage() {
super("BNF");
}

@Nonnull
@Override
public String getDisplayName() {
return "Grammar-Kit BNF";
}
@Nonnull
@Override
public String getDisplayName() {
return "Grammar-Kit BNF";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,67 +39,66 @@
*/
@ExtensionImpl
public class BnfParserDefinition implements ParserDefinition {
public static final IFileElementType BNF_FILE_ELEMENT_TYPE = new IFileElementType("BNF_FILE", BnfLanguage.INSTANCE);
public static final TokenSet WS = TokenSet.create(TokenType.WHITE_SPACE);
public static final IElementType BNF_LINE_COMMENT = BnfTypes.BNF_LINE_COMMENT;
public static final IElementType BNF_BLOCK_COMMENT = BnfTypes.BNF_BLOCK_COMMENT;
public static final TokenSet COMMENTS = TokenSet.create(BNF_LINE_COMMENT, BNF_BLOCK_COMMENT);
public static final TokenSet LITERALS = TokenSet.create(BnfTypes.BNF_STRING);

public static final IFileElementType BNF_FILE_ELEMENT_TYPE = new IFileElementType("BNF_FILE", BnfLanguage.INSTANCE);
public static final TokenSet WS = TokenSet.create(TokenType.WHITE_SPACE);
public static final IElementType BNF_LINE_COMMENT = BnfTypes.BNF_LINE_COMMENT;
public static final IElementType BNF_BLOCK_COMMENT = BnfTypes.BNF_BLOCK_COMMENT;
public static final TokenSet COMMENTS = TokenSet.create(BNF_LINE_COMMENT, BNF_BLOCK_COMMENT);
public static final TokenSet LITERALS = TokenSet.create(BnfTypes.BNF_STRING);
@Nonnull
@Override
public Language getLanguage() {
return BnfLanguage.INSTANCE;
}

@Nonnull
@Override
public Language getLanguage() {
return BnfLanguage.INSTANCE;
}
@Nonnull
@Override
public Lexer createLexer(LanguageVersion languageVersion) {
return new BnfLexer();
}

@Nonnull
@Override
public Lexer createLexer(LanguageVersion languageVersion) {
return new BnfLexer();
}
@Override
public PsiParser createParser(LanguageVersion languageVersion) {
return new GrammarParser();
}

@Override
public PsiParser createParser(LanguageVersion languageVersion) {
return new GrammarParser();
}
@Override
public IFileElementType getFileNodeType() {
return BNF_FILE_ELEMENT_TYPE;
}

@Override
public IFileElementType getFileNodeType() {
return BNF_FILE_ELEMENT_TYPE;
}
@Nonnull
@Override
public TokenSet getWhitespaceTokens(LanguageVersion languageVersion) {
return WS;
}

@Nonnull
@Override
public TokenSet getWhitespaceTokens(LanguageVersion languageVersion) {
return WS;
}
@Nonnull
@Override
public TokenSet getCommentTokens(LanguageVersion languageVersion) {
return COMMENTS;
}

@Nonnull
@Override
public TokenSet getCommentTokens(LanguageVersion languageVersion) {
return COMMENTS;
}
@Nonnull
@Override
public TokenSet getStringLiteralElements(LanguageVersion languageVersion) {
return LITERALS;
}

@Nonnull
@Override
public TokenSet getStringLiteralElements(LanguageVersion languageVersion) {
return LITERALS;
}
@Nonnull
@Override
public PsiElement createElement(ASTNode astNode) {
return BnfTypes.Factory.createElement(astNode);
}

@Nonnull
@Override
public PsiElement createElement(ASTNode astNode) {
return BnfTypes.Factory.createElement(astNode);
}
@Override
public PsiFile createFile(FileViewProvider fileViewProvider) {
return new BnfFileImpl(fileViewProvider);
}

@Override
public PsiFile createFile(FileViewProvider fileViewProvider) {
return new BnfFileImpl(fileViewProvider);
}

@Override
public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode astNode, ASTNode astNode1) {
return SpaceRequirements.MAY;
}
@Override
public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode astNode, ASTNode astNode1) {
return SpaceRequirements.MAY;
}
}
Loading

0 comments on commit e9abb72

Please sign in to comment.