當前位置: 首頁>>代碼示例>>C#>>正文


C# Production.AddValue方法代碼示例

本文整理匯總了C#中PerCederberg.Grammatica.Runtime.Production.AddValue方法的典型用法代碼示例。如果您正苦於以下問題:C# Production.AddValue方法的具體用法?C# Production.AddValue怎麽用?C# Production.AddValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PerCederberg.Grammatica.Runtime.Production的用法示例。


在下文中一共展示了Production.AddValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ExitPlayerNameAttribute

 public override Node ExitPlayerNameAttribute(Production node)
 {
     var values = GetChildValues(node);
     if(values.Count != 0)
         node.AddValue(new PlayerName() { Value = (string)values[0] });
     return node;
 }
開發者ID:avandecreme,項目名稱:OngameNotesMerger,代碼行數:7,代碼來源:IrfFileReader.cs

示例2: ExitExamples

        public override Node ExitExamples(Production node)
        {
            var table = GetChildValues(node).Cast<Table>().Single();

            node.AddValue(table);
            return node;
        }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:7,代碼來源:FeatureBuilder.cs

示例3: ExitClassificationAttribute

 public override Node ExitClassificationAttribute(Production node)
 {
     var values = GetChildValues(node);
     if (values.Count != 0)
     {
         Classification value = (Classification)int.Parse((string)values[0]);
         node.AddValue(value);
     }
     return node;
 }
開發者ID:avandecreme,項目名稱:OngameNotesMerger,代碼行數:10,代碼來源:IrfFileReader.cs

示例4: ExitBackground

        public override Node ExitBackground(Production node)
        {
            var values = GetChildValues(node);

            // First value is either title from header or first FeatureStep
            var title = values[0] as string;
            var featureIndex = title == null ? 0 : 1;

            // Rest of values are FeatureSteps
            var steps = values.GetRange(featureIndex, values.Count - featureIndex).Cast<Step>().ToList();

            var background = new Background(steps)
            {
                Title = title,
                LineNumber = node.StartLine
            };

            node.AddValue(background);
            return node;
        }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:20,代碼來源:FeatureBuilder.cs

示例5: ExitPlayerNoteNode

        public override Node ExitPlayerNoteNode(Production node)
        {
            var values = GetChildValues(node);

            if (values.Count != 0)
            {
                IrfNote note = new IrfNote();
                note.PlayerName = (PlayerName)values[0];

                for (int i = 1; i < values.Count; i++)
                {
                    object value = values[i];
                    if (value is NoteText)
                        note.NoteText = (NoteText)value;
                    else if (value is DateTime)
                        note.DateTime = (DateTime)value;
                    else if (value is Classification)
                        note.Classification = (Classification)value;
                }
                node.AddValue(note);
            }

            return node;
        }
開發者ID:avandecreme,項目名稱:OngameNotesMerger,代碼行數:24,代碼來源:IrfFileReader.cs

示例6: ExitUserNode

        public override Node ExitUserNode(Production node)
        {
            var values = GetChildValues(node);

            if (values.Count != 0)
            {
                IrfUserData userData = new IrfUserData();
                userData.UserName = (string)values[0];

                for (int i = 1; i < values.Count; i++)
                    userData.Add((IrfNote)values[i]);

                node.AddValue(userData);
            }

            return node;
        }
開發者ID:avandecreme,項目名稱:OngameNotesMerger,代碼行數:17,代碼來源:IrfFileReader.cs

示例7: ExitTags

 public override Node ExitTags(Production node)
 {
     var tags = GetChildValues(node).Cast<string>().ToArray();
     node.AddValue(tags);
     return node;
 }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:6,代碼來源:FeatureBuilder.cs

