Additional rules for the Mini-Pascal language. 20100603. 1. A programmer cannot define new type names. 2. Comments are marked with two slashes and extend the end of the line. For example, // this is a comment. 3. We use name equivalence for type compatibility. 4. We forbid to add an integer and a real number together. 5. A function's value is the value of the variable whose name is the same as the function. For example, function addition(a, b: integer) : integer; begin addition := a + b; // this is the return value end; If a function did not set up a return value, a compiler may generate an error message. 6. We may assign an arry to another. For example, var a, b: array [ 23 .. 57 ] of integer; a := b; 7. All parameters are passed by value. 8. We can assign a whole array to a variable. For example, VAR a, b : array [ 1 .. 10 ] of array [ 1 .. 10 ] of Integer; a[5] := b[3]; 9. Array indices could be negative. For example, VAR a : Array [ -5 .. 5 ] of Integer ; a[ -5 ] := -5; a[ -1 ] := -10; 10. To call a procdure, we simply refer to the name of the procedure plus appropriate parameters. This corresponds to the following two rules in the Mini-pascal grammar: procedure_statement ::= id | id ( expression_list ) 11. We allow overloading. A function and a variable may have the same name if the type of the function's return value and the type of the variable are different. There could be multiple functions with the same name if they will never cause trouble in any Mini-Pascal program. 12. Mini-Pascal is not an object-oriented language. However, you may extend Mini-Pascal to include object-oriented features, such as inheritance. 13. A number could be prefixed with an optional positive/negative sign. A number could be an integer or a floating-point number. They both are considered You may define the regular expression for a number in an appropriate way. 14. Furthermore, in the Mini-Pascal grammar, there is no provision a string, such as "hello", is also considered as a number by the scanner. Similarly, a character, such as 'a', is also considered as a number by the scanner. 15. In Mini-Pascal, upper-case letters and lower-case letters in names are considered equivalent. For instance, aBcD = abcd = ABCD. This is different from the rule in the C language. --