public static Struct forwardDecl(SimpleIdentifier name, Type type) { Struct s = new Struct(); s.setForwardDeclaration(true); s.setTag(name); s.setType(type); return s; }
private Struct parseClasse(Node classe, com.ochafik.lang.jnaerator.parser.Struct.Type type, SourceFile sf) throws XPathExpressionException { Struct cs = new Struct(); cs.setType(type); String name = XMLUtils.getAttribute(classe, "name"); if (result.config.verbose) { System.out.println("Parsing class " + name); } cs.setTag(ident(name)); for (Node method : XPathUtils.findNodesIterableByXPath("method", classe)) { // String mname = XMLUtils.getAttribute(method, "selector"); try { // if ((name.equals("NSScriptClassDescription") || name.equals("NSObject")) && mname.contains("classCode")) // name.toString(); cs.addDeclaration(parseFunction(Type.ObjCMethod, method, sf)); } catch (Exception ex) { ex.printStackTrace(); } } sf.addDeclaration(new TaggedTypeRefDeclaration(cs)); return cs; }
private Struct parseClasse(Node classe, com.ochafik.lang.jnaerator.parser.Struct.Type type, SourceFile sf) throws XPathExpressionException { Struct cs = new Struct(); cs.setType(type); String name = XMLUtils.getAttribute(classe, "name"); if (result.config.verbose) { System.out.println("Parsing class " + name); } cs.setTag(ident(name)); for (Node method : XPathUtils.findNodesIterableByXPath("method", classe)) { // String mname = XMLUtils.getAttribute(method, "selector"); try { // if ((name.equals("NSScriptClassDescription") || name.equals("NSObject")) && mname.contains("classCode")) // name.toString(); cs.addDeclaration(parseFunction(Type.ObjCMethod, method, sf)); } catch (Exception ex) { ex.printStackTrace(); } } sf.addDeclaration(new TaggedTypeRefDeclaration(cs)); return cs; }
Struct interf = new Struct(); interf.addToCommentBefore("Wrapper around the OpenCL program " + name); interf.addModifiers(ModifierType.Public);
type = new Struct(); type.setType(Struct.Type.CUnion);
Struct publicStaticClass(Identifier name, Identifier parentName, Struct.Type type, Element toCloneCommentsFrom, Identifier... interfaces) { Struct cl = new Struct(); cl.setType(type); cl.setTag(name); if (parentName != null) { cl.setParents(typeRef(parentName)); } if (type == Struct.Type.JavaInterface) { for (Identifier inter : interfaces) { cl.addParent(typeRef(inter)); } } else { for (Identifier inter : interfaces) { cl.addProtocol(typeRef(inter)); } } if (!result.config.noComments) { cl.importComments(toCloneCommentsFrom, getFileCommentContent(toCloneCommentsFrom)); } cl.addModifiers(ModifierType.Public, ModifierType.Static); return cl; }
Struct publicStaticClass(Identifier name, Identifier parentName, Struct.Type type, Element toCloneCommentsFrom, Identifier... interfaces) { Struct cl = new Struct(); cl.setType(type); cl.setTag(name); if (parentName != null) { cl.setParents(typeRef(parentName)); } if (type == Struct.Type.JavaInterface) { for (Identifier inter : interfaces) { cl.addParent(typeRef(inter)); } } else { for (Identifier inter : interfaces) { cl.addProtocol(typeRef(inter)); } } if (!result.config.noComments) { cl.importComments(toCloneCommentsFrom, getFileCommentContent(toCloneCommentsFrom)); } cl.addModifiers(ModifierType.Public, ModifierType.Static); return cl; }
Struct publicStaticClass(Identifier name, Identifier parentName, Struct.Type type, Element toCloneCommentsFrom, Identifier... interfaces) { Struct cl = new Struct(); cl.setType(type); cl.setTag(name); if (parentName != null) { cl.setParents(typeRef(parentName)); } if (type == Struct.Type.JavaInterface) { for (Identifier inter : interfaces) { cl.addParent(typeRef(inter)); } } else { for (Identifier inter : interfaces) { cl.addProtocol(typeRef(inter)); } } if (!result.config.noComments) { cl.importComments(toCloneCommentsFrom, getFileCommentContent(toCloneCommentsFrom)); } cl.addModifiers(ModifierType.Public, ModifierType.Static); return cl; }
Struct publicStaticClass(Identifier name, Identifier parentName, Struct.Type type, Element toCloneCommentsFrom, Identifier... interfaces) { Struct cl = new Struct(); cl.setType(type); cl.setTag(name); if (parentName != null) { cl.setParents(typeRef(parentName)); } if (type == Struct.Type.JavaInterface) { for (Identifier inter : interfaces) { cl.addParent(typeRef(inter)); } } else { for (Identifier inter : interfaces) { cl.addProtocol(typeRef(inter)); } } if (!result.config.noComments) { cl.importComments(toCloneCommentsFrom, getFileCommentContent(toCloneCommentsFrom)); } cl.addModifiers(ModifierType.Public, ModifierType.Static); return cl; }
Struct implementations = new Struct(); implementations.setType(Struct.Type.JavaClass); implementations.addToCommentBefore("Wrapper for library <b>" + library + "</b>", declarations = new Struct(); declarations.setType(Struct.Type.JavaInterface); declarations.addToCommentBefore("Interface for library <b>" + library + "</b>",
Struct implementations = new Struct(); implementations.setType(Struct.Type.JavaClass); implementations.addToCommentBefore("Wrapper for library <b>" + library + "</b>", declarations = new Struct(); declarations.setType(Struct.Type.JavaInterface); declarations.addToCommentBefore("Interface for library <b>" + library + "</b>",
type = new Struct(); type.setType(Struct.Type.CStruct); type.setForwardDeclaration(true);
Element comel = parent != null && parent instanceof TypeDef ? parent : functionSignature; Struct callbackStruct = new Struct(); configureCallbackStruct(callbackStruct);
Element comel = parent != null && parent instanceof TypeDef ? parent : functionSignature; Struct callbackStruct = new Struct(); configureCallbackStruct(callbackStruct);
public Struct generateObjectiveCClass(Struct in, Signatures signatures) throws IOException { boolean isProtocol = in.getType() == Type.ObjCProtocol, isCategory = in.getCategoryName() != null; Struct instanceStruct = new Struct().addModifiers(ModifierType.Public); Struct classStruct = new Struct(); classStruct.setTag(ident(classClassName)); classStruct.setType(Struct.Type.JavaClass); structThatReceivesStaticMethods = classInterfaceStruct = new Struct(); classInterfaceStruct.setType(Struct.Type.JavaInterface); classInterfaceStruct.setTag(ident(classInterfaceNameInCategoriesAndProtocols));
public Struct generateObjectiveCClass(Struct in, Signatures signatures) throws IOException { boolean isProtocol = in.getType() == Type.ObjCProtocol, isCategory = in.getCategoryName() != null; Struct instanceStruct = new Struct().addModifiers(ModifierType.Public); Struct classStruct = new Struct(); classStruct.setTag(ident(classClassName)); classStruct.setType(Struct.Type.JavaClass); structThatReceivesStaticMethods = classInterfaceStruct = new Struct(); classInterfaceStruct.setType(Struct.Type.JavaInterface); classInterfaceStruct.setTag(ident(classInterfaceNameInCategoriesAndProtocols));
PrintWriter hubOut = null; if (result.config.entryName != null) { librariesHub = new Struct(); librariesHub.addToCommentBefore("JNA Wrappers instances"); librariesHub.setType(Struct.Type.JavaClass); Struct interf = new Struct(); interf.setResolvedJavaIdentifier(fullLibraryClassName); interf.addToCommentBefore("JNA Wrapper for library <b>" + library + "</b>",
PrintWriter hubOut = null; if (result.config.entryName != null) { librariesHub = new Struct(); librariesHub.addToCommentBefore("JNA Wrappers instances"); librariesHub.setType(Struct.Type.JavaClass); Struct interf = new Struct(); interf.setResolvedJavaIdentifier(fullLibraryClassName); interf.addToCommentBefore("JNA Wrapper for library <b>" + library + "</b>",
en.addModifiers(ModifierType.Public); out.addDeclaration(new TaggedTypeRefDeclaration(en)); Struct body = new Struct(); en.setBody(body); boolean hasValidItem = false;
en.addModifiers(ModifierType.Public); out.addDeclaration(new TaggedTypeRefDeclaration(en)); Struct body = new Struct(); en.setBody(body); boolean hasValidItem = false;