コード例 #1
0
        private SubExpression Plus()
        {
            SubExpression expr = Factor();

            if (Peek?.Character == '+')
            {
                Next();
                expr = new RepeatedExpression(expr, '+');
            }

            return(expr);
        }
コード例 #2
0
        private SubExpression Star()
        {
            SubExpression expr = Plus();

            if (Peek?.Character == '*')
            {
                Next();
                expr = new RepeatedExpression(expr, '*');
            }

            return(expr);
        }