www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DMD FrontEnd

reply "Charles" <no email.com> writes:
( Posted from email )

I am using the DMD front end for code completion / navigation, and have
gotten it to compile and can use it to succesfully parse code, and have been
looking through the semantic phases to see how I can create and use a symbol
table of sorts that I can then use to display all classes / functions /
aliases ( etc ... ), and use it to search for code-completion.  I don't have
any compiler experience , and Im struggling with it a bit.

Should I just take each Module and enumerate through their members, in a big
if block and based on each symbols type take a specific action ?  e.g.

/*.. code ..*/

--- Walters Reply ---

The way to do custom code for each symbol type is the same way semantic() is
done for each symbol. Create a new virtual function for what you want to do,
and override that function for each symbol. Then, loop through the members
of each module, calling that function.


Soon as the parser is done Ill release it in case others want to use it for
code completion and stuff.  ( its in C++ )

Thanks,
Charlie
Jan 02 2005
parent reply James Dunne <jdunne4 bradley.edu> writes:
Have you checked my posts about DLexer and DParse?  I'm in the process of
converting DMD's front end compiler's parsing code over to D.  I'll post the
final modules when I'm satisfied.  This will help with code-completion support
very much!  In fact, that's my goal.

In article <cr9nvg$9fc$1 digitaldaemon.com>, Charles says...
( Posted from email )

I am using the DMD front end for code completion / navigation, and have
gotten it to compile and can use it to succesfully parse code, and have been
looking through the semantic phases to see how I can create and use a symbol
table of sorts that I can then use to display all classes / functions /
aliases ( etc ... ), and use it to search for code-completion.  I don't have
any compiler experience , and Im struggling with it a bit.

Should I just take each Module and enumerate through their members, in a big
if block and based on each symbols type take a specific action ?  e.g.

/*.. code ..*/

--- Walters Reply ---

The way to do custom code for each symbol type is the same way semantic() is
done for each symbol. Create a new virtual function for what you want to do,
and override that function for each symbol. Then, loop through the members
of each module, calling that function.


Soon as the parser is done Ill release it in case others want to use it for
code completion and stuff.  ( its in C++ )

Thanks,
Charlie
Regards, James Dunne
Jan 05 2005
parent "Charles" <no email.com> writes:
Yep I've kept up with those threads :).  Looks very nice,  unfortunately
this project is in C++ , else I would definetly go with D.  Keep up the good
work !

Charlie


"James Dunne" <jdunne4 bradley.edu> wrote in message
news:crifrk$rer$1 digitaldaemon.com...
 Have you checked my posts about DLexer and DParse?  I'm in the process of
 converting DMD's front end compiler's parsing code over to D.  I'll post
the
 final modules when I'm satisfied.  This will help with code-completion
support
 very much!  In fact, that's my goal.

 In article <cr9nvg$9fc$1 digitaldaemon.com>, Charles says...
( Posted from email )

I am using the DMD front end for code completion / navigation, and have
gotten it to compile and can use it to succesfully parse code, and have
been
looking through the semantic phases to see how I can create and use a
symbol
table of sorts that I can then use to display all classes / functions /
aliases ( etc ... ), and use it to search for code-completion.  I don't
have
any compiler experience , and Im struggling with it a bit.

Should I just take each Module and enumerate through their members, in a
big
if block and based on each symbols type take a specific action ?  e.g.

/*.. code ..*/

--- Walters Reply ---

The way to do custom code for each symbol type is the same way semantic()
is
done for each symbol. Create a new virtual function for what you want to
do,
and override that function for each symbol. Then, loop through the
members
of each module, calling that function.


Soon as the parser is done Ill release it in case others want to use it
for
code completion and stuff.  ( its in C++ )

Thanks,
Charlie
Regards, James Dunne
Jan 06 2005