public void SemanticError10()
 {
     GlobalSymbolList globals = new GlobalSymbolList();
     globals.Add("a", IrisType.Integer);
     string input = @"a[0]";
     TestHelpers.TestExpressionParserWithError(input, globals, @"(1, 1) Symbol 'a' is not an array, but is being used as an array.");
 }
 public void SemanticError06()
 {
     GlobalSymbolList globals = new GlobalSymbolList();
     globals.Add("a", Procedure.Create(new Variable[0]));
     string input = @"not a";
     TestHelpers.TestExpressionParserWithError(input, globals, @"(1, 5) Expecting boolean expression.");
 }
 public void SemanticError08()
 {
     GlobalSymbolList globals = new GlobalSymbolList();
     globals.Add("a", Procedure.Create(new Variable[] { new Variable(IrisType.Boolean, "b") }));
     string input = @"a(true) + 1";
     TestHelpers.TestExpressionParserWithError(input, globals, @"(1, 9) Cannot apply operator to procedure call.");
 }
 public void SemanticError13()
 {
     GlobalSymbolList globals = new GlobalSymbolList();
     globals.Add("a", IrisType.Integer.MakeArrayType());
     string input = @"a + a";
     TestHelpers.TestExpressionParserWithError(input, globals, @"(1, 3) Operator requires a primitive type (boolean, integer, or string).");
 }
        public void SemanticError18()
        {
            GlobalSymbolList globals = new GlobalSymbolList();
            globals.Add("method", TestHelpers.MakeTestFunction(IrisType.Integer, new IrisType[] { IrisType.Integer }));

            string input = @"method(false)";
            TestHelpers.TestExpressionParserWithError(input, globals, @"(1, 8) Argument type doesn't match parameter 'p0' of function 'method'");
        }
        public void SemanticError39()
        {
            GlobalSymbolList globals = new GlobalSymbolList();
            globals.Add("method", TestHelpers.MakeTestFunction(IrisType.Integer, new IrisType[] { IrisType.Integer }));

            string input = @"method";
            TestHelpers.TestExpressionParserWithError(input, globals, @"(1, 1) Wrong number of arguments for function 'method'.  1 expected.  0 provided.");
        }
        public void SemanticError29()
        {
            GlobalSymbolList globals = new GlobalSymbolList();
            globals.Add("method", TestHelpers.MakeTestFunction(IrisType.Integer, new IrisType[] { IrisType.Integer.MakeByRefType() }));

            string input = @"method(false)";
            TestHelpers.TestExpressionParserWithError(input, globals, @"(1, 8) Cannot take address of constant, call, or expression.");
        }
        public void SemanticError19()
        {
            GlobalSymbolList globals = new GlobalSymbolList();
            globals.Add("a", IrisType.Integer.MakeArrayType());

            string input = @"a[true]";
            TestHelpers.TestExpressionParserWithError(input, globals, @"(1, 3) Expecting integer value as array index.");
        }
예제 #9
0
        public void LexError05()
        {
            string input =
                @"{aaaa
aaaa
aaaa";

            TestHelpers.TestExpressionParserWithError(input, @"(4, 1) Unexpected end of file looking for end of comment.");
        }
예제 #10
0
        public void SemanticError01()
        {
            string input = @"not 'Hello World'";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 5) Unary operators cannot be applied to string values.");
        }
예제 #11
0
        public void SemanticError12()
        {
            string input = @"1 > true";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 3) Type mismatch error.");
        }
예제 #12
0
        public void SyntaxError04()
        {
            string input = @"1 +";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 4) Expecting expression.");
        }
예제 #13
0
        public void SemanticError07()
        {
            string input = @"f(true)";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 1) Symbol 'f' is undefined.");
        }
예제 #14
0
        public void SemanticError03()
        {
            string input = @"'a' - 'b'";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 5) Only the '+' or comparison operators can be used on string values.");
        }
예제 #15
0
        public void SemanticError14()
        {
            string input = @"not 1";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 5) Expecting boolean expression.");
        }
예제 #16
0
        public void SemanticError02()
        {
            string input = @"-false";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 2) Unary negate operator cannot be applied to boolean values.");
        }
예제 #17
0
        public void LexError01()
        {
            string input = @"~";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 1) Unexpected character.");
        }
예제 #18
0
        public void SemanticError04()
        {
            string input = @"false + true";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 7) Arithmetic operators cannot be applied to boolean values.");
        }
예제 #19
0
        public void LexError03()
        {
            string input = @"2222222222222222222222";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 1) Invalid numeric constant.");
        }
예제 #20
0
        public void SemanticError09()
        {
            string input = @"a[0]";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 1) Symbol 'a' is undefined.");
        }
예제 #21
0
        public void LexError04()
        {
            string input = @"'aaaa";

            TestHelpers.TestExpressionParserWithError(input, @"(1, 1) Unexpected end of line looking for end of string.");
        }