Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Source Formatter

<< < (2/10) > >>

rickg22:
Ceniza:

Please take a look into my "Copy strings" plugin, it's a very basic state-machine parser, and it recognizes C and C++ comments. The good thing about state machines is their simplicity. No need for long comparisons and particular cases, just a bunch of switches. I was amazed at its effectiveness :)

Ceniza:
rickg22: I took a look at it already, remember? You told me to do so :P

A state-machine is indeed very nice, simple and effective, but I just decided to hard code it instead :)

Anyway, the lexer is almost done (6 more tokens come to my mind, which can be added in just a few minutes (5 of those are keywords which are really simple to add) :D). Haven't had the time to do so though, maybe tomorrow I'll add those (yes, haven't had those few minutes yet).

What Takeshi Miya says is true. How many C/C++ parsers/lexers will be using Code::Blocks (even though some come from external libraries)?: CodeCompletion, Scintilla, AStyle, ¿AngelScript?, my Source Formatter, maybe a Refactoring one, ...

Anyway, those will be there; if anyone needs them, use them. At least my lexer is built as a library that relies only in C++.

One again, I'll tell you when I put the files in SVN or CVS (right, I'ven't done it yet).

Ceniza:
[edit]
I finally got to enable anonymous access to SVN, so here it is (removed the CVS info here):

Server: cenizasoft.cjb.net
Repository: /svnroot/SourceFormatter

Command line example:
svn co svn://cenizasoft.cjb.net/svnroot/SourceFormatter

Of course you can also use TortoiseSVN.

Right now the plugin just tests the lexer.
[/edit]

Michael:

--- Quote from: Ceniza on January 15, 2006, 07:52:28 am ---A state-machine is indeed very nice, simple and effective, but I just decided to hard code it instead :)

--- End quote ---

Sorry, but why you want to hard code it :?? IMHO, it is not a very good idea, because of e.g., extensibility, scalability.

Michael

thomas:

--- Quote from: Michael on January 15, 2006, 05:53:17 pm ---Sorry, but why you want to hard code it :?? IMHO, it is not a very good idea, because of e.g., extensibility, scalability.
--- End quote ---
Hey, hardcoding is great :)
(For me, that is, since I only use C++)

I'd love to see a better source code formatter for C++. And since hardcoding the lexer saves Ceniza precious time, this means he'll be done with it sooner (and I'll be happy sooner :))

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version