public override void CaseAFuncDecl(AFuncDecl node) { Scope sub = Env.CurrentScope.AddSubScope(node); Env.CurrentScope = sub; base.CaseAFuncDecl(node); }
public ScopeInfo(AFuncDecl decl, Scope scope) { mFunction = decl; mBlock = null; mType = ScopeType.Function; mScope = scope; }
public override void CaseAFuncDecl(AFuncDecl node) { // find the scope of the func decl, and make it the // current scope. mEnv.CurrentScope = mEnv.CurrentScope.GetScope(node); base.CaseAFuncDecl(node); }
public override void CaseAFuncDecl(AFuncDecl node) { // find the scope of the func decl, and make it the // current scope. mEnv.CurrentScope = mEnv.CurrentScope.GetScope(node); mOutputFile.Add(new Label(node.GetName().Text)); base.CaseAFuncDecl(node); }
public Scope AddSubScope(AFuncDecl decl) { Scope child = new Scope(); child.Parent = this; mSubScopes.Add(child); ScopeInfo inf = new ScopeInfo(decl, child); mSubScopeInfo.Add(inf); return(child); }
public Scope GetScope(AFuncDecl decl) { foreach (ScopeInfo info in mSubScopeInfo) { if (info.Type == ScopeType.Function) { if (info.Function == decl) { return(info.Scope); } } } return(null); }
public FunctionShell(AFuncDecl decl) { ReturnType = TypeEnvironment.GetTypename(decl.GetType()); Name = decl.GetName().ToString(); }
public override void OutAFuncDecl(AFuncDecl node) { Env.CurrentScope = Env.CurrentScope.Parent; base.OutAFuncDecl(node); }
public override void CaseAFuncDecl(AFuncDecl node) { base.CaseAFuncDecl(node); }