flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Smith <gosm...@adobe.com>
Subject Falcon progress
Date Sat, 19 Jan 2013 00:27:30 GMT
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


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


(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
// ... 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message