On 2010-05-31 14:57, Florian Klaempfl wrote:
But, the parser does produce a parse tree, doesn't it.
FPC doesn't produce a parse tree during compilation. The parser puts
declarations/definitions immediatly into the symtables, for code an
intermediate representation is created which is indeed a tree but no
more a parse tree because statements might already be transformed.
So, if I understand this right, the code is parsed but instead of producing a tree, a more directly usable structure is created.

Now, the question is, can it be made to produce (in parallel with what it already does) a tree to be used elsewhere?

it can also reorganize some comments in such constructs.
The compiler simply discards comments and it has no infrastructure to
link comments in any way to code.
Naturally, comments are no good for the compiler --so, I am assuming
that the current parser does recognise comments but does not add them to
the parse tree; if so, it is fine, all it will have to do is to add
those nodes while the compiler still ignores them. Would that be too
difficult to add?
No idea, at least I expect a lot of pitfalls.
Pitfalls.. definitely --and probably more than what anyone can guess now.

That's why I'd like someone with the correct skill set to handle it.

--
Cheers,

Adem


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to