lib/base.js
function getMember(obj, name, root) {
    var ii = str.indexOf('.');
    if (ii < 0) {
        var curobj = undefined;
        forEachStruct(obj.name, obj, root, function (structname, cobj, root) {
            if (name == cobj.name.name) {
                curobj = cobj;
            }
        });

        return curobj;
    }

    if (ii == 0) {
        return ;
    }

    var curtype = undefined;
    var cur = str.slice(0, ii);
    forEachStruct(obj.name, obj, root, function (structname, cobj, root) {
        if (cur == cobj.name.name) {
            curtype = cobj.type;
        }
    });

    if (curtype != undefined) {
        return getMember(getGlobalObj(curtype, root), str.slice(ii + 1), root);
    }

    return ;
}
function getMember(obj, name, root) {
    var ii = str.indexOf('.');
    if (ii < 0) {
        var curobj = undefined;
        forEachStruct(obj.name, obj, root, function (structname, cobj, root) {
            if (name == cobj.name.name) {
                curobj = cobj;
            }
        });

        return curobj;
    }

    if (ii == 0) {
        return ;
    }

    var curtype = undefined;
    var cur = str.slice(0, ii);
    forEachStruct(obj.name, obj, root, function (structname, cobj, root) {
        if (cur == cobj.name.name) {
            curtype = cobj.type;
        }
    });

    if (curtype != undefined) {
        return getMember(getGlobalObj(curtype, root), str.slice(ii + 1), root);
    }

    return ;
}
function getMember ( obj , name , root ) { var ii = str . indexOf ( '.' ) ; if ( ii < 0 ) { var curobj = undefined ; forEachStruct ( obj . name , obj , root , function ( structname , cobj , root ) { if ( name == cobj . name . name ) { curobj = cobj ; } } ) ; return curobj ; } if ( ii == 0 ) { return ; } var curtype = undefined ; var cur = str . slice ( 0 , ii ) ; forEachStruct ( obj . name , obj , root , function ( structname , cobj , root ) { if ( cur == cobj . name . name ) { curtype = cobj . type ; } } ) ; if ( curtype != undefined ) { return getMember ( getGlobalObj ( curtype , root ) , str . slice ( ii + 1 ) , root ) ; } return ; }
根据名字取到成员
根据名字取到成员