Esempio n. 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;
        }
Esempio n. 2
0
 protected abstract void OnSwitch(LexemSwitch lexem, LexemList condition, LexemList then, LexemList other);
Esempio n. 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];
        }