While.Parsing.Parser.ExpectInt C# (CSharp) 메소드

ExpectInt() 개인적인 메소드

private ExpectInt ( Expression exp, Token t, bool isRightHandSide ) : bool
exp Expression
t Token
isRightHandSide bool
리턴 bool
        private bool ExpectInt(Expression exp, Token t, bool isRightHandSide)
        {
            if (!(exp is TypedExpression<int>)) {
                errors.SemErr(t.line, t.col, string.Format("'{0}' expects an integer expression on its {1} side", t.val, isRightHandSide ? "right" : "left"));
                return false;
            }
            return true;
        }