示例8: ExitFeature

        public override Node ExitFeature(Production node)
        {
            var values = GetChildValues(node);

            var tags = (IEnumerable<string>) null;
            int summaryLinesIndex = 0;
            if (values[0] is IEnumerable<string>)
            {
                tags = values[0] as IEnumerable<string>;
                summaryLinesIndex++;
            }

            var summaryLines = values[summaryLinesIndex] as IList<LineValue>;
            var background = values[summaryLinesIndex + 1] as Background;
            var featureIndex = summaryLinesIndex + (background == null ? 1 : 2);

            // Rest of values are FeatureItems
            var items = values.GetRange(featureIndex, values.Count - featureIndex).Cast<FeatureItem>().ToList();

            var feature = new Feature(summaryLines, background, items, tags)
            {
                // TODO: Should this get a value?
                Description = ""
            };

            node.AddValue(feature);
            return node;
        }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:28,代碼來源:FeatureBuilder.cs

示例9: ExitTimestampAttribute

 public override Node ExitTimestampAttribute(Production node)
 {
     var values = GetChildValues(node);
     if (values.Count != 0)
     {
         long seconds = long.Parse((string)values[0]);
         node.AddValue(TimestampHelper.GetDateTime(seconds));
     }
     return node;
 }
開發者ID:avandecreme,項目名稱:OngameNotesMerger,代碼行數:10,代碼來源:IrfFileReader.cs

示例10: ExitBackgroundHeader

 public override Node ExitBackgroundHeader(Production node)
 {
     node.AddValue(GetTitle(node));
     return node;
 }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:5,代碼來源:FeatureBuilder.cs

示例11: ExitScenarioOutline

        public override Node ExitScenarioOutline(Production node)
        {
            var values = GetChildValues(node);

            // First value is title from header
            var title = values[0] as string;

            // Last value is example table
            var examples = values[values.Count - 1] as Table;

            // Rest of values are FeatureSteps
            var steps = values.GetRange(1, values.Count - 2).Cast<Step>().ToList();

            var scenarioOutline = new ScenarioOutline(steps, examples)
            {
                Title = title,
                LineNumber = node.StartLine
            };

            node.AddValue(scenarioOutline);
            return node;
        }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:22,代碼來源:FeatureBuilder.cs

示例12: ExitFeatureItem

        public override Node ExitFeatureItem(Production node)
        {
            // Add tags to already constructed feature item
            var values = GetChildValues(node);
            var hasTags = values[0] is IEnumerable<string>;

            var tags = hasTags ? GetChildValues(node).Cast<object>().Take(1).Cast<IEnumerable<string>>().Single() : null;
            var featureItem = hasTags ?
                GetChildValues(node).Cast<object>().Skip(1).Cast<FeatureItem>().Single() :
                GetChildValues(node).Cast<FeatureItem>().Single();

            featureItem.Tags = tags;
            node.AddValue(featureItem);

            return node;
        }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:16,代碼來源:FeatureBuilder.cs

示例13: ExitScenarioOutlineHeader

 public override Node ExitScenarioOutlineHeader(Production node)
 {
     node.AddValue(GetTitle(node));
     return node;
 }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:5,代碼來源:FeatureBuilder.cs

示例14: ExitStep

        public override Node ExitStep(Production node)
        {
            var values = GetChildValues(node);
            if (values.Count > 0)
            {
                var kindWord = (string) values[0];
                CurrentStepKind = LookupStepKind(kindWord);
                var stepBody = (string) values[1];
                var table = (Table) null;
                if (values.Count > 2)
                    table = (Table)values[3];

                var step = new Step(table)
                {
                    KindWord = kindWord,
                    Kind = CurrentStepKind,
                    Body = stepBody,
                    LineNumber = node.StartLine
                };
                node.AddValue(step);
            }
            return node;
        }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:23,代碼來源:FeatureBuilder.cs

示例15: ExitTableRow

        public override Node ExitTableRow(Production node)
        {
            // Ignore whitespace and grab columms
            var columns = GetChildValues(node).Cast<object>().Where(o => o is Cell).Cast<Cell>().ToList();

            var row = new Row(columns);
            node.AddValue(row);
            return node;
        }
開發者ID:chriskooken,項目名稱:nStep,代碼行數:9,代碼來源:FeatureBuilder.cs


注:本文中的PerCederberg.Grammatica.Runtime.Production.AddValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。