This files describes how to ensure non regression a TomChecker.

This tests have been created using: ./verify-check -c
S, for each *.t file we call jtom --Wall and redirect the output to a corresponding file *.expectedOutcome

To valide the non regression, call ./verify-check
A diff call is realized on the output of jtom --Wall and the expectedOutcome.


Each following section describes expected failure of Tom and its corresponding line and message.


////////////////////
TYPETERM DECLARATION
////////////////////
Grammar:
	%typeterm typeName {
		implement	     { ... }
		get_fun_sym(var)     { ... }
		cmp_fun_sym(var,var) { ... }
		get_subterm(var,var) { ... }
		[equals(var,var)     { ... }]
	}
Test:
	JTypeTerm.t
	  line 66: Multiple definition of Symbol `type9`
	  line 55: Arguments must be linear in macro-function `equals`: Variable `t1` is repeated
	  line 45: Arguments must be linear in macro-function `cmp_fun_sym`: Variable `s1` is repeated
	  line 38: Repeated macro-function `get_fun_sym`
	  line 22: Missing macro-function(s) [ get_fun_sym,  cmp_fun_sym,  get_subterm ]
	  line 15: Missing macro-function(s) [ get_subterm ]
	  line 8: Missing macro-function(s) [ cmp_fun_sym ]
	  line 1: Missing macro-function(s) [ get_fun_sym ]	Missing functions : [get_fun_sym]
	  Tom SyntaxChecker:  Encountered 8 errors and 0 warnings.
Missing `equals` is OK

////////////////////
TYPEARRAY DECLARATION
////////////////////
Grammar:
	%typearray typeName {
		implement            { ... }
		get_fun_sym(var)     { ... }
		cmp_fun_sym(var,var) { ... }
		get_element(var,var) { ... }
		get_size(var)        { ... }
		[equals(var,var)     { ... }]
	}
Test:
	JTypeArray.t
	  line 77: Multiple definition of Symbol `type9`
	  line 66: Repeated macro-function `get_element`
	  line 54: Arguments must be linear in macro-function `equals`: Variable `l1` is repeated
	  line 44: Arguments must be linear in macro-function `cmp_fun_sym`: Variable `t1` is repeated
	  line 25: Missing macro-function(s) [ get_size ]
	  line 17: Missing macro-function(s) [ get_element ]
	  line 9: Missing macro-function(s) [ cmp_fun_sym ]
	  line 1: Missing macro-function(s) [ get_fun_sym ]
	  Tom SyntaxChecker:  Encountered 8 errors and 0 warnings.
Missing `equals` is OK

////////////////////
TYPELIST DECLARATION
////////////////////
Grammar:
	%typelist typeName {
		implement	     { ... }
		get_fun_sym(var)     { ... }
		cmp_fun_sym(var,var) { ... }
		get_head(var)    { ... }
		get_tail(var)    { ... }
		is_empty(var)    { ... }
	}
Test:
	JTypeList.t
	  line 95: Multiple definition of Symbol `type10`
	  line 81: Repeated macro-function `get_head`
	  line 69: Arguments must be linear in macro-function `equals`: Variable `l1` is repeated
	  line 58: Arguments must be linear in macro-function `cmp_fun_sym`: Variable `t1` is repeated
	  line 37: Missing macro-function(s) [ is_empty ]
	  line 28: Missing macro-function(s) [ get_tail ]
	  line 19: Missing macro-function(s) [ get_head ]
	  line 10: Missing macro-function(s) [ cmp_fun_sym ]
	  line 1: Missing macro-function(s) [ get_fun_sym ]
	  Tom SyntaxChecker:  Encountered 9 errors and 0 warnings.
Missing `equals` is OK

////////////////////
OPERATOR DECLARATION
////////////////////
Grammar:
	%op typeName opName [(slotName:type, type,... )] {
		fsym             { ... }
		[is_fsym(var)     { ... }
		 make(var, ...)   { ... }
		 get_slot(type,t) { ... }
		]
	}
