The MASM Forum Archive 2004 to 2012

Specialised Projects => Assembler/Compiler Technology => Topic started by: cman on May 30, 2005, 12:28:35 AM

Title: Data Flow Analysis
Post by: cman on May 30, 2005, 12:28:35 AM
Can data flow analysis be performed during the parse of a source file ( forward flow analysis at least? ) . Is this a bad idea , if so ( seperation of concerns , ect... ). Thanks .... :U
Title: Re: Data Flow Analysis
Post by: tenkey on June 03, 2005, 08:56:19 PM
Sounds like a bad idea.

Do you want to be managing sets of values at the same time you're creating a symbol table?
Title: Re: Data Flow Analysis
Post by: Randall Hyde on June 30, 2005, 01:51:39 PM
Quote from: cman on May 30, 2005, 12:28:35 AM
Can data flow analysis be performed during the parse of a source file ( forward flow analysis at least? ) . Is this a bad idea , if so ( seperation of concerns , ect... ). Thanks .... :U

You can begin building the AST (abstract syntax tree) upon which you'll do the DFA, but successful data flow analysis generally requires random access to the AST. So generally, DFA occurs after the entire file is scanned and parsed (generally, this is a precursor to optimization, which occurs after code generation).
Cheers,
Randy Hyde