Example #1
0
        public string ReaderFriendly(int indent)
        {
            string ctx     = Context != null ? "|" + Context.ReaderFriendly() : "";
            string toWrite = $"{Friendly.tabs(indent)}DO->[{this.Literal}{ctx}]";

            return(toWrite);
        }
Example #2
0
        public string ReaderFriendly(int indent)
        {
            string ctx     = Context != null ? "|" + Context.ReaderFriendly() : "";
            string negate  = TrueCondition ? "" : "NOT ";
            string toWrite = $"{Friendly.tabs(indent)}{negate}({this.Literal}{ctx})";

            return(toWrite);
        }
Example #3
0
        public string ReaderFriendly(int indent)
        {
            string toWrite = string.Empty;
            string tabs    = Friendly.tabs(indent);

            if (Friendly.IsAlwaysTrue(If.Id))
            {
                toWrite = $"{Then.ReaderFriendly(indent)}";
            }
            else
            {
                toWrite = $"{tabs}IF...\n{If.ReaderFriendly(indent)}\n{tabs}THEN...\n{Then.ReaderFriendly(indent)}";
            }

            return(toWrite);
        }
Example #4
0
        public string ReaderFriendly(int indent)
        {
            string toReturn = string.Empty;
            string tabs     = Friendly.tabs(indent);
            string tabsPlus = Friendly.tabs(indent + 1);


            if (Friendly.IsAlwaysTrue(First.Id) && Friendly.IsAlwaysTrue(Second.Id))
            {
                toReturn = new TrueExpression().ReaderFriendly(indent);
            }
            if (Friendly.IsAlwaysTrue(First.Id))
            {
                if (!TrueCondition)
                {
                    toReturn = $"{Friendly.tabs(indent)}NOT (\n";
                }
                toReturn = toReturn + Second.ReaderFriendly(indent + ((TrueCondition) ? 0 : 1));
                if (!TrueCondition)
                {
                    toReturn += $"\n{Friendly.tabs(indent)})";
                }
            }
            else if (Friendly.IsAlwaysTrue(Second.Id))
            {
                if (!TrueCondition)
                {
                    toReturn = $"{Friendly.tabs(indent)}NOT (\n";
                }
                toReturn = toReturn + First.ReaderFriendly(indent + ((TrueCondition) ? 0 : 1));
                if (!TrueCondition)
                {
                    toReturn += $"\n{Friendly.tabs(indent)})";
                }
            }
            else
            {
                string negate = TrueCondition ? "" : "NOT ";
                toReturn = $"{tabs}{negate}(\n{First.ReaderFriendly(indent + 1)}\n{tabsPlus}{Condition.ToUpper()}\n{Second.ReaderFriendly(indent + 1)}\n{tabs})";
            }
            return(toReturn);
        }
Example #5
0
        public string ReaderFriendly(int indent)
        {
            string toWrite = $"{Friendly.tabs(indent)}<BEGIN {this.Literal} - {this.Id}>";

            if (Reactions != null && Reactions.Count > 0)
            {
                toWrite = toWrite + "\n";

                int cnt = Reactions.Count;
                int i   = 0;
                foreach (var reaction in Reactions)
                {
                    i++;
                    string toAdd = reaction.ReaderFriendly(indent + 1);
                    if (i < cnt)
                    {
                        toAdd += "\n";
                    }
                    toWrite = toWrite + toAdd;
                }
            }

            return(toWrite + $"\n{Friendly.tabs(indent)}<END {this.Literal}>");
        }
Example #6
0
        public string ReaderFriendly(int indent)
        {
            string toWrite = $"{Friendly.tabs(indent)}DO->[Nothing]";

            return(toWrite);
        }
Example #7
0
        public string ReaderFriendly(int indent)
        {
            string toWrite = $"{Friendly.tabs(indent)}({this.Literal})";

            return(toWrite);
        }