Monday, 15 September 2014

programming languages - Where can I learn about semantic analysis? -



programming languages - Where can I learn about semantic analysis? -

i've been working on semantic analysis pass own customary language little while without much success. if search such things on google, vast bulk of links uselses university course of study materials, or academic papers, or unrelated processes, illustration semantic analysis of english language text, rather useful knowledge.

i've looked legendary dragon book, read not contain much in regard (and way out of cost range on amazon right now).

any recommendations can find materials specific phase of compilation?

semantic analysis blanket term covering many simple steps within compiler.

it consists of following:

syntax sugar and/or macro expansion pass simplify farther analysis identifier resolution , renaming. i.e., each name turned qualified identifier, each locally scoped identifier given unique name type checking (either type inference or type propagation) constraint checks various sanity checks (i.e., "if non-void function returns value", or "if variable used before initialisation")

the current trend seek confine constraint checks type scheme instead of having separate passes. generic , powerful typing algorithm suitable many different languages hindley-milner. although might complicated, in fact easier implement dumb type propagation (as in c or java), if right way.

one generic , simple trick doing both complex typing , arbitrary semantic checks walk on ast , emit flat sequence of prolog (in cases datalog) expressions can feed simple prolog interpreter , whole ast constraints scheme solved.

programming-languages semantics

No comments:

Post a Comment