//public SymbolWithScope AssociatedSymbolWithScope { get { return (AssociatedScope is ScopeSymbolChild) ? ((ScopeSymbolChild)AssociatedScope).ParentLanguageSymbolWithScope : null; } } /// <summary> /// Create a root activation record /// </summary> /// <param name="interpreter">The controlling evaluator for this activation record</param> /// <param name="associatedScope">The associated scope</param> public ActivationRecord(ILanguageInterpreter <TSymbolData> interpreter, LanguageScope associatedScope) { Arid = CreateNewId(); ParentInterpreter = interpreter; UpperStaticAr = null; UpperDynamicAr = null; AssociatedScope = associatedScope; }
/// <summary> /// Create a sub-activation record /// </summary> /// <param name="callingAr">The dynamic link (the following activation record on the stack)</param> /// <param name="associatedScope">The associated scope</param> /// <param name="useUpperStaticAr">If true, use the dynamic link as the static link (make the upper static scope the same as the following activation record on the stack)</param> public ActivationRecord(ActivationRecord <TSymbolData> callingAr, LanguageScope associatedScope, bool useUpperStaticAr) { Arid = CreateNewId(); ParentInterpreter = callingAr.ParentInterpreter; UpperStaticAr = useUpperStaticAr ? callingAr : null; UpperDynamicAr = callingAr; AssociatedScope = associatedScope; }
protected LanguageInterpreter(LanguageScope rootScope, LanguageValueAccessPrecessor valueAccessProc) { ParentDsl = rootScope.RootAst; ValueAccessProcessor = valueAccessProc; ActiveAr = new ActivationRecord <TSymbolData>(this, rootScope); }
/// <summary> /// Depending on the given scope and the active activation record this function creates a suitable activation /// record on top of the activation record stack /// </summary> /// <param name="scope"></param> /// <param name="useUpperStaticAr"></param> /// <returns></returns> protected ActivationRecord <TSymbolData> PushRecord(LanguageScope scope, bool useUpperStaticAr) { ActiveAr = new ActivationRecord <TSymbolData>(ActiveAr, scope, useUpperStaticAr); return(ActiveAr); }