Beispiel #1
0
        public static new LexemSwitch Parse(ref string text)
        {
            if (String.IsNullOrEmpty(text))
                return null;

            text = text.Trim();
            if (!text.StartsWith("?") && !text.StartsWith(":"))
                return null;

            var result = new LexemSwitch(text[0].ToString());

            text = text.Crop(1);

            return result;
        }
Beispiel #2
0
 protected abstract void OnSwitch(LexemSwitch lexem, LexemList condition, LexemList then, LexemList other);
Beispiel #3
0
        protected override void OnSwitch(LexemSwitch lexem, LexemList condition, LexemList then, LexemList other)
        {
            this.AnalysLogical(condition);

            _lexems.Add(lexem);

            this.AnalysExpression(then);

            _lexems.Add(lexem.Simetric);

            this.AnalysExpression(other);

            lexem.End = _lexems[_lexems.Count - 1];
        }