You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Gordon Smith <go...@adobe.com> on 2013/01/19 01:27:30 UTC

Falcon progress

Today I added MXML parser unit tests for MXMLPropertySpecifierNode in the case of properties of type Boolean, int, uint, Number, and String.

Here's some background about property-specifier nodes in Falcon:

Suppose a class has a property p of type int. Then you set can p on an instance (or a class definition) in three ways:

(1) Instance tag + property tag + instance tag for value

<MyComponent>
    <p>
        <int>1</int>
    </p>
</MyComponent>

(2) Instance tag + property tag + text for value

<MyComponent>
    <p>1</p>
</MyComponent>

(3) Property attrribute

<MyComponent p="1"/>

Note that (1) is the general case  and is required for properties of non-scalar type. (2) and (3) are just terser equivalents that can be used when the property has a scalar type.

These three MXML snippets all have the same semantics, and produce the same three nodes in the AST:

MXMLInstanceNode "MyComponent"
    MXMLPropertySpecifierNode "p"
        MXMLIntNode 1

which means "set the property p of the instance of MyComponent to the int 1".

The code generator produces ABC such as

// ... instance-ref
dup
// ... instance-ref instanceref
push 1
// ... instance-ref instance-ref property-value
setproperty p
// ... instance-ref

(where the comments show what is on the stack) for each MXMLPropertySpecifierNode, although I haven't added functional tests of property nodes yet.

- Gordon


RE: Falcon progress

Posted by Om <bi...@gmail.com>.
It looked fine the first two times :-)

Om
On Jan 18, 2013 5:26 PM, "Gordon Smith" <go...@adobe.com> wrote:

> Something's screwy. After fixing and resending it still looks bad. The
> final instruction is "setproperty p".
>
> - Gordon
>
> -----Original Message-----
> From: Gordon Smith [mailto:gosmith@adobe.com]
> Sent: Friday, January 18, 2013 4:33 PM
> To: dev@flex.apache.org
> Subject: RE: Falcon progress
>
> Fixed a missing newline that made the generate code hard to understand...
>
> -----Original Message-----
> From: Gordon Smith [mailto:gosmith@adobe.com]
> Sent: Friday, January 18, 2013 4:28 PM
> To: dev@flex.apache.org
> Subject: Falcon progress
>
> Today I added MXML parser unit tests for MXMLPropertySpecifierNode in the
> case of properties of type Boolean, int, uint, Number, and String.
>
> Here's some background about property-specifier nodes in Falcon:
>
> Suppose a class has a property p of type int. Then you set can p on an
> instance (or a class definition) in three ways:
>
> (1) Instance tag + property tag + instance tag for value
>
> <MyComponent>
>     <p>
>         <int>1</int>
>     </p>
> </MyComponent>
>
> (2) Instance tag + property tag + text for value
>
> <MyComponent>
>     <p>1</p>
> </MyComponent>
>
> (3) Property attrribute
>
> <MyComponent p="1"/>
>
> Note that (1) is the general case  and is required for properties of
> non-scalar type. (2) and (3) are just terser equivalents that can be used
> when the property has a scalar type.
>
> These three MXML snippets all have the same semantics, and produce the
> same three nodes in the AST:
>
> MXMLInstanceNode "MyComponent"
>     MXMLPropertySpecifierNode "p"
>         MXMLIntNode 1
>
> which means "set the property p of the instance of MyComponent to the int
> 1".
>
> The code generator produces ABC such as
>
> // ... instance-ref
> dup
> // ... instance-ref instanceref
> push 1
> // ... instance-ref instance-ref property-value setproperty p // ...
> instance-ref
>
> (where the comments show what is on the stack) for each
> MXMLPropertySpecifierNode, although I haven't added functional tests of
> property nodes yet.
>
> - Gordon
>
>

RE: Falcon progress

Posted by Gordon Smith <go...@adobe.com>.
Something's screwy. After fixing and resending it still looks bad. The final instruction is "setproperty p".

- Gordon

-----Original Message-----
From: Gordon Smith [mailto:gosmith@adobe.com] 
Sent: Friday, January 18, 2013 4:33 PM
To: dev@flex.apache.org
Subject: RE: Falcon progress

Fixed a missing newline that made the generate code hard to understand...

-----Original Message-----
From: Gordon Smith [mailto:gosmith@adobe.com]
Sent: Friday, January 18, 2013 4:28 PM
To: dev@flex.apache.org
Subject: Falcon progress

Today I added MXML parser unit tests for MXMLPropertySpecifierNode in the case of properties of type Boolean, int, uint, Number, and String.

Here's some background about property-specifier nodes in Falcon:

Suppose a class has a property p of type int. Then you set can p on an instance (or a class definition) in three ways:

(1) Instance tag + property tag + instance tag for value

<MyComponent>
    <p>
        <int>1</int>
    </p>
</MyComponent>

(2) Instance tag + property tag + text for value

<MyComponent>
    <p>1</p>
</MyComponent>

(3) Property attrribute

<MyComponent p="1"/>

Note that (1) is the general case  and is required for properties of non-scalar type. (2) and (3) are just terser equivalents that can be used when the property has a scalar type.

These three MXML snippets all have the same semantics, and produce the same three nodes in the AST:

MXMLInstanceNode "MyComponent"
    MXMLPropertySpecifierNode "p"
        MXMLIntNode 1

which means "set the property p of the instance of MyComponent to the int 1".

The code generator produces ABC such as

// ... instance-ref
dup
// ... instance-ref instanceref
push 1
// ... instance-ref instance-ref property-value setproperty p // ... instance-ref

(where the comments show what is on the stack) for each MXMLPropertySpecifierNode, although I haven't added functional tests of property nodes yet.

- Gordon


RE: Falcon progress

Posted by Gordon Smith <go...@adobe.com>.
Fixed a missing newline that made the generate code hard to understand...

-----Original Message-----
From: Gordon Smith [mailto:gosmith@adobe.com] 
Sent: Friday, January 18, 2013 4:28 PM
To: dev@flex.apache.org
Subject: Falcon progress

Today I added MXML parser unit tests for MXMLPropertySpecifierNode in the case of properties of type Boolean, int, uint, Number, and String.

Here's some background about property-specifier nodes in Falcon:

Suppose a class has a property p of type int. Then you set can p on an instance (or a class definition) in three ways:

(1) Instance tag + property tag + instance tag for value

<MyComponent>
    <p>
        <int>1</int>
    </p>
</MyComponent>

(2) Instance tag + property tag + text for value

<MyComponent>
    <p>1</p>
</MyComponent>

(3) Property attrribute

<MyComponent p="1"/>

Note that (1) is the general case  and is required for properties of non-scalar type. (2) and (3) are just terser equivalents that can be used when the property has a scalar type.

These three MXML snippets all have the same semantics, and produce the same three nodes in the AST:

MXMLInstanceNode "MyComponent"
    MXMLPropertySpecifierNode "p"
        MXMLIntNode 1

which means "set the property p of the instance of MyComponent to the int 1".

The code generator produces ABC such as

// ... instance-ref
dup
// ... instance-ref instanceref
push 1
// ... instance-ref instance-ref property-value
setproperty p
// ... instance-ref

(where the comments show what is on the stack) for each MXMLPropertySpecifierNode, although I haven't added functional tests of property nodes yet.

- Gordon