You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can create two IDL definition objects for Hello and World. Once the IDL definition object is created, it should keep the object in map-like data structure we called IDL definition map.
Dependency check
During creating IDL definition objects from IDL fragment, each task should check whether some type is already defined or not.
For example, if there is an IDL fragment as follows:
interfaceHello {
attribute World world;
attribute double yaho;
};
The above Hello interface needs World type and double type. The double type is a kind of basic types but the World type is not. If IDL definition of World type exists in the same IDL fragment, then might be no problem fortunately. But if not exists in above case, we have to wait for IDL definition object which is defined from external another IDL fragment.
To check this dependency, we should have IDL definition map in global area and update it whenever creating a new IDL definition object. For example, creating IDL definition object for Hello interface, it's only possible if IDL definition object for World is already created.
Undefined type map
While creating IDL definition object in parsing step, if we faced undefined type, we should wait for the type to be resolved. BTW, there is no way to block thread in code level in JavaScript(TypeScript as well). So, we should use Promise and if the type is already defined, the Promise should be resolved.
In other words, if we faced undefined type, we should queue the task into pending queue we called undefined type map.
No dependency
Happy case!
Generate binding code
If the generator code doesn't
The text was updated successfully, but these errors were encountered:
(WIP: To be updated design document)
Basic steps
Read IDL file
Parsing IDL fragment
Create IDL definition object
We should create IDL definition object(e.g. IDL interface, IDL enum and so on) from IDL fragment.
For example, if there is an IDL fragment,
We can create two IDL definition objects for
Hello
andWorld
. Once the IDL definition object is created, it should keep the object in map-like data structure we called IDL definition map.Dependency check
During creating IDL definition objects from IDL fragment, each task should check whether some type is already defined or not.
For example, if there is an IDL fragment as follows:
The above
Hello
interface needsWorld
type anddouble
type. Thedouble
type is a kind of basic types but theWorld
type is not. If IDL definition ofWorld
type exists in the same IDL fragment, then might be no problem fortunately. But if not exists in above case, we have to wait for IDL definition object which is defined from external another IDL fragment.To check this dependency, we should have IDL definition map in global area and update it whenever creating a new IDL definition object. For example, creating IDL definition object for
Hello
interface, it's only possible if IDL definition object forWorld
is already created.Undefined type map
While creating IDL definition object in parsing step, if we faced undefined type, we should wait for the type to be resolved. BTW, there is no way to block thread in code level in JavaScript(TypeScript as well). So, we should use
Promise
and if the type is already defined, thePromise
should be resolved.In other words, if we faced undefined type, we should queue the task into pending queue we called undefined type map.
No dependency
Happy case!
Generate binding code
The text was updated successfully, but these errors were encountered: