protected void declareFunction(CAstEntity N, WalkContext context) { String fnName = composeEntityName(context, N); if (N.getKind() == CAstEntity.SCRIPT_ENTITY) { ((JavaScriptLoader) loader).defineScriptType("L" + fnName, N.getPosition(), N, context); } else if (N.getKind() == CAstEntity.FUNCTION_ENTITY) { ((JavaScriptLoader) loader).defineFunctionType("L" + fnName, N.getPosition(), N, context); } else { Assertions.UNREACHABLE(); } }
protected String composeEntityName(WalkContext parent, CAstEntity f) { if (f.getKind() == CAstEntity.SCRIPT_ENTITY) return f.getName(); else return parent.getName() + "/" + f.getName(); }