Exemple #1
0
        ISkillNode Add()
        {
            ISkillNode n = Mult();

            while (currentToken.Type == SkillType.PLUS || currentToken.Type == SkillType.MINUS)
            {
                Token t = currentToken;
                Eat(t.Type);
                n = new BinOp(n, Mult(), t);
            }
            return(n);
        }
Exemple #2
0
        ISkillNode Mult()
        {
            ISkillNode n = Pow();

            while (currentToken.Type == SkillType.MULTI || currentToken.Type == SkillType.DIVIDE)
            {
                Token t = currentToken;
                Eat(t.Type);
                n = new BinOp(n, Pow(), t);
            }
            return(n);
        }
Exemple #3
0
        ISkillNode Pow()
        {
            ISkillNode n;

            if (currentToken.Type == SkillType.LBRACKET)
            {
                n = Brack();
            }
            else
            {
                n = Num();
            }
            while (currentToken.Type == SkillType.POWER)
            {
                Token t = currentToken;
                Eat(SkillType.POWER);
                n = new BinOp(n, Pow(), t);
            }
            return(n);
        }