| | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Diagnostics;
|
| | | using System.IO;
|
| | | using System.Linq;
|
| | | using System.Linq.Expressions;
|
| | | using System.Reflection;
|
| | | using System.Text;
|
| | |
|
| | | namespace QtVsTools.SyntaxAnalysis
|
| | | {
|
| | |
| | | /// </summary>
|
| | | public partial class ProductionObjects : IEnumerable<KeyValuePair<string, object>>
|
| | | {
|
| | | List<KeyValuePair<string, object>> Productions { get; set; }
|
| | | Dictionary<string, List<object>> ProductionsByTokenId { get; set; }
|
| | | List<KeyValuePair<string, object>> Productions { get; }
|
| | | Dictionary<string, List<object>> ProductionsByTokenId { get; }
|
| | |
|
| | | public ProductionObjects()
|
| | | {
|
| | |
| | | public void Add(string tokenId, object prodObj)
|
| | | {
|
| | | Productions.Add(new KeyValuePair<string, object>(tokenId, prodObj));
|
| | | List<object> prodObjs;
|
| | | if (!ProductionsByTokenId.TryGetValue(tokenId, out prodObjs))
|
| | | if (!ProductionsByTokenId.TryGetValue(tokenId, out List<object> prodObjs))
|
| | | ProductionsByTokenId.Add(tokenId, prodObjs = new List<object>());
|
| | | prodObjs.Add(prodObj);
|
| | | }
|
| | |
| | | if (string.IsNullOrEmpty(tokenId))
|
| | | return Empty<T>();
|
| | |
|
| | | List<object> tokenProds;
|
| | | if (!ProductionsByTokenId.TryGetValue(tokenId, out tokenProds))
|
| | | if (!ProductionsByTokenId.TryGetValue(tokenId, out List<object> tokenProds))
|
| | | return Empty<T>();
|
| | |
|
| | | return tokenProds
|