예제 #1
0
        public void GetComponents(VariableComponentCollection componentCollection)
        {
            // Add attribute components.
            AttributesGetter.GetAttributes(ParseInfo.Script.Diagnostics, _defineContext.Attributes, componentCollection);

            // Add workshop ID
            if (_defineContext.ID)
            {
                componentCollection.AddComponent(new WorkshopIndexComponent(int.Parse(_defineContext.ID.Text), _defineContext.ID.Range));
            }

            // Extended collection
            if (_defineContext.Extended)
            {
                componentCollection.AddComponent(new ExtendedCollectionComponent(_defineContext.Range));
            }

            // Initial value
            if (_defineContext.InitialValue != null)
            {
                componentCollection.AddComponent(new InitialValueComponent(_defineContext.InitialValue));
            }

            // Macro
            if (_defineContext.MacroSymbol)
            {
                componentCollection.AddComponent(new MacroComponent(_defineContext.MacroSymbol.Range));
            }
        }
예제 #2
0
 public void GetComponents(VariableComponentCollection componentCollection)
 {
     componentCollection.AddComponent(new InitialValueComponent(_context.Value));
 }