public void addIncludeToCurrentContext(String s) {
    // look back the stack until we find a CompilationUnit or a Component
    ICode thisone = null;

    // not sure if needed
    thisone = currentCode;
    if (thisone instanceof Component) {
      ((IComponent) thisone)
          .addExternalIncludes(Code.HASH_INCLUDE_ + Code.DQUOTE + s + Code.DQUOTE);
      return;
    } else if (thisone instanceof CompilationUnit) {
      ((ICompilationUnit) thisone)
          .addExternalInclude(Code.HASH_INCLUDE_ + Code.DQUOTE + s + Code.DQUOTE);
      // System.out.println("adding '" + s + "' to " + ((ICompilationUnit) thisone ));
      return;
    }
    int lastIndex = bodyStack.size() - 1;
    for (int i = lastIndex; i > 0; i--) {
      thisone = bodyStack.get(i);
      if (thisone instanceof StructDeclaration) {
        ((StructDeclaration) thisone)
            .addExternalIncludes(Code.HASH_INCLUDE_ + Code.DQUOTE + s + Code.DQUOTE);
        return;
      } else if (thisone instanceof Component) {
        ((IComponent) thisone)
            .addExternalIncludes(Code.HASH_INCLUDE_ + Code.DQUOTE + s + Code.DQUOTE);
        return;
      } else if (thisone instanceof CompilationUnit) {
        ((ICompilationUnit) thisone)
            .addExternalInclude(Code.HASH_INCLUDE_ + Code.DQUOTE + s + Code.DQUOTE);
        return;
      }
    }
    throw new RuntimeException("Didn't find Compilation Unit or Component when adding includes");
  }
 public void addHoistedCodeToComponentOrCompilationUnitContext(String s) {
   // look back the stack until we find a Component
   int lastIndex = bodyStack.size() - 1;
   for (int i = lastIndex; i > 0; i--) {
     ICode thisone = bodyStack.get(i);
     if (thisone instanceof Component) {
       ((IComponent) thisone).addHoistedCode(s);
       return;
     } else if (thisone instanceof CompilationUnit) {
       ((ICompilationUnit) thisone).addHoistedCode(s);
       return;
     }
   }
   throw new RuntimeException(
       "Didn't find Component or Compilation Unit when adding hoisted code");
 }