Test:
	JOperator1.t
	  line 68: Multiple definition of Symbol `op6`
	  line 50: Bad number of arguments in make(...) macro-function: 1 arguments found but 2 expected in symbol definition
	  line 44: Arguments must be linear in macro-function `make`: Variable `t1` is repeated
	  line 38: Repeated macro-function `make`
	  line 29: Slot 2 of symbol `op2bis` declaration has an unknown type: `wrongtype`
	  line 24: Slot 1 of symbol `op2` declaration has an unknown type: `wrongtype`
	  line 18: Symbol `op1` has an unknown return type: `wrongtype`
	Tom SyntaxChecker:  Encountered 6 errors and 0 warnings.
Operator defined before type8 declaration is OK

	JOperator2.t
	  line 23: Warning: GetSlot declaration `get_slot(type,...)` is repeated. Consider only the first one!!
	  line 14: Warning: Incompatible GetSlot declaration: `badslot` does not appears in symbol declaration
	  line 10: Warning: GetSlot declaration `get_slot(slot2,...)` is missing. Generic getsubterm macro will be used!!
	Tom Parser:  Encountered 3 warnings.

	JOperator3.t
	  line 10: Repeated slot `s0` in symbol declaration
	Tom Parser:  Encountered 1 errors and 0 warnings.

////////////////////
OPARRAY DECLARATION
////////////////////
Grammar:
	%oparray typeName opName(typeName*) {
		fsym                  { ... }
		make_empty(var)       { ... }
		make_append(var, var) { ... }
	}
Test:
	JOpArray.t
	  line: 59 Multiple definition of Symbol `concArray7`
	  line: 50 Repeated macro-function `make_append`
	  line: 43  Arguments must be linear in macro-function `make_append`: Variable `e` is repeated
	  line: 35 Missing macro-function(s) [ make_append ]
	  line: 30Missing macro-function(s) [ make_empty ]
	  line: 24 List symbol `concArray2` has an unknown parameter type: `wrongType`
	  line: 18 Symbol `concArray1` has an unknown return type: `wrongType`
	Tom SyntaxChecker:  Encountered 6 errors and 0 warnings.

////////////////////
OPLIST DECLARATION
////////////////////
Grammar:
	%oplist typeName opName(typeName*) {
		fsym                  { ... }
		make_empty(var)       { ... }
		make_insert(var, var) { ... }
	}

Test:
	JOpList.t
	  line 58: Multiple definition of Symbol `concList7`
	  line 49: Repeated macro-function `make_empty`
	  line 42: Arguments must be linear in macro-function `make_insert`: Variable `e` is repeated
	  line 34: Missing macro-function(s) [ make_insert ]
	  line 29: Missing macro-function(s) [ make_empty ]
	  line 23: List symbol `concList2` has an unknown parameter type: `wrongtype`
	  line 17: Symbol `concList1` has an unknown return type: `wrongtype`
	Tom SyntaxChecker:  Encountered 7 errors and 0 warnings.
}


////////////////////
MATCH DECLARATION
////////////////////
Grammar:
	%match(typeName var, typeName var, ...) {
		term, term, ...-> { ... }
	}

Test:
	JMatch.t
          line 44: The symbol `op0` has type `type0` but type `type1` was required
	  line 41: Single list variable `X*` is not allowed on top of `match` pattern
	  line 41: Single list variable `_*` is not allowed on top of `match` pattern
	  line 39: Bad number of arguments: 2 argument(s) required by match signature but 3 found
	  line 37: Bad number of arguments: 2 argument(s) required by match signature but 1 found
	  line 33: Repeated variable `t1` in `match` declaration
	  line 30: Variable `t` has an unknown type: `type`
	Tom SyntaxChecker:  Encountered 6 errors and 1 warnings.

////////////////////
RULE DECLARATION
////////////////////
Grammar:
	%rule {
	  term -> term [where term := term] [if term == term]
	  ... 
	}

