示例#1
0
        public LexemVariable Calculate(ILexemEnvironment environment = null)
        {
            if (_poliz == null)
                _poliz = LexemPoliz.Create(_lexems);

            var result = _poliz.Calculate(environment);

            if (_variable != null && !String.IsNullOrEmpty(_variable.Name) && environment != null && result != null)
                environment.Set(_variable.Name, result.Value);

            return result;
        }
示例#2
0
 public static LexemPoliz Create(LexemList lexems)
 {
     var result = new LexemPoliz();
     result.Analys(lexems);
     return result;
 }