Skip to content

Commit

Permalink
Add JavaDoc and some minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasHeneka committed Aug 22, 2023
1 parent 71a6a18 commit e8fbd1c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import de.jplag.antlr.AbstractAntlrLanguage;

/**
* This represents the LLVMIR language as a language supported by JPlag.
* The entry point for the ANTLR parser based LLVM IR language module.
*/
@MetaInfServices(Language.class)
public class LLVMIRLanguage extends AbstractAntlrLanguage {
Expand Down
10 changes: 10 additions & 0 deletions languages/llvmir/src/main/java/de/jplag/llvmir/LLVMIRListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,18 @@
import de.jplag.antlr.AbstractAntlrListener;
import de.jplag.antlr.TokenCollector;

/**
* Extracts tokens from the ANTLR parse tree. The token abstraction includes nesting tokens for functions and basic
* blocks and separate tokens for different elements. These include binary and bitwise instructions, memory operations,
* terminator instructions, conversions, global variables, type definitions, constants, and others.
*/
public class LLVMIRListener extends AbstractAntlrListener {

/**
* New instance
* @param collector The token collector the token will be added to
* @param currentFile The currently processed file
*/
public LLVMIRListener(TokenCollector collector, File currentFile) {
super(collector, currentFile);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@

import org.antlr.v4.runtime.*;

import de.jplag.AbstractParser;
import de.jplag.antlr.AbstractAntlrListener;
import de.jplag.antlr.AbstractAntlrParserAdapter;
import de.jplag.antlr.TokenCollector;
import de.jplag.llvmir.grammar.LLVMIRLexer;
import de.jplag.llvmir.grammar.LLVMIRParser;

/**
* The adapter between {@link AbstractParser} and the ANTLR based parser of this language module.
*/
public class LLVMIRParserAdapter extends AbstractAntlrParserAdapter<LLVMIRParser> {
@Override
protected Lexer createLexer(CharStream input) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import de.jplag.TokenType;

/**
* LLVM IR token types extracted by this language module.
*/
public enum LLVMIRTokenType implements TokenType {

FILENAME("FILENAME"),
Expand Down Expand Up @@ -85,11 +88,12 @@ public enum LLVMIRTokenType implements TokenType {

private final String description;

public String getDescription() {
return description;
}

LLVMIRTokenType(String description) {
this.description = description;
}

@Override
public String getDescription() {
return description;
}
}

0 comments on commit e8fbd1c

Please sign in to comment.