• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java NType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.apple.internal.jobjc.generator.model.types.NType的典型用法代码示例。如果您正苦于以下问题:Java NType类的具体用法?Java NType怎么用?Java NType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NType类属于com.apple.internal.jobjc.generator.model.types包,在下文中一共展示了NType类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: parse

import com.apple.internal.jobjc.generator.model.types.NType; //导入依赖的package包/类
@Override protected NType parse(StringStream ss) {
    assert parsePossible(ss);
    // {_NSRect=
    //   "origin"{_NSPoint="x"f"y"f}
    //   "size"{_NSSize="width"f"height"f}}
    ss.eat(getOpen());
    String cname = ss.readUntilEither("=" + getClose());
    List<NStruct.NField> fields = new ArrayList<NStruct.NField>();
    if(ss.peek() == '='){
        ss.eat('=');
        while(ss.peek() != getClose()){
            String fname = "";
            if(ss.peek() == '"'){
                ss.eat('"');
                fname = ss.readUntil('"');
                ss.eat('"');
            }
            NType type = NTypeParser.parseFrom(ss);
            fields.add(new NStruct.NField(fname, type));
        }
    }
    ss.eat(getClose());
    return getNew(cname, fields);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:NTypeParser.java


示例2: merge

import com.apple.internal.jobjc.generator.model.types.NType; //导入依赖的package包/类
/**
 * Merge a and b.
 */
public NType merge(NType a, NType b) throws MergeFailed{
    if(a!=null && b==null) return a;
    if(a==null && b!=null) return b;
    if(a==null && b==null) return null;
    if(a.equals(b)) return a;
    try {
        return Dispatcher.dispatch(getClass(), this, "accept", a, b);
    } catch (NoSuchMethodException e) {
        throw new MergeFailed("a and b are of different NType", a, b);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:NTypeMerger.java


示例3: printStructInfos

import com.apple.internal.jobjc.generator.model.types.NType; //导入依赖的package包/类
static void printStructInfos(Framework fw, Width arch, PrintWriter out){
    for(Struct st : fw.structs){
        NStruct nst = wget(arch, st.type.type32, st.type.type64);
        out.println("std::cout << \"" + fw.name + " " + st.name + "\" << ':' << sizeof("+st.name+")");
        for(NField sf : nst.fields){
            out.print("\t<< ' ' << ");
            out.println(sf.type instanceof NType.NBitfield
                      ? "-1"
                      : "offsetof("+st.name+","+sf.name+")");
        }
        out.println("\t<< std::endl;");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:StructOffsetResolver.java


示例4: parseFrom

import com.apple.internal.jobjc.generator.model.types.NType; //导入依赖的package包/类
protected static NType parseFrom(StringStream ss) {
    if(ss.left() == 0)
        return null;
    try{
        for(NTypeParser nt : PARSERS)
            if(nt.parsePossible(ss))
                return nt.parse(ss);
    }
    catch(RuntimeException x){
        throw new RuntimeException("Exception while parsing '" + ss.remainingToString()
                + "' from '" + ss.toString() + "'", x);
    }
    throw new RuntimeException("Found no parser for '" + ss.remainingToString()
            + "' from '" + ss.toString() + "'");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:NTypeParser.java


示例5: print

import com.apple.internal.jobjc.generator.model.types.NType; //导入依赖的package包/类
public String print(NType nt){
    try {
        return Dispatcher.dispatch(getClass(), this, "accept", nt);
    } catch (NoSuchMethodException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:NTypePrinter.java


示例6: ElementWType

import com.apple.internal.jobjc.generator.model.types.NType; //导入依赖的package包/类
public ElementWType(final Node node, final String declType, final P parent) {
    super(node, parent);
    final String type32 = getAttr(node, "type");
    final String type64 = getAttr(node, "type64");
    this.type = Type.getType(declType,
                    type32 == null ? NType.NUnknown.inst() : NTypeParser.parseFrom(type32),
                    type64 == null ? null : NTypeParser.parseFrom(type64));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:ElementWType.java


示例7: getCoderDescriptorFor

import com.apple.internal.jobjc.generator.model.types.NType; //导入依赖的package包/类
public static ComplexCoderDescriptor getCoderDescriptorFor(final NType nt32, final NType nt64) {
    Pair<NType,NType> cacheKey = new Pair(nt32, nt64);
    if(cache.containsKey(cacheKey)) return cache.get(cacheKey);

    final PrimitiveCoderDescriptor desc32 = PrimitiveCoderDescriptor.getCoderDescriptorFor((NPrimitive) nt32);
    final PrimitiveCoderDescriptor desc64 = PrimitiveCoderDescriptor.getCoderDescriptorFor((NPrimitive) nt64);

    final ComplexCoderDescriptor newDesc = nt32.equals(nt64) ? new ComplexCoderDescriptor(desc64) : new MixedEncodingDescriptor(desc32, desc64);
    cache.put(cacheKey, newDesc);
    if(newDesc instanceof MixedEncodingDescriptor)
        mixedEncodingDescriptors.add((MixedEncodingDescriptor) newDesc);

    return newDesc;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:ComplexCoderDescriptor.java


示例8: doParse

import com.apple.internal.jobjc.generator.model.types.NType; //导入依赖的package包/类
private NType doParse(String type){
    NType nt = NTypeParser.parseFrom(type);
    String printed = nt.toString();
    System.out.println("Original: " + type);
    System.out.println("Printed.: " + printed);
    assertEquals(type, printed);
    return nt;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:NativeTypeTest.java


示例9: testMerge

import com.apple.internal.jobjc.generator.model.types.NType; //导入依赖的package包/类
public void testMerge(){
    NType a = doParse("{_NSRect={_NSPoint=\"x\"f\"y\"f}\"size\"{_NSSize=ff}}");
    NType b = doParse("{_NSRect=\"origin\"{_NSPoint=ff}{_NSSize=\"width\"f\"height\"f}}");
    NType c = NTypeMerger.inst().merge(a, b);
    NType expected = doParse("{_NSRect=\"origin\"{_NSPoint=\"x\"f\"y\"f}\"size\"{_NSSize=\"width\"f\"height\"f}}");
    System.out.println("Merge results:");
    System.out.println("\ta: " + a.toString());
    System.out.println("\tb: " + b.toString());
    System.out.println("\tc: " + c.toString());
    System.out.println("\tx: " + expected.toString());
    assertEquals(expected, c);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:NativeTypeTest.java



注:本文中的com.apple.internal.jobjc.generator.model.types.NType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PlaceManager类代码示例发布时间:2022-05-22
下一篇:
Java EncryptionMethod类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap