function visitNode(oNode) {
			if (oNode) {
				if (oNode.id === "VALUE" && oNode.ambiguous) {
					error(oNode, "ambiguous type for the literal");
				}
				visitNode(oNode.left);
				visitNode(oNode.right);
				if (oNode.parameters) {
					if (oNode.value === "contains") {
						oNode.value = "substringof";
						oNode.parameters.push(oNode.parameters.shift()); // swap the parameters
					}
					oNode.parameters.forEach(visitNode);
				}
				if (oNode.left && oNode.right) {
					if (oNode.left.id === "VALUE") {
						if (oNode.right.id === "VALUE") {
							error(oNode, "saw literals on both sides of '" + oNode.id + "'");
						}
						convertLiteral(oNode.left, oNode.right);
					} else if (oNode.right.id === "VALUE") {
						convertLiteral(oNode.right, oNode.left);
					}
				}
			}
		}
/*
		 * Visits a node in the syntax recursively.
		 * @param {object} oNode A node
		 */
Visits a node in the syntax recursively.
@param {object} oNode A node
Visits a node in the syntax recursively . @param { object } oNode A node
function visitNode(oNode) {
			if (oNode) {
				if (oNode.id === "VALUE" && oNode.ambiguous) {
					error(oNode, "ambiguous type for the literal");
				}
				visitNode(oNode.left);
				visitNode(oNode.right);
				if (oNode.parameters) {
					if (oNode.value === "contains") {
						oNode.value = "substringof";
						oNode.parameters.push(oNode.parameters.shift()); 
					}
					oNode.parameters.forEach(visitNode);
				}
				if (oNode.left && oNode.right) {
					if (oNode.left.id === "VALUE") {
						if (oNode.right.id === "VALUE") {
							error(oNode, "saw literals on both sides of '" + oNode.id + "'");
						}
						convertLiteral(oNode.left, oNode.right);
					} else if (oNode.right.id === "VALUE") {
						convertLiteral(oNode.right, oNode.left);
					}
				}
			}
		}
function visitNode ( oNode ) { if ( oNode ) { if ( oNode . id === "VALUE" && oNode . ambiguous ) { error ( oNode , "ambiguous type for the literal" ) ; } visitNode ( oNode . left ) ; visitNode ( oNode . right ) ; if ( oNode . parameters ) { if ( oNode . value === "contains" ) { oNode . value = "substringof" ; oNode . parameters . push ( oNode . parameters . shift ( ) ) ; } oNode . parameters . forEach ( visitNode ) ; } if ( oNode . left && oNode . right ) { if ( oNode . left . id === "VALUE" ) { if ( oNode . right . id === "VALUE" ) { error ( oNode , "saw literals on both sides of '" + oNode . id + "'" ) ; } convertLiteral ( oNode . left , oNode . right ) ; } else if ( oNode . right . id === "VALUE" ) { convertLiteral ( oNode . right , oNode . left ) ; } } } }
Visits a node in the syntax recursively.
Visits a node in the syntax recursively .
// swap the parameters