I use jcf for several weeks already and I think I find one more great useful usage for it.
Let's see from the beginning.
1. As I use emacs for development in free pascal/delphi project, I need to nagivate it somehow. Google says I am not alone in emacs+free pascal area :)
2. AFAIK, most advanced tag creation program for pascal is ctags. For c/c++ it does wonderful job and produces results of best quality.
3. For Pascal/Object Pascal/Free pascal/Delphi it's results are at least compared to manual regexp extraction/parsing of source code.
4. Navigation in emacs is just a matter of finding a line correspoding to any text "tag" (class name, type name, global variable and etc.)
5. Tag file itself is simply a sorted file with table in it. One field is tag, the second is file name, the third is line number.
6. We have a wonderful pascal parser (as I understand) in jcf. It is capable of full parsing the code, not just applying some fancy regexp on line level.
So technically we can just use jcf parser for emitting parsed info collected by its parser.
Now, I'd to ask how difficult it can be to implement such behaviour?
Maybe you might want just another project for this, using jcf parser engine?
P.S. At least one tester for this project you already have :)
Best regards,
Denis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think it would be easily doable to fit in a parse tree visitor that records all user identifiers in the format described.
I don't know if I will have time to do that though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
I use jcf for several weeks already and I think I find one more great useful usage for it.
Let's see from the beginning.
1. As I use emacs for development in free pascal/delphi project, I need to nagivate it somehow. Google says I am not alone in emacs+free pascal area :)
2. AFAIK, most advanced tag creation program for pascal is ctags. For c/c++ it does wonderful job and produces results of best quality.
3. For Pascal/Object Pascal/Free pascal/Delphi it's results are at least compared to manual regexp extraction/parsing of source code.
4. Navigation in emacs is just a matter of finding a line correspoding to any text "tag" (class name, type name, global variable and etc.)
5. Tag file itself is simply a sorted file with table in it. One field is tag, the second is file name, the third is line number.
6. We have a wonderful pascal parser (as I understand) in jcf. It is capable of full parsing the code, not just applying some fancy regexp on line level.
So technically we can just use jcf parser for emitting parsed info collected by its parser.
Now, I'd to ask how difficult it can be to implement such behaviour?
Maybe you might want just another project for this, using jcf parser engine?
P.S. At least one tester for this project you already have :)
Best regards,
Denis
I think it would be easily doable to fit in a parse tree visitor that records all user identifiers in the format described.
I don't know if I will have time to do that though.
>I think it would be easily doable to fit in a parse tree visitor that records all >user identifiers in the format described.
I'm glad to hear this :)
>I don't know if I will have time to do that though.
Ok, I see. Maybe you can pinpoint a place where it can be done?
I could try to implement it myself, with your consultations of course.
Best regards,
Denis
Well, you will need a class that descends from TBaseTreeNodeVisitor. Every process that inspects or changes the parse tree descends from this class.
Override VisitSourceToken and inspect the tokens as they are fed to you. Look at the Source token's TokenType and WordType.
Thanks, Anthony.
I'll try to implement it asap and contact you for further assistance.
Best regards,
Denis
Some questions already appeared. See developer's forum.
Thanks.