Internals: Source cycle
The MXML compiler handles three source formats simultaneously: ActionScript 3, MXML and CSS.
First pass
- For all ActionScript 3 sources, enumerate every package definition into an immutable sequence = allPackages.
- For each definition in allPackages, declare the respective ActionScript 3 package.
- For each MXML source, declare the respective ActionScript 3 package.
Resolution passes
- Let remPackages be a mutable clone of the allPackages sequence.
- Let remAS be a mutable sequence containing all ActionScript 3 sources.
- Let remMXML be a mutable sequence containing all MXML sources.
- Let remCSS be an empty sequence.
- While remPackages is non empty or remMXML is non empty
- Visit directives across remPackages or defer otherwise.
- Remove each element from remPackages that is of the
VerifierPhase::Finished
phase.
- Remove each element from remPackages that is of the
- Visit element in remMXML or defer otherwise.
- Remove each element from remMXML that is of the
VerifierPhase::Finished
phase.
- Remove each element from remMXML that is of the
- Visit directives across remPackages or defer otherwise.
- For each package in allPackages
- Visit statements
- While remAS is non empty
- Resolve directives and then statements for each remAS
- Remove each element from remAS that has been finished.
- While remCSS is non empty
- Visit directives for each remCSS element or defer
- Remove each element from remCSS that has been finished.
- Visit each deferred function expression or defer for a number of
MAX_CYCLES
. - Add verify error for each function expression that could not be resolved.
- Finish each definition conflict, reporting any errors.
- Reset verifier state.