예제 #1
0
 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();
   }
 }
예제 #2
0
 protected String composeEntityName(WalkContext parent, CAstEntity f) {
   if (f.getKind() == CAstEntity.SCRIPT_ENTITY) return f.getName();
   else return parent.getName() + "/" + f.getName();
 }