Skip to content

Commit b13dd3a

Browse files
committed
Annotate.
1 parent 9bf1f45 commit b13dd3a

22 files changed

Lines changed: 53 additions & 54 deletions

File tree

.idea/workspace.xml

Lines changed: 23 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/ko/carbonel/compiler/ParserAssistant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @param <TType> The type of the lexer token types.
2020
*/
2121
public class ParserAssistant<T extends LexerToken<TType>, TType extends Enum<TType>> {
22-
protected PeekableStream<T> lexer;
22+
protected final PeekableStream<T> lexer;
2323
protected T lastMatchedToken = null;
2424
protected int depth = 0;
2525
private final TType eofToken;

src/main/java/ko/carbonel/compiler/config/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
public class Config {
3636
public static final String JARFILE_NAME = "etapa3.jar";
37-
public static Map<ArgumentName, Argument<?>> arguments;
37+
public static final Map<ArgumentName, Argument<?>> arguments;
3838

3939
static {
4040
arguments = new HashMap<>();

src/main/java/ko/carbonel/compiler/exception/semantic/ClassNotFoundError.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
import ko.carbonel.compiler.stream.lexer.tinyRust.model.TinyRustLexerToken;
44

55
public class ClassNotFoundError extends SemanticError {
6-
String className;
76
public ClassNotFoundError(TinyRustLexerToken required, String message) {
87
super(required.location(), "Class " + required.lexeme() + " not found. " + message);
9-
this.className = required.lexeme();
8+
// String className = required.lexeme();
109
}
1110

1211
public ClassNotFoundError(TinyRustLexerToken type) {

src/main/java/ko/carbonel/compiler/intermediate/bnf/AttributeCodeEntry.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33
import ko.carbonel.syntax.grammar.algorithm.model.UnannotatedToken;
44

55
public class AttributeCodeEntry extends RHSPartEntry {
6-
public String code;
6+
public final String code;
77

88
public AttributeCodeEntry(String code) {
99
this.code = code;
1010
}
1111

12-
public AttributeCodeEntry() {
13-
this(null);
14-
}
15-
1612
@Override
1713
public UnannotatedToken toUnannotatedToken() {
1814
return null;

src/main/java/ko/carbonel/compiler/intermediate/bnf/BNFSymbolTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import java.util.Objects;
1010

1111
public final class BNFSymbolTable implements GrammarInterface, SymbolTable {
12-
public List<RuleEntry> rules;
12+
public final List<RuleEntry> rules;
1313
public RuleEntry currentRule = new RuleEntry();
1414
public List<RHSPartEntry> currentRHS = new ArrayList<>();
1515

src/main/java/ko/carbonel/compiler/intermediate/bnf/RuleEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
public class RuleEntry implements RuleInterface {
1313
public NonTerminalEntry lhs;
14-
public Set<List<RHSPartEntry>> rhs;
14+
public final Set<List<RHSPartEntry>> rhs;
1515

1616
public RuleEntry(NonTerminalEntry lhs, Set<List<RHSPartEntry>> rhs) {
1717
this.lhs = lhs;

src/main/java/ko/carbonel/compiler/intermediate/bnf/TokenEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.util.Objects;
44

55
public abstract class TokenEntry extends RHSPartEntry {
6-
public String name;
6+
public final String name;
77

88
public TokenEntry(String name) {
99
this.name = name;

src/main/java/ko/carbonel/compiler/intermediate/tinyRust/AttributeEntry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
public class AttributeEntry {
88
public TinyRustLexerToken name;
9-
public boolean isStatic;
10-
public boolean isPublic;
9+
public final boolean isStatic;
10+
public final boolean isPublic;
1111

1212
public AttributeEntry(TinyRustLexerToken name, boolean isStatic, boolean isPublic) {
1313
this.name = name;

src/main/java/ko/carbonel/compiler/intermediate/tinyRust/ClassEntry.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
public class ClassEntry {
1313
public TinyRustLexerToken name;
1414
public TypeEntry superClass = null;
15-
public MethodEntry constructor;
16-
public List<MethodEntry> methods = new ArrayList<>();
17-
public List<VariableEntry> fields = new ArrayList<>();
18-
public boolean isExtendable;
19-
public boolean isArrayValid;
15+
public final MethodEntry constructor;
16+
public final List<MethodEntry> methods = new ArrayList<>();
17+
public final List<VariableEntry> fields = new ArrayList<>();
18+
public final boolean isExtendable;
19+
public final boolean isArrayValid;
2020
public boolean isConsolidated = false;
2121
private ClassEntry superClassLink;
2222
private final TinyRustSymbolTable root;

0 commit comments

Comments
 (0)