From Source to AST to CodeDom

I read books Language Implementation Templates ( http://pragprog.com/book/tpdsl/language-implementation-patterns ) among several others mixed with to clarify concepts, as well as a random website. I am trying to make a tool that reads a trivial programming language and does some basic analysis on it.

I am stuck at the design stage of this tool. I built a simple handwritten recursive decent parser that perfectly validates the source file. However, to perform manipulations with sources that have a CodeDom tree, it would be useful.

Questions:

1) Are logical steps tools like this: analyze and build a textual tree and corresponding symbol table, and then convert it to CodeDom?

2) When building a text tree, AST will be most convenient, it’s easier to convert to CodeDom .. but do Refactoring tools maintain a list of all built-in tokens in the instructions to save built-in comments and how do they track this in their tree?

+3
source share
1 answer

, , , , ... .

, .

DMS Software Reengineering Toolkit.

, DMS ; , "", , . , . , , , DMS , . DMS , , .

DMS , , , " ( ), ".

lexer, parser, prettyprinter transform, 9- . .

0

Source: https://habr.com/ru/post/1748322/


All Articles