public void SetInt(Option option, int val) { string str; if (this.m_clientOptionMap.TryGetValue(option, out str)) { bool existed = LocalOptions.Get().Has(str); int @int = LocalOptions.Get().GetInt(str); if (!existed || (@int != val)) { LocalOptions.Get().Set(str, val); this.FireChangedEvent(option, @int, existed); } } else { ServerOption option2; if (this.m_serverOptionMap.TryGetValue(option, out option2)) { int num2; bool intOption = NetCache.Get().GetIntOption(option2, out num2); if (!intOption || (num2 != val)) { NetCache.Get().SetIntOption(option2, val); this.FireChangedEvent(option, num2, intOption); } } } }
public void SetULong(Option option, ulong val) { string str; if (this.m_clientOptionMap.TryGetValue(option, out str)) { bool existed = LocalOptions.Get().Has(str); ulong uLong = LocalOptions.Get().GetULong(str); if (!existed || (uLong != val)) { LocalOptions.Get().Set(str, val); this.FireChangedEvent(option, uLong, existed); } } else { ServerOption option2; if (this.m_serverOptionMap.TryGetValue(option, out option2)) { ulong num2; bool uLongOption = NetCache.Get().GetULongOption(option2, out num2); if (!uLongOption || (num2 != val)) { NetCache.Get().SetULongOption(option2, val); this.FireChangedEvent(option, num2, uLongOption); } } } }
private object GetClientOption(Option option, string optionName) { System.Type optionType = this.GetOptionType(option); if (optionType == typeof(bool)) { return(LocalOptions.Get().GetBool(optionName)); } if (optionType == typeof(int)) { return(LocalOptions.Get().GetInt(optionName)); } if (optionType == typeof(long)) { return(LocalOptions.Get().GetLong(optionName)); } if (optionType == typeof(ulong)) { return(LocalOptions.Get().GetULong(optionName)); } if (optionType == typeof(float)) { return(LocalOptions.Get().GetFloat(optionName)); } if (optionType == typeof(string)) { return(LocalOptions.Get().GetString(optionName)); } object[] messageArgs = new object[] { option, optionType }; Error.AddDevFatal("Options.GetClientOption() - option {0} has unsupported underlying type {1}", messageArgs); return(null); }
public static LocalOptions Get() { if (s_instance == null) { s_instance = new LocalOptions(); } return(s_instance); }
private void DeleteClientOption(Option option, string optionName) { if (LocalOptions.Get().Has(optionName)) { object clientOption = this.GetClientOption(option, optionName); LocalOptions.Get().Delete(optionName); this.RemoveListeners(option, clientOption); } }
public HashSet <string> GetStopTokens(LocalOptions options, int state) { var stopTokens = options.AnyOptions.ContainsKey(AnyOption.Except) ? options.AnyOptions[AnyOption.Except] : new HashSet <string>( Table.GetExpectedTokens(state).Except(options.AnyOptions.ContainsKey(AnyOption.Include) ? options.AnyOptions[AnyOption.Include] : new HashSet <string>()) ); stopTokens.Remove(Grammar.ANY_TOKEN_NAME); return(stopTokens); }
public void SetString(Option option, string val) { string str; if (this.m_clientOptionMap.TryGetValue(option, out str)) { bool existed = LocalOptions.Get().Has(str); string prevVal = LocalOptions.Get().GetString(str); if (!existed || (prevVal != val)) { LocalOptions.Get().Set(str, val); this.FireChangedEvent(option, prevVal, existed); } } }
public bool HasOption(Option option) { string str; ServerOption option2; ServerOptionFlag flag; if (this.m_clientOptionMap.TryGetValue(option, out str)) { return(LocalOptions.Get().Has(str)); } if (this.m_serverOptionMap.TryGetValue(option, out option2)) { return(NetCache.Get().ClientOptionExists(option2)); } return(this.m_serverOptionFlagMap.TryGetValue(option, out flag) && this.HasServerOptionFlag(flag)); }
private void CmbPublisher_SelectedIndexChanged(object sender, EventArgs e) { var selected = CmbPublisher.SelectedItem as ObjectCollectionItem <Publisher>; if (selected?.Value == null) { return; } OptionSetPrefix = selected.Value.CustomizationOptionValuePrefix.GetValueOrDefault(10000); var nextValue = OptionSetPrefix * 10000 + 1; while (LocalOptions.Any(o => o.Value.GetValueOrDefault() == nextValue)) { nextValue++; } TxtOptionSetValue.Text = nextValue.ToString(); }
private bool GetOptionImpl(Option option, out object val) { string str; val = null; if (this.m_clientOptionMap.TryGetValue(option, out str)) { if (LocalOptions.Get().Has(str)) { val = this.GetClientOption(option, str); } } else { ServerOption option2; if (this.m_serverOptionMap.TryGetValue(option, out option2)) { if (NetCache.Get().ClientOptionExists(option2)) { val = this.GetServerOption(option, option2); } } else { ServerOptionFlag flag; if (this.m_serverOptionFlagMap.TryGetValue(option, out flag)) { ulong num; ulong num2; this.GetServerOptionFlagInfo(flag, out option2, out num, out num2); ulong uLongOption = NetCache.Get().GetULongOption(option2); if ((uLongOption & num2) != 0L) { val = (uLongOption & num) != 0L; } } } } return(val != null); }
public Parser(Grammar g, ILexer lexer, BaseNodeGenerator nodeGen = null) : base(g, lexer, nodeGen) { Table = new TableLL1(g); /// В ходе парсинга потребуется First, /// учитывающее возможную пустоту ANY GrammarObject.UseModifiedFirst = true; RecoveryCache = new Dictionary <string, Tuple <LocalOptions, Stack <string> > >(); /// Для каждого из возможных символов для восстановления кешируем дополнительную информацию foreach (var smb in GrammarObject.Options.GetSymbols(ParsingOption.RECOVERY)) { var stack = new Stack <string>(); stack.Push(smb); LocalOptions anyOptions = null; /// Накапливаем символы, которые придётся положить на стек при восстановлении на smb while (true) { var alternative = Table[stack.Peek(), Grammar.ANY_TOKEN_NAME][0]; stack.Pop(); for (var i = alternative.Count - 1; i >= 0; --i) { stack.Push(alternative[i]); } if (alternative[0].Symbol == Grammar.ANY_TOKEN_NAME) { anyOptions = alternative[0].Options; stack.Pop(); break; } } /// В кеш помещаем цепочку символов и опции Any RecoveryCache[smb] = new Tuple <LocalOptions, Stack <string> >(anyOptions, stack); } }
private HashSet <string> GetStopTokens(LocalOptions options, IEnumerable <string> followSequence) { /// Если с Any не связана последовательность стоп-символов if (!options.AnyOptions.ContainsKey(AnyOption.Except)) { /// Определяем множество токенов, которые могут идти после Any var tokensAfterText = GrammarObject.First(followSequence.ToList()); /// Само Any во входном потоке нам и так не встретится, а вывод сообщения об ошибке будет красивее tokensAfterText.Remove(Grammar.ANY_TOKEN_NAME); /// Если указаны токены, которые нужно однозначно включать в Any if (options.AnyOptions.ContainsKey(AnyOption.Include)) { tokensAfterText.ExceptWith(options.AnyOptions[AnyOption.Include]); } return(tokensAfterText); } else { return(options.AnyOptions[AnyOption.Except]); } }
public FluentNHibernateQueue(string name, SessionFactoryInfo info, LocalOptions <T> opts = null) { Info = info; LocalOptions = opts ?? new LocalOptions <T>(); using (var session = GetStatelessSession()) { var sqlConnection = session.Connection as SqlConnection; if (sqlConnection != null) { var rx = new Regex("^\\d\\."); if (rx.IsMatch(sqlConnection.ServerVersion)) { var dt = Convert.ToDateTime(session.CreateSQLQuery("select getutcdate()").UniqueResult()); _dateOffset = dt.Subtract(DateTime.UtcNow); } else { var dt = Convert.ToDateTime(session.CreateSQLQuery("select sysutcdatetime()").UniqueResult()); _dateOffset = dt.Subtract(DateTime.UtcNow); } } using (var tx = session.BeginTransaction()) { _myQueue = session.Query <Queue>().FirstOrDefault(i => i.Name == name); if (_myQueue == null) { _myQueue = new Queue { Name = name, CreateDateTime = DateNow() }; session.Insert(_myQueue); } tx.Commit(); } } }
private void InitializeGame() { GameDbf.Load(); DemoMgr.Get().Initialize(); LocalOptions.Get().Initialize(); if (DemoMgr.Get().GetMode() == DemoMode.APPLE_STORE) { DemoMgr.Get().ApplyAppleStoreDemoDefaults(); } if (Network.TUTORIALS_WITHOUT_ACCOUNT != null) { Network.SetShouldBeConnectedToAurora(Options.Get().GetBool(Option.CONNECT_TO_AURORA)); } Network.Initialize(); Localization.Initialize(); GameStrings.LoadCategory(GameStringCategory.GLOBAL); if (!PlayErrors.Init()) { UnityEngine.Debug.LogError(string.Format("{0} failed to load!", "PlayErrors32")); } GameMgr.Get().Initialize(); ChangedCardMgr.Get().Initialize(); TavernBrawlManager.Init(); }
public void SetBool(Option option, bool val) { string str; if (this.m_clientOptionMap.TryGetValue(option, out str)) { bool existed = LocalOptions.Get().Has(str); bool @bool = LocalOptions.Get().GetBool(str); if (!existed || (@bool != val)) { LocalOptions.Get().Set(str, val); this.FireChangedEvent(option, @bool, existed); } } else { ServerOptionFlag flag3; if (this.m_serverOptionFlagMap.TryGetValue(option, out flag3)) { ServerOption option2; ulong num; ulong num2; this.GetServerOptionFlagInfo(flag3, out option2, out num, out num2); ulong uLongOption = NetCache.Get().GetULongOption(option2); bool prevVal = (uLongOption & num) != 0L; bool flag5 = (uLongOption & num2) != 0L; if (!flag5 || (prevVal != val)) { ulong num4 = !val ? (uLongOption & ~num) : (uLongOption | num); num4 |= num2; NetCache.Get().SetULongOption(option2, num4); this.FireChangedEvent(option, prevVal, flag5); } } } }
public virtual Node Generate(string symbol, LocalOptions opts = null) { return((Node)Cache[Cache.ContainsKey(symbol) ? symbol : BASE_NODE_TYPE] .Invoke(new object[] { symbol, opts })); }
private static void BuildLocal(LocalOptions local) { Console.Out.WriteLine($"Building NuGet packages from {local.SourceDir}"); BuildPackages(local.SourceDir); }
public Node(string symbol, LocalOptions opts = null) { Symbol = symbol; Options = opts ?? new LocalOptions(); }
public FluentNHibernateQueue(string name, ProviderTypeEnum providerType, string nameOrConnectionString, LocalOptions <T> opts = null, FluentNHibernatePersistenceBuilderOptions builderOptions = null) : this(name, SessionFactoryBuilder.GetFromAssemblyOf <QueueItemMap>(providerType, nameOrConnectionString, builderOptions)) { }
public FluentNHibernateQueue(string name, IPersistenceConfigurer configurer, bool buildSchema = false, LocalOptions <T> opts = null) : this(name, SessionFactoryBuilder .GetFromAssemblyOf <QueueItemMap>(configurer, new FluentNHibernatePersistenceBuilderOptions { UpdateSchema = buildSchema }), opts) { }
public LocalConfiguration(IOptions <LocalOptions> options) { _options = options.Value; }
protected override void DoAction(int action) { #pragma warning disable 162, 1522 switch (action) { case 2: // lp_description -> structure, PROC, options_section { ConstructedGrammar.PostProcessing(); Log.AddRange(ConstructedGrammar.CheckValidity()); } break; case 8: // terminal -> ENTITY_NAME, COLON, opt_linestart, REGEX { SafeGrammarAction(() => { ConstructedGrammar.DeclareTerminal(ValueStack[ValueStack.Depth - 4].strVal, ValueStack[ValueStack.Depth - 1].strVal, ValueStack[ValueStack.Depth - 2].boolVal); ConstructedGrammar.AddLocation(ValueStack[ValueStack.Depth - 4].strVal, LocationStack[LocationStack.Depth - 4].Start); }, LocationStack[LocationStack.Depth - 4].Start); } break; case 9: // opt_linestart -> LINESTART { CurrentSemanticValue.boolVal = true; } break; case 10: // opt_linestart -> /* empty */ { CurrentSemanticValue.boolVal = false; } break; case 11: // pair -> ENTITY_NAME, COLON, LEFT, pair_border, RIGHT, pair_border { SafeGrammarAction(() => { ConstructedGrammar.DeclarePair(ValueStack[ValueStack.Depth - 6].strVal, ValueStack[ValueStack.Depth - 3].strSet, ValueStack[ValueStack.Depth - 1].strSet); ConstructedGrammar.AddLocation(ValueStack[ValueStack.Depth - 6].strVal, LocationStack[LocationStack.Depth - 6].Start); }, LocationStack[LocationStack.Depth - 6].Start); } break; case 12: // pair_border -> ID { CurrentSemanticValue.strSet = new HashSet <string>() { ValueStack[ValueStack.Depth - 1].strVal }; } break; case 13: // pair_border -> REGEX { var generated = ConstructedGrammar.GenerateTerminal(ValueStack[ValueStack.Depth - 1].strVal); ConstructedGrammar.AddLocation(generated, LocationStack[LocationStack.Depth - 1].Start); CurrentSemanticValue.strSet = new HashSet <string>() { generated }; } break; case 14: // pair_border -> LROUND_BRACKET, pair_border_group_content, RROUND_BRACKET { CurrentSemanticValue.strSet = ValueStack[ValueStack.Depth - 2].strSet; } break; case 15: // pair_border_group_content -> pair_border { CurrentSemanticValue.strSet = ValueStack[ValueStack.Depth - 1].strSet; } break; case 16: // pair_border_group_content -> pair_border_group_content, OR, pair_border { ValueStack[ValueStack.Depth - 3].strSet.UnionWith(ValueStack[ValueStack.Depth - 1].strSet); CurrentSemanticValue.strSet = ValueStack[ValueStack.Depth - 3].strSet; } break; case 17: // nonterminal -> ENTITY_NAME, EQUALS, body { var aliases = this.Aliases; this.Aliases = new HashSet <string>(); SafeGrammarAction(() => { ConstructedGrammar.DeclareNonterminal(ValueStack[ValueStack.Depth - 3].strVal, ValueStack[ValueStack.Depth - 1].altList); ConstructedGrammar.AddLocation(ValueStack[ValueStack.Depth - 3].strVal, LocationStack[LocationStack.Depth - 3].Start); if (aliases.Count > 0) { ConstructedGrammar.AddAliases(ValueStack[ValueStack.Depth - 3].strVal, aliases); } }, LocationStack[LocationStack.Depth - 3].Start); } break; case 18: // body -> body, OR, alternative, optional_alias { CurrentSemanticValue.altList = ValueStack[ValueStack.Depth - 4].altList; ValueStack[ValueStack.Depth - 2].altVal.Alias = ValueStack[ValueStack.Depth - 1].strVal; CurrentSemanticValue.altList.Add(ValueStack[ValueStack.Depth - 2].altVal); } break; case 19: // body -> alternative, optional_alias { CurrentSemanticValue.altList = new List <Alternative>(); ValueStack[ValueStack.Depth - 2].altVal.Alias = ValueStack[ValueStack.Depth - 1].strVal; CurrentSemanticValue.altList.Add(ValueStack[ValueStack.Depth - 2].altVal); } break; case 20: // alternative -> alternative, entry { CurrentSemanticValue.altVal = ValueStack[ValueStack.Depth - 2].altVal; CurrentSemanticValue.altVal.Add(ValueStack[ValueStack.Depth - 1].entryVal); } break; case 21: // alternative -> /* empty */ { CurrentSemanticValue.altVal = new Alternative(); } break; case 22: // optional_alias -> ARROW, ID { CurrentSemanticValue.strVal = ValueStack[ValueStack.Depth - 1].strVal; this.Aliases.Add(ValueStack[ValueStack.Depth - 1].strVal); } break; case 23: // optional_alias -> /* empty */ { CurrentSemanticValue.strVal = null; } break; case 24: // entry -> context_options, entry_core, entry_args, quantifier, prec_nonempty { var opts = new LocalOptions(); foreach (var opt in ValueStack[ValueStack.Depth - 5].optionParamsList) { NodeOption nodeOpt; if (!Enum.TryParse <NodeOption>(opt.Item1.ToUpper(), out nodeOpt)) { MappingOption mapOpt; if (!Enum.TryParse <MappingOption>(opt.Item1.ToUpper(), out mapOpt)) { Log.Add(Message.Error( "Неизвестная опция '" + opt.Item1 + "'", LocationStack[LocationStack.Depth - 5].Start, "LanD" )); } else { opts.Set(mapOpt, opt.Item2.ToArray()); } } else { opts.Set(nodeOpt); } } if (ValueStack[ValueStack.Depth - 2].optQuantVal.HasValue) { if (ValueStack[ValueStack.Depth - 4].strVal.StartsWith(Grammar.ANY_TOKEN_NAME)) { Log.Add(Message.Warning( "Использование квантификаторов с символом '" + Grammar.ANY_TOKEN_NAME + "' избыточно и не влияет на процесс разбора", LocationStack[LocationStack.Depth - 5].Start, "LanD" )); } else { var generated = ConstructedGrammar.GenerateNonterminal(ValueStack[ValueStack.Depth - 4].strVal, ValueStack[ValueStack.Depth - 2].optQuantVal.Value, ValueStack[ValueStack.Depth - 1].boolVal); ConstructedGrammar.AddLocation(generated, CurrentLocationSpan.Start); CurrentSemanticValue.entryVal = new Entry(generated, opts); } } if (CurrentSemanticValue.entryVal == null) { if (ValueStack[ValueStack.Depth - 4].strVal.StartsWith(Grammar.ANY_TOKEN_NAME)) { AnyOption sugarOption; if (Enum.TryParse(ValueStack[ValueStack.Depth - 4].strVal.Substring(Grammar.ANY_TOKEN_NAME.Length), out sugarOption)) { opts.AnyOptions[sugarOption] = new HashSet <string>(ValueStack[ValueStack.Depth - 3].dynamicList.Select(e => (string)e)); } else { foreach (var opt in ValueStack[ValueStack.Depth - 3].dynamicList) { var errorGroupName = String.Empty; if (opt is ArgumentGroup) { var group = (ArgumentGroup)opt; if (Enum.TryParse(group.Name, out sugarOption)) { opts.AnyOptions[sugarOption] = new HashSet <string>(group.Arguments.Select(e => (string)e)); } else { errorGroupName = group.Name; } } else if (opt is String) { if (Enum.TryParse((string)opt, out sugarOption)) { opts.AnyOptions[sugarOption] = new HashSet <string>(); } else { errorGroupName = (string)opt; } } if (!String.IsNullOrEmpty(errorGroupName)) { Log.Add(Message.Error( "При описании '" + Grammar.ANY_TOKEN_NAME + "' использовано неизвестное имя группы '" + errorGroupName + "', группа проигнорирована", LocationStack[LocationStack.Depth - 5].Start, "LanD" )); } } } CurrentSemanticValue.entryVal = new Entry(Grammar.ANY_TOKEN_NAME, opts); } else { CurrentSemanticValue.entryVal = new Entry(ValueStack[ValueStack.Depth - 4].strVal, opts); } } } break; case 25: // entry_args -> ELEM_LROUND_BRACKET, args, RROUND_BRACKET { CurrentSemanticValue.dynamicList = ValueStack[ValueStack.Depth - 2].dynamicList; } break; case 26: // entry_args -> /* empty */ { CurrentSemanticValue.dynamicList = new List <dynamic>(); } break; case 27: // context_options -> context_options, OPTION_NAME, context_opt_args { CurrentSemanticValue.optionParamsList = ValueStack[ValueStack.Depth - 3].optionParamsList; CurrentSemanticValue.optionParamsList.Add(new Tuple <string, List <dynamic> >(ValueStack[ValueStack.Depth - 2].strVal, ValueStack[ValueStack.Depth - 1].dynamicList)); } break; case 28: // context_options -> /* empty */ { CurrentSemanticValue.optionParamsList = new List <Tuple <string, List <dynamic> > >(); } break; case 29: // context_opt_args -> OPT_LROUND_BRACKET, args, RROUND_BRACKET { CurrentSemanticValue.dynamicList = ValueStack[ValueStack.Depth - 2].dynamicList; } break; case 30: // context_opt_args -> /* empty */ { CurrentSemanticValue.dynamicList = new List <dynamic>(); } break; case 31: // prec_nonempty -> PREC_NONEMPTY { CurrentSemanticValue.boolVal = true; } break; case 32: // prec_nonempty -> /* empty */ { CurrentSemanticValue.boolVal = false; } break; case 33: // quantifier -> OPTIONAL { CurrentSemanticValue.optQuantVal = ValueStack[ValueStack.Depth - 1].quantVal; } break; case 34: // quantifier -> ZERO_OR_MORE { CurrentSemanticValue.optQuantVal = ValueStack[ValueStack.Depth - 1].quantVal; } break; case 35: // quantifier -> ONE_OR_MORE { CurrentSemanticValue.optQuantVal = ValueStack[ValueStack.Depth - 1].quantVal; } break; case 36: // quantifier -> /* empty */ { CurrentSemanticValue.optQuantVal = null; } break; case 37: // entry_core -> REGEX { CurrentSemanticValue.strVal = ConstructedGrammar.GenerateTerminal(ValueStack[ValueStack.Depth - 1].strVal); ConstructedGrammar.AddLocation(CurrentSemanticValue.strVal, CurrentLocationSpan.Start); } break; case 38: // entry_core -> ID { CurrentSemanticValue.strVal = ValueStack[ValueStack.Depth - 1].strVal; } break; case 39: // entry_core -> group { CurrentSemanticValue.strVal = ValueStack[ValueStack.Depth - 1].strVal; } break; case 40: // group -> LROUND_BRACKET, body, RROUND_BRACKET { CurrentSemanticValue.strVal = ConstructedGrammar.GenerateNonterminal(ValueStack[ValueStack.Depth - 2].altList); ConstructedGrammar.AddLocation(CurrentSemanticValue.strVal, CurrentLocationSpan.Start); } break; case 43: // category_block -> CATEGORY_NAME, option_or_block { OptionCategory optCategory; if (!Enum.TryParse(ValueStack[ValueStack.Depth - 2].strVal.ToUpper(), out optCategory)) { Log.Add(Message.Error( "Неизвестная категория опций '" + ValueStack[ValueStack.Depth - 2].strVal + "'", LocationStack[LocationStack.Depth - 2].Start, "LanD" )); } foreach (var option in ValueStack[ValueStack.Depth - 1].optionsList) { bool goodOption = true; switch (optCategory) { case OptionCategory.PARSING: ParsingOption parsingOpt; goodOption = Enum.TryParse(option.Name.ToUpper(), out parsingOpt); if (goodOption) { SafeGrammarAction(() => { ConstructedGrammar.SetOption(parsingOpt, option.Symbols.ToArray()); }, LocationStack[LocationStack.Depth - 2].Start); } break; case OptionCategory.NODES: NodeOption nodeOpt; goodOption = Enum.TryParse(option.Name.ToUpper(), out nodeOpt); if (goodOption) { SafeGrammarAction(() => { ConstructedGrammar.SetOption(nodeOpt, option.Symbols.ToArray()); }, LocationStack[LocationStack.Depth - 2].Start); } break; case OptionCategory.MAPPING: MappingOption mappingOpt; goodOption = Enum.TryParse(option.Name.ToUpper(), out mappingOpt); if (goodOption) { SafeGrammarAction(() => { ConstructedGrammar.SetOption(mappingOpt, option.Symbols.ToArray(), option.Arguments.ToArray()); }, LocationStack[LocationStack.Depth - 2].Start); } break; case OptionCategory.CUSTOMBLOCK: CustomBlockOption customBlockOption; goodOption = Enum.TryParse(option.Name.ToUpper(), out customBlockOption); if (goodOption) { SafeGrammarAction(() => { ConstructedGrammar.SetOption(customBlockOption, option.Symbols.ToArray(), option.Arguments.ToArray()); }, LocationStack[LocationStack.Depth - 2].Start); } break; default: break; } if (!goodOption) { Log.Add(Message.Error( "Опция '" + option.Name + "' не определена для категории '" + ValueStack[ValueStack.Depth - 2].strVal + "'", LocationStack[LocationStack.Depth - 1].Start, "LanD" )); } } } break; case 44: // option_or_block -> option { CurrentSemanticValue.optionsList = new List <OptionDeclaration>() { ValueStack[ValueStack.Depth - 1].optDeclVal }; } break; case 45: // option_or_block -> LCURVE_BRACKET, options, RCURVE_BRACKET { CurrentSemanticValue.optionsList = ValueStack[ValueStack.Depth - 2].optionsList; } break; case 46: // options -> /* empty */ { CurrentSemanticValue.optionsList = new List <OptionDeclaration>(); } break; case 47: // options -> options, option { CurrentSemanticValue.optionsList = ValueStack[ValueStack.Depth - 2].optionsList; ValueStack[ValueStack.Depth - 2].optionsList.Add(ValueStack[ValueStack.Depth - 1].optDeclVal); } break; case 48: // option -> OPTION_NAME, opt_args, identifiers { CurrentSemanticValue.optDeclVal = new OptionDeclaration() { Name = ValueStack[ValueStack.Depth - 3].strVal, Arguments = ValueStack[ValueStack.Depth - 2].dynamicList, Symbols = ValueStack[ValueStack.Depth - 1].strList }; } break; case 49: // opt_args -> LROUND_BRACKET, args, RROUND_BRACKET { CurrentSemanticValue.dynamicList = ValueStack[ValueStack.Depth - 2].dynamicList; } break; case 50: // opt_args -> /* empty */ { CurrentSemanticValue.dynamicList = new List <dynamic>(); } break; case 51: // args -> args, COMMA, argument { CurrentSemanticValue.dynamicList = ValueStack[ValueStack.Depth - 3].dynamicList; CurrentSemanticValue.dynamicList.Add(ValueStack[ValueStack.Depth - 1].dynamicVal); } break; case 52: // args -> argument { CurrentSemanticValue.dynamicList = new List <dynamic>() { ValueStack[ValueStack.Depth - 1].dynamicVal }; } break; case 53: // argument -> RNUM { CurrentSemanticValue.dynamicVal = ValueStack[ValueStack.Depth - 1].doubleVal; } break; case 54: // argument -> REGEX { var generated = ConstructedGrammar.GenerateTerminal((string)ValueStack[ValueStack.Depth - 1].strVal); ConstructedGrammar.AddLocation(generated, LocationStack[LocationStack.Depth - 1].Start); CurrentSemanticValue.dynamicVal = generated; } break; case 55: // argument -> STRING { CurrentSemanticValue.dynamicVal = ValueStack[ValueStack.Depth - 1].strVal.Substring(1, ValueStack[ValueStack.Depth - 1].strVal.Length - 2); } break; case 56: // argument -> ID { CurrentSemanticValue.dynamicVal = ValueStack[ValueStack.Depth - 1].strVal; } break; case 57: // argument -> argument_group { CurrentSemanticValue.dynamicVal = ValueStack[ValueStack.Depth - 1].argGroupVal; } break; case 58: // argument_group -> ID, ELEM_LROUND_BRACKET, args, RROUND_BRACKET { CurrentSemanticValue.argGroupVal = new ArgumentGroup() { Name = ValueStack[ValueStack.Depth - 4].strVal, Arguments = ValueStack[ValueStack.Depth - 2].dynamicList }; } break; case 59: // identifiers -> identifiers, ID { CurrentSemanticValue.strList = ValueStack[ValueStack.Depth - 2].strList; CurrentSemanticValue.strList.Add(ValueStack[ValueStack.Depth - 1].strVal); } break; case 60: // identifiers -> /* empty */ { CurrentSemanticValue.strList = new List <string>(); } break; } #pragma warning restore 162, 1522 }