return node.getNumChildren() == 2; if (node.getNumChildren() > 0) { return node.getNumChildren() == 1 || node.getNumChildren() == 2; return node.getNumChildren() > 1; // TODO - check again but I think some relational operators can have zero or more child
@Override public boolean check(ValidationContext ctx, ASTNode node) { // If is piecewise... if (node.isPiecewise() && node.getNumChildren() > 0) { byte dt = ValidationTools.getDataType(node.getLeftChild()); if (dt == ValidationTools.DT_STRING) { return false; } // all children must have same Type for (int i = 0; i < node.getNumChildren(); i += 2) { if (dt != ValidationTools.getDataType(node.getChild(i))) { return false; } } } return true; } };
@Override public boolean check(ValidationContext ctx, ASTNode node) { // do not check inside functionDefinition if (node.getParentSBMLObject() instanceof FunctionDefinition) { return true; } // If is piecewise... if (node.getType() == Type.FUNCTION_PIECEWISE) { // every second node must be a condition and therefore return a // boolean for (int i = 1; i < node.getNumChildren(); i += 2) { ASTNode child = node.getChild(i); if (ValidationTools.getDataType( child) != ValidationTools.DT_BOOLEAN) { // System.out.println("Node " + child.getType() + " was " + // ValidationTools.getDataType(child)); return false; } } } return true; } };
@Override public boolean check(ValidationContext ctx, ASTNode node) { // In comparator... if (node.isRelational() && node.getChildCount() > 0) { byte dt = ValidationTools.getDataType(node.getChild(0)); // all children must have same Type for (int i = 1; i < node.getNumChildren(); i++) { if (dt != ValidationTools.getDataType(node.getChild(i))) { return false; } } } return true; } };
@Override public boolean check(ValidationContext ctx, ASTNode node) { ASTNode.Type type = node.getType(); if (type == Type.FUNCTION) { // System.out.println("10219 - Found a FUNCTION " + " - " + node.getName()); Model m = node.getParentSBMLObject().getModel(); if (m != null) { FunctionDefinition fd = m.getFunctionDefinition(node.getName()); if (fd != null) { // TODO - for L3V2, we can have no bvar defined !! // System.out.println("10219 - " + node.getNumChildren() + " - " + fd.getArgumentCount()); return node.getNumChildren() == fd.getArgumentCount(); } else { // System.out.println("10219 - fd is null"); } } else { // System.out.println("10219 - Model is null"); } } return true; }
|| t == Type.FUNCTION_MAX || t == Type.FUNCTION_MIN) if (node.getNumChildren() > 0) { UnitDefinition ud = node.getChild(0).compile(unitsCompiler).getUnits(); for (int n = 1; n < node.getNumChildren(); n++) { UnitDefinition ud2 = node.getChild(n).compile(unitsCompiler).getUnits(); if (node.getNumChildren() == 2) { ASTNode right = node.getRightChild(); if (node.getNumChildren() == 0) { return true; for (int n = 1; n < node.getNumChildren(); n++) { ASTNode child = node.getChild(n); UnitDefinition def = child.deriveUnit(); if (node.getNumChildren() < 2) { return true; if (node.getNumChildren() < 2) { return true; for (int n = 0; n < node.getNumChildren(); n++) { ASTNode child = node.getChild(n); UnitDefinition def = child.compile(unitsCompiler).getUnits();
if (math.getNumChildren() == 1) { if (!math.getChild(0).isLambda()) { success = false;
if (node.getNumChildren() > 0) { byte dt = getDataType(node.getChild(0)); for (int i = 0; i < node.getNumChildren(); i += 2) { if (getDataType(node.getChild(i)) != dt) { return DT_UNKNOWN;
if (body.isName() && body.getNumChildren() == 0)