public TypeChecker(SymbolTableManager symbolTableManager) { _exprTypeVisitor = new ExprTypeVisitor(symbolTableManager); _symTableManager = symbolTableManager; _programAST = symbolTableManager.ProgramAST; }
public CodeGenVisitor(SymbolTableManager symTableManager) { _symTableManager = symTableManager; _module = LLVM.ModuleCreateWithName("Ryu"); _builder = LLVM.CreateBuilder(); _programAST = symTableManager.ProgramAST; _true = new LLVMBool(1); _false = new LLVMBool(0); }
public TypeInferer(SymbolTableManager symTableManager) { _symTableManager = symTableManager; _identifiersToBeInferred = symTableManager.IdentifiersToBeInferred; Func <IdentifierInfo, TypeAST> GetVariableTypeFunc = (IdentifierInfo identInfo) => { var identToBeInfered = _identifiersToBeInferred.Find(x => x.identInfo == identInfo); if (identToBeInfered == null) { throw new Exception("Undeclared identifier " + identInfo); } return(_typeVisitor.GetAstNodeType(identToBeInfered.file, identInfo.scopeId, identInfo.position, identToBeInfered.expr, identInfo.isConstant)); }; _typeVisitor = new ExprTypeVisitor(symTableManager, GetVariableTypeFunc); }
public ExprTypeVisitor(SymbolTableManager symTableManager, Func <IdentifierInfo, TypeAST> getVariableTypeFunc = null) { _symTableManager = symTableManager; _getVariableTypeFunc = getVariableTypeFunc; }