www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Hacking DMD to Query Context Information at Source File Offset

reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
Where should I put logic-and-printfs in DMD to show lexical, 
syntactic and semantic information about a symbol and/or 
expression at given position in the source file being parsed.

I'm guessing for some iteration in the lexical, syntactic and 
semantic passes respectively where I need to check whether my 
query offset lies inside inside some  context window currently 
being analyzed by DMD.
Mar 08 2014
parent Jacob Carlborg <doob me.com> writes:
On 2014-03-09 00:32, "Nordlöw" wrote:
 Where should I put logic-and-printfs in DMD to show lexical, syntactic
 and semantic information about a symbol and/or expression at given
 position in the source file being parsed.

 I'm guessing for some iteration in the lexical, syntactic and semantic
 passes respectively where I need to check whether my query offset lies
 inside inside some  context window currently being analyzed by DMD.
The lexer is implemented in lexer.c, the parser in parser.c and the semantics are implemented in the AST within these three functions "semantic", "semantic2" and "semantic3". For more information see: http://wiki.dlang.org/DMD_Source_Guide -- /Jacob Carlborg
Mar 09 2014