public virtual void Visit(SymbolDataStore langSymbol) { if (SimpleLoggingEnabled) { Log.Append(langSymbol.SymbolAccessName); return; } Log.Append("{"); Log.Append(" <Symbol: " + langSymbol.SymbolAccessName + "> "); if (EnableLogObjectClass) { Log.Append(" <Class: " + langSymbol.GetType().Name + "> "); } if (EnableLogSymbolRole) { Log.Append(" <Role: " + langSymbol.SymbolRoleName + "> "); } if (EnableLogSymbolType) { Log.Append(" <Type: " + langSymbol.SymbolType.TypeSignature + "> "); } Log.Append("} "); }
public virtual TSymbolData GetSymbolData(SymbolDataStore symbol) { var symbolData = default(TSymbolData); if (ActiveAr.StaticChain.Any(record => record.TryGetSymbolData(symbol, out symbolData))) { return(symbolData); } throw new KeyNotFoundException("Data store variable " + symbol.ObjectName + " not found in static chain"); }
public virtual void SetSymbolData(SymbolDataStore symbol, TSymbolData symbolData) { foreach (var record in ActiveAr.StaticChain.Where(record => record.ContainsSymbol(symbol))) { record.SetSymbolData(symbol, symbolData); return; } throw new KeyNotFoundException("Data store variable " + symbol.ObjectName + " not found in static chain"); }
public bool TryGetSymbolData(SymbolDataStore symbol, out TSymbolData value) { ActivationRecordEntry <TSymbolData> entry; if (_variableValueDictionary.TryGetValue(symbol.ObjectName, out entry)) { value = entry.SymbolData; return(true); } value = default(TSymbolData); return(false); }
private LanguageValueAccess translate_StartAt_DataSymbol(SymbolDataStore startSymbol) { //Macro output parameters can only be written to (i.e. in LHS of assignment) but never read from (i.e. in RHS expression of assignment). if (_isLValue == false && startSymbol is SymbolProcedureParameter && ((SymbolProcedureParameter)startSymbol).DirectionOut) { return(CompilationLog.RaiseGeneratorError <LanguageValueAccess>("Cannot use output parameter" + startSymbol.ObjectName + " in RHS of an expression", RootParseNode)); } if (_qualList.ActiveLength == 0) { return(LanguageValueAccess.Create(startSymbol)); } if (!startSymbol.SymbolType.IsStructure()) { return(CompilationLog.RaiseGeneratorError <LanguageValueAccess>("Data components not recognized", RootParseNode)); } var valAccess = LanguageValueAccess.Create(startSymbol); var structure = (GMacStructure)startSymbol.SymbolType; return(translate_FollowComponentsSequence(structure, valAccess)); }
public virtual LanguageCommand AddCommand_Declare(SymbolDataStore dataStore) { return(AddCommand(new CommandDeclareVariable(ChildCommandBlockScope, dataStore))); }
public TSymbolData GetSymbolData(SymbolDataStore symbol) { return(_variableValueDictionary[symbol.ObjectName].SymbolData); }
public void SetSymbolData(SymbolDataStore symbol, TSymbolData symbolData) { _variableValueDictionary[symbol.ObjectName] = new ActivationRecordEntry <TSymbolData>(symbol, symbolData); }
public void AddSymbolData(SymbolDataStore symbol, TSymbolData symbolData) { _variableValueDictionary.Add(symbol.ObjectName, new ActivationRecordEntry <TSymbolData>(symbol, symbolData)); }
//public void RemoveUpperStaticAR() //{ // UpperStaticAR = null; //} public bool ContainsSymbol(SymbolDataStore symbol) { return(_variableValueDictionary.ContainsKey(symbol.ObjectName)); }
/// <summary> /// Convert a value access with a root SymbolDataStore into a list of value access objects having /// types other than structures (i.e. primitives and multivectors only) /// </summary> /// <param name="symbol"></param> /// <returns></returns> public static IEnumerable <LanguageValueAccess> ExpandStructures(this SymbolDataStore symbol) { return(ExpandStructures(LanguageValueAccess.Create(symbol))); }
public ActivationRecordEntry(SymbolDataStore symbol, T symbolData) { Symbol = symbol; SymbolData = symbolData; }
public CommandDeclareVariable(LanguageScope parentScope, SymbolDataStore dataStore) : base(parentScope) { DataStore = dataStore; }