Esempio n. 1
0
        public ExprRecResult Recognize(CodeString Code, PluginRoot Plugin, ref ExpressionNode Ret)
        {
            var InnerCode = BetweenOperatos(Code);

            if (!InnerCode.IsValid)
            {
                return(ExprRecResult.Unknown);
            }

            var String = RecognizerHelper.ProcessString(InnerCode, Plugin, '~');

            if (String == null)
            {
                return(ExprRecResult.Failed);
            }

            if (String.Length != 1)
            {
                Plugin.State.Messages.Add(MessageId.CharInvalidLength, Code);
                return(ExprRecResult.Failed);
            }

            var Global = Plugin.Container.GlobalContainer;

            Ret = new ConstExpressionNode(Global.CommonIds.Char, new CharValue(String[0]), Code);
            return(ExprRecResult.Succeeded);
        }
Esempio n. 2
0
        public ExprRecResult Recognize(CodeString Code, PluginRoot Plugin, ref ExpressionNode Ret)
        {
            var InnerCode = BetweenOperatos(Code);

            if (!InnerCode.IsValid)
            {
                return(ExprRecResult.Unknown);
            }

            var String = RecognizerHelper.ProcessString(InnerCode, Plugin, '~');

            if (String == null)
            {
                return(ExprRecResult.Failed);
            }

            var Global = Plugin.Container.GlobalContainer;

            Ret = new ConstExpressionNode(Global.CommonIds.String, new StringValue(String), Code);
            return(ExprRecResult.Succeeded);
        }