Update DeclarationAnalyzer.java

master
sunyinqi0508 3 years ago committed by GitHub
parent c86e536fe3
commit 21e91b62ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,11 +4,9 @@ import chocopy.common.analysis.AbstractNodeAnalyzer;
import chocopy.common.analysis.SymbolTable;
import chocopy.common.analysis.types.*;
import chocopy.common.astnodes.*;
import java_cup.runtime.Symbol;
import java.util.*;
import com.fasterxml.jackson.annotation.JacksonInject.Value;
/** Analyzes declarations to create a top-level symbol table. */
public class DeclarationAnalyzer extends AbstractNodeAnalyzer<Type>
{
@ -65,6 +63,7 @@ public class DeclarationAnalyzer extends AbstractNodeAnalyzer<Type>
initScope(newScope);
return newScope;
}
//Initializer for the first pass.
public DeclarationAnalyzer(Errors errors0)
{
firstPass = true;
@ -73,7 +72,7 @@ public class DeclarationAnalyzer extends AbstractNodeAnalyzer<Type>
initScope(sym);
typeChecker = new TypeChecker(globals, errors);
}
//Initializer for the second pass.
public DeclarationAnalyzer(Errors errors0, TypeChecker typeChecker, SymbolTable<Type> globals)
{
firstPass = false;

Loading…
Cancel
Save