Test:
	JRule.t
	  line 107: Rule `op4` is repeated
	  line 101: `_`: Impossible in rule right hand side
	  line 101: `op1[...]`: Impossible in rule right hand side
	  line 101: `_`: Impossible in rule right hand side
	  line 97: `_`: Impossible in rule right hand side
	  line 97: Bad number of arguments for symbol `op1`: 2 argument(s) required but 1 found
	  line 97: `_`: Impossible in rule right hand side
	  line 94: `Disjunction`: Impossible in rule right hand side
	  line 93: `XML construct a`: Impossible in rule right hand side
	  line 92: `X*`: Impossible in rule right hand side
	  line 91: `_*`: Impossible in rule right hand side
	  line 90: `_`: Impossible in rule right hand side
	  line 89: The symbol `op5` has type `type2` but type `type1` was required
	  line 85: The symbol `op4` has type `type1` but type `type2` was required
	  line 85: Warning: Ambiguous symbol name. Is`op3` a variable or a constructor? Prefer `op3`() if it is a constructor
	  line 84: Bad number of arguments for symbol `op1`: 2 argument(s) required but 0 found
	  line 79: Rule head symbol name `op1` expected, but `op2` found
	  line 78: Unknown symbol `f`: Cant do further analyses
	  line 74: Rule head symbol `op2` has no `make` method: It is necessary to define one!!
	  line 70: `Disjunction`: Impossible in rule left hand side (Record)
	  line 66: `Disjunction`: Impossible in rule left hand side (Appl)
	  line 62: `XML construct a`: Impossible in rule left hand side
	  line 58: `_*`: Impossible in rule left hand side
	  line 54: `X*`: Impossible in rule left hand side
	  line 50: `_`: Impossible in rule left hand side
	Tom SyntaxChecker:  Encountered 22 errors and 2 warnings.
	
////////////////////
RECORD DECLARATION
////////////////////
	JRecord.t
	  line 41: Unknown symbol `opp`
	  line 37: Same slot names can not be used several times in symbol `op`: Repeated slot Name : `slot1`
	  line 35: [] are not allowed on lists or arrays, see `concList1`
	  line 33: Slot Name `badslot` is not correct for symbol `op`. Possible slot names are : [slot1, slot2]
	Tom SyntaxChecker:  Encountered 4 errors and 0 warnings.

////////////////////
APPL DECLARATION
////////////////////
	JAppl.t
	  line 87: Bad number of arguments for symbol `op2`: 2 argument(s) required but 1 found
	  line 85: The symbol `op0` has type `type0` but type `type2` was required
	  line 82: The symbol `op0` has type `type0` but type `type2` was required
	  line 82: Warning: Ambiguous symbol name. Is`op0` a variable or a constructor? Prefer `op0`() if it is a constructor
	  line 80: Unknown symbol `opError2`
	  line 78: Unknown symbol `opError`
	  line 74: X* is not allowed in non list symbol
	  line 74: _* is not allowed in non list symbol
	  line 72: The symbol `op1` has type `type1` but type `type2` was required
	  line 72: The symbol `op1` has type `type1` but type `type2` was required
	  line 70: Not able to found a list symbol of type: `type0`
	  line 66: Too many list symbols with returned type `type2`:  concList2 concList3
	  line 64: Bad number of arguments for symbol `op2`: 2 argument(s) required but 3 found
	  line 62: Bad number of arguments for symbol `op2`: 2 argument(s) required but 1 found
	Tom SyntaxChecker:  Encountered 13 errors and 1 warnings.

////////////////////
VARIABLE DECLARATION
////////////////////
	JVariable.t
	  line 54: Unknown symbol `a`: Cant do further analyses
	Tom SyntaxChecker:  Encountered 1 warnings.
	  line 52: Unknown variable(s) `[a]`
	  line 41: Variable `x` has type `type0` instead of type `type2`
	  line 41: Variable `x` has type `type0` instead of type `type1`
	  line 41: Bad variable type for `x`: it has both type `type1` and `type0`
	  line 41: Bad variable type for `x`: it has both type `type1` and `type2`
	Tom TypeChecker:  Encountered 5 errors and 0 warnings.

///
XML
///

	JXml.t
	  line 11: Malformed XML pattern: expecting `Integer|Int` but got `Integer|In`
	Tom Parser:  Encountered 1 errors and 0 warnings.
