Author Topic: How to change parser?  (Read 12279 times)

Offline Digited

  • Multiple posting newcomer
  • *
  • Posts: 20
How to change parser?
« on: September 10, 2008, 04:12:50 pm »
I'm programming in DigitalMars D programming language, Code::Blocks is great for it, but it lacks D parser to be the best. There's a C tools & parser SeatD that I want to use in C::B. Where to start from? Can anyone (Ceniza?) give me basic code, that I can use with another parser and use autocompletion with it? Any ideas/suggestions will be very helpful.

Offline Digited

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: How to change parser?
« Reply #1 on: September 30, 2008, 02:12:30 pm »
So many replies...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: How to change parser?
« Reply #2 on: October 01, 2008, 07:52:20 pm »
the c++ parser we're using is hardwired. We want to improve it but nobody has stepped in to develop the new code completion module.

Sorry.

Offline Wolf

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to change parser?
« Reply #3 on: October 02, 2008, 04:04:46 pm »
I'd like to do it, but I got a new job, so I won't have much time to do so, and I have personal projects.

What I have suggested, however, is to use dynamic languages to do the parsing, such as Ruby, Lua, or Perl. This way, we could have a parser for each language, and anyone could write a parser for a custom language, without modifying Code::Blocks's source code. This may be a little slower, but it will be a lot more flexible. And I prefer slower to incomplete.

Tell me what you think about it.

-- Wolf --

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: How to change parser?
« Reply #4 on: October 04, 2008, 11:51:25 am »
I'm programming in DigitalMars D programming language, Code::Blocks is great for it, but it lacks D parser to be the best. There's a C tools & parser SeatD that I want to use in C::B. Where to start from? Can anyone (Ceniza?) give me basic code, that I can use with another parser and use autocompletion with it? Any ideas/suggestions will be very helpful.

Just like Rick said, the current parser is hardwired/hardcoded/handcrafted. You may want to check the "event hooks" in the current implementation of the C++ parser for Code::Blocks, then try to adapt it to use SeatD instead of the handcrafted one we use. I haven't looked into it myself, so I cannot really help here. I also started working, so my time is limited... plus, I don't have a good machine for development at home... YET.

My suggestion is to find and analyze the way the Code Completion Plugin hooks to the IDE, queries for files, builds the tree and shows tooltips. Try to understand most of it. You don't have to analyze the parser, neither the lexer, just the way it interacts with the IDE. If in doubt, you may ask for specific things related to that plugin. Hopefully, if someone knows, you'll be given the answer (I doubt I'll know it :P).

Offline Digited

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: How to change parser?
« Reply #5 on: October 13, 2008, 12:58:53 am »
ok. I'm using C::B for programming on D practically every day, so I definitely will try to use D parser.